fog-openstack 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +30 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/CONTRIBUTING.md +18 -0
- data/Gemfile +4 -0
- data/LICENSE.md +20 -0
- data/README.md +41 -0
- data/Rakefile +8 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/fog-openstack.gemspec +33 -0
- data/lib/fog/openstack.rb +508 -0
- data/lib/fog/openstack/CHANGELOG.md +47 -0
- data/lib/fog/openstack/baremetal.rb +308 -0
- data/lib/fog/openstack/common.rb +46 -0
- data/lib/fog/openstack/compute.rb +397 -0
- data/lib/fog/openstack/core.rb +114 -0
- data/lib/fog/openstack/docs/compute.md +681 -0
- data/lib/fog/openstack/docs/getting_started.md +81 -0
- data/lib/fog/openstack/docs/orchestration.md +318 -0
- data/lib/fog/openstack/docs/planning.md +270 -0
- data/lib/fog/openstack/docs/storage.md +453 -0
- data/lib/fog/openstack/errors.rb +42 -0
- data/lib/fog/openstack/examples/compute/basics.rb +50 -0
- data/lib/fog/openstack/examples/compute/block_device_mapping_v2.rb +32 -0
- data/lib/fog/openstack/examples/identity/basics.rb +68 -0
- data/lib/fog/openstack/examples/image/upload-test-image.rb +77 -0
- data/lib/fog/openstack/examples/network/network_subnets_routers.rb +62 -0
- data/lib/fog/openstack/examples/planning/basics.rb +53 -0
- data/lib/fog/openstack/examples/storage/set-account-quota.rb +66 -0
- data/lib/fog/openstack/identity.rb +27 -0
- data/lib/fog/openstack/identity_v2.rb +203 -0
- data/lib/fog/openstack/identity_v3.rb +181 -0
- data/lib/fog/openstack/image.rb +22 -0
- data/lib/fog/openstack/image_v1.rb +148 -0
- data/lib/fog/openstack/image_v2.rb +142 -0
- data/lib/fog/openstack/metering.rb +145 -0
- data/lib/fog/openstack/models/baremetal/chassis.rb +49 -0
- data/lib/fog/openstack/models/baremetal/chassis_collection.rb +44 -0
- data/lib/fog/openstack/models/baremetal/driver.rb +24 -0
- data/lib/fog/openstack/models/baremetal/drivers.rb +21 -0
- data/lib/fog/openstack/models/baremetal/node.rb +96 -0
- data/lib/fog/openstack/models/baremetal/nodes.rb +44 -0
- data/lib/fog/openstack/models/baremetal/port.rb +50 -0
- data/lib/fog/openstack/models/baremetal/ports.rb +44 -0
- data/lib/fog/openstack/models/collection.rb +45 -0
- data/lib/fog/openstack/models/compute/address.rb +67 -0
- data/lib/fog/openstack/models/compute/addresses.rb +28 -0
- data/lib/fog/openstack/models/compute/aggregate.rb +58 -0
- data/lib/fog/openstack/models/compute/aggregates.rb +26 -0
- data/lib/fog/openstack/models/compute/availability_zone.rb +14 -0
- data/lib/fog/openstack/models/compute/availability_zones.rb +22 -0
- data/lib/fog/openstack/models/compute/flavor.rb +52 -0
- data/lib/fog/openstack/models/compute/flavors.rb +29 -0
- data/lib/fog/openstack/models/compute/host.rb +28 -0
- data/lib/fog/openstack/models/compute/hosts.rb +28 -0
- data/lib/fog/openstack/models/compute/image.rb +48 -0
- data/lib/fog/openstack/models/compute/images.rb +38 -0
- data/lib/fog/openstack/models/compute/key_pair.rb +56 -0
- data/lib/fog/openstack/models/compute/key_pairs.rb +29 -0
- data/lib/fog/openstack/models/compute/metadata.rb +65 -0
- data/lib/fog/openstack/models/compute/metadatum.rb +27 -0
- data/lib/fog/openstack/models/compute/network.rb +13 -0
- data/lib/fog/openstack/models/compute/networks.rb +30 -0
- data/lib/fog/openstack/models/compute/security_group.rb +57 -0
- data/lib/fog/openstack/models/compute/security_group_rule.rb +32 -0
- data/lib/fog/openstack/models/compute/security_group_rules.rb +21 -0
- data/lib/fog/openstack/models/compute/security_groups.rb +24 -0
- data/lib/fog/openstack/models/compute/server.rb +410 -0
- data/lib/fog/openstack/models/compute/servers.rb +59 -0
- data/lib/fog/openstack/models/compute/service.rb +42 -0
- data/lib/fog/openstack/models/compute/services.rb +23 -0
- data/lib/fog/openstack/models/compute/snapshot.rb +32 -0
- data/lib/fog/openstack/models/compute/snapshots.rb +37 -0
- data/lib/fog/openstack/models/compute/tenant.rb +24 -0
- data/lib/fog/openstack/models/compute/tenants.rb +25 -0
- data/lib/fog/openstack/models/compute/volume.rb +52 -0
- data/lib/fog/openstack/models/compute/volumes.rb +37 -0
- data/lib/fog/openstack/models/identity_v2/ec2_credential.rb +39 -0
- data/lib/fog/openstack/models/identity_v2/ec2_credentials.rb +56 -0
- data/lib/fog/openstack/models/identity_v2/role.rb +52 -0
- data/lib/fog/openstack/models/identity_v2/roles.rb +22 -0
- data/lib/fog/openstack/models/identity_v2/tenant.rb +60 -0
- data/lib/fog/openstack/models/identity_v2/tenants.rb +31 -0
- data/lib/fog/openstack/models/identity_v2/user.rb +69 -0
- data/lib/fog/openstack/models/identity_v2/users.rb +45 -0
- data/lib/fog/openstack/models/identity_v3/domain.rb +49 -0
- data/lib/fog/openstack/models/identity_v3/domains.rb +50 -0
- data/lib/fog/openstack/models/identity_v3/endpoint.rb +46 -0
- data/lib/fog/openstack/models/identity_v3/endpoints.rb +26 -0
- data/lib/fog/openstack/models/identity_v3/group.rb +92 -0
- data/lib/fog/openstack/models/identity_v3/groups.rb +31 -0
- data/lib/fog/openstack/models/identity_v3/os_credential.rb +73 -0
- data/lib/fog/openstack/models/identity_v3/os_credentials.rb +31 -0
- data/lib/fog/openstack/models/identity_v3/policies.rb +31 -0
- data/lib/fog/openstack/models/identity_v3/policy.rb +42 -0
- data/lib/fog/openstack/models/identity_v3/project.rb +106 -0
- data/lib/fog/openstack/models/identity_v3/projects.rb +57 -0
- data/lib/fog/openstack/models/identity_v3/role.rb +40 -0
- data/lib/fog/openstack/models/identity_v3/role_assignment.rb +22 -0
- data/lib/fog/openstack/models/identity_v3/role_assignments.rb +25 -0
- data/lib/fog/openstack/models/identity_v3/roles.rb +39 -0
- data/lib/fog/openstack/models/identity_v3/service.rb +47 -0
- data/lib/fog/openstack/models/identity_v3/services.rb +31 -0
- data/lib/fog/openstack/models/identity_v3/token.rb +26 -0
- data/lib/fog/openstack/models/identity_v3/tokens.rb +41 -0
- data/lib/fog/openstack/models/identity_v3/user.rb +81 -0
- data/lib/fog/openstack/models/identity_v3/users.rb +35 -0
- data/lib/fog/openstack/models/image_v1/image.rb +78 -0
- data/lib/fog/openstack/models/image_v1/images.rb +70 -0
- data/lib/fog/openstack/models/image_v2/image.rb +149 -0
- data/lib/fog/openstack/models/image_v2/images.rb +67 -0
- data/lib/fog/openstack/models/meta_parent.rb +31 -0
- data/lib/fog/openstack/models/metering/meter.rb +0 -0
- data/lib/fog/openstack/models/metering/meters.rb +0 -0
- data/lib/fog/openstack/models/metering/resource.rb +15 -0
- data/lib/fog/openstack/models/metering/resources.rb +23 -0
- data/lib/fog/openstack/models/model.rb +44 -0
- data/lib/fog/openstack/models/network/floating_ip.rb +40 -0
- data/lib/fog/openstack/models/network/floating_ips.rb +32 -0
- data/lib/fog/openstack/models/network/lb_health_monitor.rb +57 -0
- data/lib/fog/openstack/models/network/lb_health_monitors.rb +32 -0
- data/lib/fog/openstack/models/network/lb_member.rb +42 -0
- data/lib/fog/openstack/models/network/lb_members.rb +32 -0
- data/lib/fog/openstack/models/network/lb_pool.rb +67 -0
- data/lib/fog/openstack/models/network/lb_pools.rb +32 -0
- data/lib/fog/openstack/models/network/lb_vip.rb +48 -0
- data/lib/fog/openstack/models/network/lb_vips.rb +32 -0
- data/lib/fog/openstack/models/network/network.rb +43 -0
- data/lib/fog/openstack/models/network/networks.rb +32 -0
- data/lib/fog/openstack/models/network/port.rb +42 -0
- data/lib/fog/openstack/models/network/ports.rb +32 -0
- data/lib/fog/openstack/models/network/router.rb +61 -0
- data/lib/fog/openstack/models/network/routers.rb +32 -0
- data/lib/fog/openstack/models/network/security_group.rb +32 -0
- data/lib/fog/openstack/models/network/security_group_rule.rb +33 -0
- data/lib/fog/openstack/models/network/security_group_rules.rb +32 -0
- data/lib/fog/openstack/models/network/security_groups.rb +32 -0
- data/lib/fog/openstack/models/network/subnet.rb +44 -0
- data/lib/fog/openstack/models/network/subnets.rb +32 -0
- data/lib/fog/openstack/models/orchestration/event.rb +20 -0
- data/lib/fog/openstack/models/orchestration/events.rb +31 -0
- data/lib/fog/openstack/models/orchestration/resource.rb +32 -0
- data/lib/fog/openstack/models/orchestration/resource_schemas.rb +17 -0
- data/lib/fog/openstack/models/orchestration/resources.rb +36 -0
- data/lib/fog/openstack/models/orchestration/stack.rb +120 -0
- data/lib/fog/openstack/models/orchestration/stacks.rb +64 -0
- data/lib/fog/openstack/models/orchestration/template.rb +15 -0
- data/lib/fog/openstack/models/orchestration/templates.rb +45 -0
- data/lib/fog/openstack/models/planning/plan.rb +70 -0
- data/lib/fog/openstack/models/planning/plans.rb +31 -0
- data/lib/fog/openstack/models/planning/role.rb +23 -0
- data/lib/fog/openstack/models/planning/roles.rb +16 -0
- data/lib/fog/openstack/models/storage/directories.rb +36 -0
- data/lib/fog/openstack/models/storage/directory.rb +50 -0
- data/lib/fog/openstack/models/storage/file.rb +185 -0
- data/lib/fog/openstack/models/storage/files.rb +101 -0
- data/lib/fog/openstack/models/volume/availability_zone.rb +10 -0
- data/lib/fog/openstack/models/volume/availability_zones.rb +14 -0
- data/lib/fog/openstack/models/volume/transfer.rb +28 -0
- data/lib/fog/openstack/models/volume/transfers.rb +35 -0
- data/lib/fog/openstack/models/volume/volume.rb +36 -0
- data/lib/fog/openstack/models/volume/volume_type.rb +36 -0
- data/lib/fog/openstack/models/volume/volume_types.rb +22 -0
- data/lib/fog/openstack/models/volume/volumes.rb +35 -0
- data/lib/fog/openstack/models/volume_v1/availability_zone.rb +15 -0
- data/lib/fog/openstack/models/volume_v1/availability_zones.rb +16 -0
- data/lib/fog/openstack/models/volume_v1/transfer.rb +18 -0
- data/lib/fog/openstack/models/volume_v1/transfers.rb +16 -0
- data/lib/fog/openstack/models/volume_v1/volume.rb +26 -0
- data/lib/fog/openstack/models/volume_v1/volume_type.rb +16 -0
- data/lib/fog/openstack/models/volume_v1/volume_types.rb +16 -0
- data/lib/fog/openstack/models/volume_v1/volumes.rb +16 -0
- data/lib/fog/openstack/models/volume_v2/availability_zone.rb +15 -0
- data/lib/fog/openstack/models/volume_v2/availability_zones.rb +16 -0
- data/lib/fog/openstack/models/volume_v2/transfer.rb +19 -0
- data/lib/fog/openstack/models/volume_v2/transfers.rb +16 -0
- data/lib/fog/openstack/models/volume_v2/volume.rb +27 -0
- data/lib/fog/openstack/models/volume_v2/volume_type.rb +16 -0
- data/lib/fog/openstack/models/volume_v2/volume_types.rb +16 -0
- data/lib/fog/openstack/models/volume_v2/volumes.rb +16 -0
- data/lib/fog/openstack/network.rb +293 -0
- data/lib/fog/openstack/orchestration.rb +192 -0
- data/lib/fog/openstack/planning.rb +174 -0
- data/lib/fog/openstack/requests/baremetal/create_chassis.rb +44 -0
- data/lib/fog/openstack/requests/baremetal/create_node.rb +54 -0
- data/lib/fog/openstack/requests/baremetal/create_port.rb +46 -0
- data/lib/fog/openstack/requests/baremetal/delete_chassis.rb +25 -0
- data/lib/fog/openstack/requests/baremetal/delete_node.rb +25 -0
- data/lib/fog/openstack/requests/baremetal/delete_port.rb +25 -0
- data/lib/fog/openstack/requests/baremetal/get_chassis.rb +24 -0
- data/lib/fog/openstack/requests/baremetal/get_driver.rb +24 -0
- data/lib/fog/openstack/requests/baremetal/get_driver_properties.rb +40 -0
- data/lib/fog/openstack/requests/baremetal/get_node.rb +24 -0
- data/lib/fog/openstack/requests/baremetal/get_port.rb +24 -0
- data/lib/fog/openstack/requests/baremetal/list_chassis.rb +42 -0
- data/lib/fog/openstack/requests/baremetal/list_chassis_detailed.rb +25 -0
- data/lib/fog/openstack/requests/baremetal/list_drivers.rb +25 -0
- data/lib/fog/openstack/requests/baremetal/list_nodes.rb +34 -0
- data/lib/fog/openstack/requests/baremetal/list_nodes_detailed.rb +25 -0
- data/lib/fog/openstack/requests/baremetal/list_ports.rb +42 -0
- data/lib/fog/openstack/requests/baremetal/list_ports_detailed.rb +25 -0
- data/lib/fog/openstack/requests/baremetal/patch_chassis.rb +42 -0
- data/lib/fog/openstack/requests/baremetal/patch_node.rb +41 -0
- data/lib/fog/openstack/requests/baremetal/patch_port.rb +41 -0
- data/lib/fog/openstack/requests/baremetal/set_node_maintenance.rb +30 -0
- data/lib/fog/openstack/requests/baremetal/set_node_power_state.rb +35 -0
- data/lib/fog/openstack/requests/baremetal/set_node_provision_state.rb +38 -0
- data/lib/fog/openstack/requests/baremetal/unset_node_maintenance.rb +30 -0
- data/lib/fog/openstack/requests/compute/add_aggregate_host.rb +30 -0
- data/lib/fog/openstack/requests/compute/add_fixed_ip.rb +29 -0
- data/lib/fog/openstack/requests/compute/add_flavor_access.rb +31 -0
- data/lib/fog/openstack/requests/compute/add_security_group.rb +20 -0
- data/lib/fog/openstack/requests/compute/allocate_address.rb +39 -0
- data/lib/fog/openstack/requests/compute/associate_address.rb +30 -0
- data/lib/fog/openstack/requests/compute/attach_volume.rb +38 -0
- data/lib/fog/openstack/requests/compute/boot_from_snapshot.rb +41 -0
- data/lib/fog/openstack/requests/compute/change_server_password.rb +20 -0
- data/lib/fog/openstack/requests/compute/confirm_resize_server.rb +20 -0
- data/lib/fog/openstack/requests/compute/create_aggregate.rb +42 -0
- data/lib/fog/openstack/requests/compute/create_flavor.rb +85 -0
- data/lib/fog/openstack/requests/compute/create_flavor_metadata.rb +38 -0
- data/lib/fog/openstack/requests/compute/create_image.rb +44 -0
- data/lib/fog/openstack/requests/compute/create_key_pair.rb +46 -0
- data/lib/fog/openstack/requests/compute/create_security_group.rb +50 -0
- data/lib/fog/openstack/requests/compute/create_security_group_rule.rb +57 -0
- data/lib/fog/openstack/requests/compute/create_server.rb +185 -0
- data/lib/fog/openstack/requests/compute/create_volume.rb +51 -0
- data/lib/fog/openstack/requests/compute/create_volume_snapshot.rb +51 -0
- data/lib/fog/openstack/requests/compute/delete_aggregate.rb +28 -0
- data/lib/fog/openstack/requests/compute/delete_flavor.rb +28 -0
- data/lib/fog/openstack/requests/compute/delete_image.rb +35 -0
- data/lib/fog/openstack/requests/compute/delete_key_pair.rb +29 -0
- data/lib/fog/openstack/requests/compute/delete_meta.rb +35 -0
- data/lib/fog/openstack/requests/compute/delete_metadata.rb +23 -0
- data/lib/fog/openstack/requests/compute/delete_security_group.rb +31 -0
- data/lib/fog/openstack/requests/compute/delete_security_group_rule.rb +31 -0
- data/lib/fog/openstack/requests/compute/delete_server.rb +34 -0
- data/lib/fog/openstack/requests/compute/delete_service.rb +32 -0
- data/lib/fog/openstack/requests/compute/delete_snapshot.rb +28 -0
- data/lib/fog/openstack/requests/compute/delete_volume.rb +28 -0
- data/lib/fog/openstack/requests/compute/detach_volume.rb +28 -0
- data/lib/fog/openstack/requests/compute/disable_service.rb +37 -0
- data/lib/fog/openstack/requests/compute/disable_service_log_reason.rb +38 -0
- data/lib/fog/openstack/requests/compute/disassociate_address.rb +25 -0
- data/lib/fog/openstack/requests/compute/enable_service.rb +38 -0
- data/lib/fog/openstack/requests/compute/evacuate_server.rb +26 -0
- data/lib/fog/openstack/requests/compute/get_address.rb +38 -0
- data/lib/fog/openstack/requests/compute/get_aggregate.rb +26 -0
- data/lib/fog/openstack/requests/compute/get_console_output.rb +24 -0
- data/lib/fog/openstack/requests/compute/get_flavor_details.rb +39 -0
- data/lib/fog/openstack/requests/compute/get_flavor_metadata.rb +27 -0
- data/lib/fog/openstack/requests/compute/get_host_details.rb +66 -0
- data/lib/fog/openstack/requests/compute/get_hypervisor_statistics.rb +39 -0
- data/lib/fog/openstack/requests/compute/get_image_details.rb +28 -0
- data/lib/fog/openstack/requests/compute/get_limits.rb +89 -0
- data/lib/fog/openstack/requests/compute/get_metadata.rb +24 -0
- data/lib/fog/openstack/requests/compute/get_quota.rb +26 -0
- data/lib/fog/openstack/requests/compute/get_quota_defaults.rb +26 -0
- data/lib/fog/openstack/requests/compute/get_security_group.rb +37 -0
- data/lib/fog/openstack/requests/compute/get_security_group_rule.rb +38 -0
- data/lib/fog/openstack/requests/compute/get_server_details.rb +28 -0
- data/lib/fog/openstack/requests/compute/get_server_password.rb +28 -0
- data/lib/fog/openstack/requests/compute/get_server_volumes.rb +27 -0
- data/lib/fog/openstack/requests/compute/get_snapshot_details.rb +29 -0
- data/lib/fog/openstack/requests/compute/get_usage.rb +51 -0
- data/lib/fog/openstack/requests/compute/get_vnc_console.rb +40 -0
- data/lib/fog/openstack/requests/compute/get_volume_details.rb +28 -0
- data/lib/fog/openstack/requests/compute/list_address_pools.rb +28 -0
- data/lib/fog/openstack/requests/compute/list_addresses.rb +28 -0
- data/lib/fog/openstack/requests/compute/list_aggregates.rb +36 -0
- data/lib/fog/openstack/requests/compute/list_all_addresses.rb +62 -0
- data/lib/fog/openstack/requests/compute/list_flavors.rb +35 -0
- data/lib/fog/openstack/requests/compute/list_flavors_detail.rb +35 -0
- data/lib/fog/openstack/requests/compute/list_hosts.rb +28 -0
- data/lib/fog/openstack/requests/compute/list_images.rb +29 -0
- data/lib/fog/openstack/requests/compute/list_images_detail.rb +36 -0
- data/lib/fog/openstack/requests/compute/list_key_pairs.rb +38 -0
- data/lib/fog/openstack/requests/compute/list_metadata.rb +24 -0
- data/lib/fog/openstack/requests/compute/list_private_addresses.rb +28 -0
- data/lib/fog/openstack/requests/compute/list_public_addresses.rb +28 -0
- data/lib/fog/openstack/requests/compute/list_security_groups.rb +69 -0
- data/lib/fog/openstack/requests/compute/list_servers.rb +36 -0
- data/lib/fog/openstack/requests/compute/list_servers_detail.rb +43 -0
- data/lib/fog/openstack/requests/compute/list_services.rb +66 -0
- data/lib/fog/openstack/requests/compute/list_snapshots.rb +40 -0
- data/lib/fog/openstack/requests/compute/list_snapshots_detail.rb +26 -0
- data/lib/fog/openstack/requests/compute/list_tenants.rb +45 -0
- data/lib/fog/openstack/requests/compute/list_tenants_with_flavor_access.rb +26 -0
- data/lib/fog/openstack/requests/compute/list_usages.rb +41 -0
- data/lib/fog/openstack/requests/compute/list_volumes.rb +39 -0
- data/lib/fog/openstack/requests/compute/list_volumes_detail.rb +25 -0
- data/lib/fog/openstack/requests/compute/list_zones.rb +33 -0
- data/lib/fog/openstack/requests/compute/list_zones_detailed.rb +55 -0
- data/lib/fog/openstack/requests/compute/live_migrate_server.rb +26 -0
- data/lib/fog/openstack/requests/compute/migrate_server.rb +20 -0
- data/lib/fog/openstack/requests/compute/pause_server.rb +24 -0
- data/lib/fog/openstack/requests/compute/reboot_server.rb +20 -0
- data/lib/fog/openstack/requests/compute/rebuild_server.rb +34 -0
- data/lib/fog/openstack/requests/compute/release_address.rb +29 -0
- data/lib/fog/openstack/requests/compute/remove_aggregate_host.rb +30 -0
- data/lib/fog/openstack/requests/compute/remove_fixed_ip.rb +29 -0
- data/lib/fog/openstack/requests/compute/remove_flavor_access.rb +31 -0
- data/lib/fog/openstack/requests/compute/remove_security_group.rb +20 -0
- data/lib/fog/openstack/requests/compute/rescue_server.rb +24 -0
- data/lib/fog/openstack/requests/compute/reset_server_state.rb +20 -0
- data/lib/fog/openstack/requests/compute/resize_server.rb +20 -0
- data/lib/fog/openstack/requests/compute/resume_server.rb +24 -0
- data/lib/fog/openstack/requests/compute/revert_resize_server.rb +26 -0
- data/lib/fog/openstack/requests/compute/server_action.rb +16 -0
- data/lib/fog/openstack/requests/compute/server_actions.rb +38 -0
- data/lib/fog/openstack/requests/compute/server_diagnostics.rb +25 -0
- data/lib/fog/openstack/requests/compute/set_metadata.rb +37 -0
- data/lib/fog/openstack/requests/compute/set_tenant.rb +19 -0
- data/lib/fog/openstack/requests/compute/shelve_offload_server.rb +24 -0
- data/lib/fog/openstack/requests/compute/shelve_server.rb +24 -0
- data/lib/fog/openstack/requests/compute/start_server.rb +24 -0
- data/lib/fog/openstack/requests/compute/stop_server.rb +24 -0
- data/lib/fog/openstack/requests/compute/suspend_server.rb +24 -0
- data/lib/fog/openstack/requests/compute/unpause_server.rb +24 -0
- data/lib/fog/openstack/requests/compute/unshelve_server.rb +24 -0
- data/lib/fog/openstack/requests/compute/update_aggregate.rb +37 -0
- data/lib/fog/openstack/requests/compute/update_aggregate_metadata.rb +30 -0
- data/lib/fog/openstack/requests/compute/update_meta.rb +38 -0
- data/lib/fog/openstack/requests/compute/update_metadata.rb +38 -0
- data/lib/fog/openstack/requests/compute/update_quota.rb +28 -0
- data/lib/fog/openstack/requests/compute/update_server.rb +31 -0
- data/lib/fog/openstack/requests/identity_v2/add_user_to_tenant.rb +36 -0
- data/lib/fog/openstack/requests/identity_v2/check_token.rb +22 -0
- data/lib/fog/openstack/requests/identity_v2/create_ec2_credential.rb +59 -0
- data/lib/fog/openstack/requests/identity_v2/create_role.rb +38 -0
- data/lib/fog/openstack/requests/identity_v2/create_tenant.rb +34 -0
- data/lib/fog/openstack/requests/identity_v2/create_user.rb +45 -0
- data/lib/fog/openstack/requests/identity_v2/create_user_role.rb +26 -0
- data/lib/fog/openstack/requests/identity_v2/delete_ec2_credential.rb +43 -0
- data/lib/fog/openstack/requests/identity_v2/delete_role.rb +30 -0
- data/lib/fog/openstack/requests/identity_v2/delete_tenant.rb +33 -0
- data/lib/fog/openstack/requests/identity_v2/delete_user.rb +30 -0
- data/lib/fog/openstack/requests/identity_v2/delete_user_role.rb +25 -0
- data/lib/fog/openstack/requests/identity_v2/get_ec2_credential.rb +50 -0
- data/lib/fog/openstack/requests/identity_v2/get_role.rb +30 -0
- data/lib/fog/openstack/requests/identity_v2/get_tenant.rb +33 -0
- data/lib/fog/openstack/requests/identity_v2/get_tenants_by_id.rb +20 -0
- data/lib/fog/openstack/requests/identity_v2/get_tenants_by_name.rb +20 -0
- data/lib/fog/openstack/requests/identity_v2/get_user_by_id.rb +34 -0
- data/lib/fog/openstack/requests/identity_v2/get_user_by_name.rb +29 -0
- data/lib/fog/openstack/requests/identity_v2/list_ec2_credentials.rb +61 -0
- data/lib/fog/openstack/requests/identity_v2/list_endpoints_for_token.rb +20 -0
- data/lib/fog/openstack/requests/identity_v2/list_roles.rb +34 -0
- data/lib/fog/openstack/requests/identity_v2/list_roles_for_user_on_tenant.rb +32 -0
- data/lib/fog/openstack/requests/identity_v2/list_tenants.rb +53 -0
- data/lib/fog/openstack/requests/identity_v2/list_user_global_roles.rb +20 -0
- data/lib/fog/openstack/requests/identity_v2/list_users.rb +47 -0
- data/lib/fog/openstack/requests/identity_v2/remove_user_from_tenant.rb +22 -0
- data/lib/fog/openstack/requests/identity_v2/set_tenant.rb +21 -0
- data/lib/fog/openstack/requests/identity_v2/update_tenant.rb +30 -0
- data/lib/fog/openstack/requests/identity_v2/update_user.rb +34 -0
- data/lib/fog/openstack/requests/identity_v2/validate_token.rb +22 -0
- data/lib/fog/openstack/requests/identity_v3/add_user_to_group.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/auth_domains.rb +24 -0
- data/lib/fog/openstack/requests/identity_v3/auth_projects.rb +24 -0
- data/lib/fog/openstack/requests/identity_v3/check_domain_group_role.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/check_domain_user_role.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/check_project_group_role.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/check_project_user_role.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/create_domain.rb +21 -0
- data/lib/fog/openstack/requests/identity_v3/create_endpoint.rb +21 -0
- data/lib/fog/openstack/requests/identity_v3/create_group.rb +21 -0
- data/lib/fog/openstack/requests/identity_v3/create_os_credential.rb +21 -0
- data/lib/fog/openstack/requests/identity_v3/create_policy.rb +21 -0
- data/lib/fog/openstack/requests/identity_v3/create_project.rb +21 -0
- data/lib/fog/openstack/requests/identity_v3/create_role.rb +21 -0
- data/lib/fog/openstack/requests/identity_v3/create_service.rb +21 -0
- data/lib/fog/openstack/requests/identity_v3/create_user.rb +21 -0
- data/lib/fog/openstack/requests/identity_v3/delete_domain.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/delete_endpoint.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/delete_group.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/delete_os_credential.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/delete_policy.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/delete_project.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/delete_role.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/delete_service.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/delete_user.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/get_domain.rb +23 -0
- data/lib/fog/openstack/requests/identity_v3/get_endpoint.rb +23 -0
- data/lib/fog/openstack/requests/identity_v3/get_group.rb +23 -0
- data/lib/fog/openstack/requests/identity_v3/get_os_credential.rb +23 -0
- data/lib/fog/openstack/requests/identity_v3/get_policy.rb +23 -0
- data/lib/fog/openstack/requests/identity_v3/get_project.rb +23 -0
- data/lib/fog/openstack/requests/identity_v3/get_role.rb +23 -0
- data/lib/fog/openstack/requests/identity_v3/get_service.rb +23 -0
- data/lib/fog/openstack/requests/identity_v3/get_user.rb +23 -0
- data/lib/fog/openstack/requests/identity_v3/grant_domain_group_role.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/grant_domain_user_role.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/grant_project_group_role.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/grant_project_user_role.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/group_user_check.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/list_domain_group_roles.rb +23 -0
- data/lib/fog/openstack/requests/identity_v3/list_domain_user_roles.rb +23 -0
- data/lib/fog/openstack/requests/identity_v3/list_domains.rb +24 -0
- data/lib/fog/openstack/requests/identity_v3/list_endpoints.rb +24 -0
- data/lib/fog/openstack/requests/identity_v3/list_group_users.rb +24 -0
- data/lib/fog/openstack/requests/identity_v3/list_groups.rb +32 -0
- data/lib/fog/openstack/requests/identity_v3/list_os_credentials.rb +24 -0
- data/lib/fog/openstack/requests/identity_v3/list_policies.rb +24 -0
- data/lib/fog/openstack/requests/identity_v3/list_project_group_roles.rb +23 -0
- data/lib/fog/openstack/requests/identity_v3/list_project_user_roles.rb +23 -0
- data/lib/fog/openstack/requests/identity_v3/list_projects.rb +31 -0
- data/lib/fog/openstack/requests/identity_v3/list_role_assignments.rb +39 -0
- data/lib/fog/openstack/requests/identity_v3/list_roles.rb +24 -0
- data/lib/fog/openstack/requests/identity_v3/list_services.rb +24 -0
- data/lib/fog/openstack/requests/identity_v3/list_user_groups.rb +23 -0
- data/lib/fog/openstack/requests/identity_v3/list_user_projects.rb +23 -0
- data/lib/fog/openstack/requests/identity_v3/list_users.rb +24 -0
- data/lib/fog/openstack/requests/identity_v3/remove_user_from_group.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/revoke_domain_group_role.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/revoke_domain_user_role.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/revoke_project_group_role.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/revoke_project_user_role.rb +20 -0
- data/lib/fog/openstack/requests/identity_v3/token_authenticate.rb +21 -0
- data/lib/fog/openstack/requests/identity_v3/token_check.rb +21 -0
- data/lib/fog/openstack/requests/identity_v3/token_revoke.rb +21 -0
- data/lib/fog/openstack/requests/identity_v3/token_validate.rb +22 -0
- data/lib/fog/openstack/requests/identity_v3/update_domain.rb +21 -0
- data/lib/fog/openstack/requests/identity_v3/update_endpoint.rb +21 -0
- data/lib/fog/openstack/requests/identity_v3/update_group.rb +21 -0
- data/lib/fog/openstack/requests/identity_v3/update_os_credential.rb +21 -0
- data/lib/fog/openstack/requests/identity_v3/update_policy.rb +21 -0
- data/lib/fog/openstack/requests/identity_v3/update_project.rb +21 -0
- data/lib/fog/openstack/requests/identity_v3/update_role.rb +21 -0
- data/lib/fog/openstack/requests/identity_v3/update_service.rb +21 -0
- data/lib/fog/openstack/requests/identity_v3/update_user.rb +21 -0
- data/lib/fog/openstack/requests/image_v1/add_member_to_image.rb +25 -0
- data/lib/fog/openstack/requests/image_v1/create_image.rb +78 -0
- data/lib/fog/openstack/requests/image_v1/delete_image.rb +25 -0
- data/lib/fog/openstack/requests/image_v1/get_image.rb +47 -0
- data/lib/fog/openstack/requests/image_v1/get_image_by_id.rb +34 -0
- data/lib/fog/openstack/requests/image_v1/get_image_members.rb +31 -0
- data/lib/fog/openstack/requests/image_v1/get_shared_images.rb +31 -0
- data/lib/fog/openstack/requests/image_v1/list_public_images.rb +35 -0
- data/lib/fog/openstack/requests/image_v1/list_public_images_detailed.rb +37 -0
- data/lib/fog/openstack/requests/image_v1/remove_member_from_image.rb +25 -0
- data/lib/fog/openstack/requests/image_v1/set_tenant.rb +21 -0
- data/lib/fog/openstack/requests/image_v1/update_image.rb +66 -0
- data/lib/fog/openstack/requests/image_v1/update_image_members.rb +39 -0
- data/lib/fog/openstack/requests/image_v2/add_member_to_image.rb +26 -0
- data/lib/fog/openstack/requests/image_v2/add_tag_to_image.rb +25 -0
- data/lib/fog/openstack/requests/image_v2/create_image.rb +54 -0
- data/lib/fog/openstack/requests/image_v2/deactivate_image.rb +25 -0
- data/lib/fog/openstack/requests/image_v2/delete_image.rb +25 -0
- data/lib/fog/openstack/requests/image_v2/download_image.rb +29 -0
- data/lib/fog/openstack/requests/image_v2/get_image.rb +47 -0
- data/lib/fog/openstack/requests/image_v2/get_image_by_id.rb +34 -0
- data/lib/fog/openstack/requests/image_v2/get_image_members.rb +31 -0
- data/lib/fog/openstack/requests/image_v2/get_member_details.rb +33 -0
- data/lib/fog/openstack/requests/image_v2/get_shared_images.rb +31 -0
- data/lib/fog/openstack/requests/image_v2/list_images.rb +35 -0
- data/lib/fog/openstack/requests/image_v2/reactivate_image.rb +25 -0
- data/lib/fog/openstack/requests/image_v2/remove_member_from_image.rb +25 -0
- data/lib/fog/openstack/requests/image_v2/remove_tag_from_image.rb +25 -0
- data/lib/fog/openstack/requests/image_v2/set_tenant.rb +21 -0
- data/lib/fog/openstack/requests/image_v2/update_image.rb +49 -0
- data/lib/fog/openstack/requests/image_v2/update_image_member.rb +34 -0
- data/lib/fog/openstack/requests/image_v2/upload_image.rb +30 -0
- data/lib/fog/openstack/requests/metering/get_resource.rb +28 -0
- data/lib/fog/openstack/requests/metering/get_samples.rb +50 -0
- data/lib/fog/openstack/requests/metering/get_statistics.rb +51 -0
- data/lib/fog/openstack/requests/metering/list_meters.rb +45 -0
- data/lib/fog/openstack/requests/metering/list_resources.rb +28 -0
- data/lib/fog/openstack/requests/network/add_router_interface.rb +54 -0
- data/lib/fog/openstack/requests/network/associate_floating_ip.rb +47 -0
- data/lib/fog/openstack/requests/network/associate_lb_health_monitor.rb +37 -0
- data/lib/fog/openstack/requests/network/create_floating_ip.rb +45 -0
- data/lib/fog/openstack/requests/network/create_lb_health_monitor.rb +54 -0
- data/lib/fog/openstack/requests/network/create_lb_member.rb +51 -0
- data/lib/fog/openstack/requests/network/create_lb_pool.rb +58 -0
- data/lib/fog/openstack/requests/network/create_lb_vip.rb +58 -0
- data/lib/fog/openstack/requests/network/create_network.rb +97 -0
- data/lib/fog/openstack/requests/network/create_port.rb +53 -0
- data/lib/fog/openstack/requests/network/create_router.rb +76 -0
- data/lib/fog/openstack/requests/network/create_security_group.rb +94 -0
- data/lib/fog/openstack/requests/network/create_security_group_rule.rb +79 -0
- data/lib/fog/openstack/requests/network/create_subnet.rb +54 -0
- data/lib/fog/openstack/requests/network/delete_floating_ip.rb +28 -0
- data/lib/fog/openstack/requests/network/delete_lb_health_monitor.rb +28 -0
- data/lib/fog/openstack/requests/network/delete_lb_member.rb +28 -0
- data/lib/fog/openstack/requests/network/delete_lb_pool.rb +28 -0
- data/lib/fog/openstack/requests/network/delete_lb_vip.rb +28 -0
- data/lib/fog/openstack/requests/network/delete_network.rb +28 -0
- data/lib/fog/openstack/requests/network/delete_port.rb +28 -0
- data/lib/fog/openstack/requests/network/delete_quota.rb +23 -0
- data/lib/fog/openstack/requests/network/delete_router.rb +28 -0
- data/lib/fog/openstack/requests/network/delete_security_group.rb +32 -0
- data/lib/fog/openstack/requests/network/delete_security_group_rule.rb +32 -0
- data/lib/fog/openstack/requests/network/delete_subnet.rb +28 -0
- data/lib/fog/openstack/requests/network/disassociate_floating_ip.rb +47 -0
- data/lib/fog/openstack/requests/network/disassociate_lb_health_monitor.rb +29 -0
- data/lib/fog/openstack/requests/network/get_floating_ip.rb +39 -0
- data/lib/fog/openstack/requests/network/get_lb_health_monitor.rb +28 -0
- data/lib/fog/openstack/requests/network/get_lb_member.rb +28 -0
- data/lib/fog/openstack/requests/network/get_lb_pool.rb +28 -0
- data/lib/fog/openstack/requests/network/get_lb_pool_stats.rb +33 -0
- data/lib/fog/openstack/requests/network/get_lb_vip.rb +28 -0
- data/lib/fog/openstack/requests/network/get_network.rb +40 -0
- data/lib/fog/openstack/requests/network/get_port.rb +51 -0
- data/lib/fog/openstack/requests/network/get_quota.rb +26 -0
- data/lib/fog/openstack/requests/network/get_quotas.rb +26 -0
- data/lib/fog/openstack/requests/network/get_router.rb +30 -0
- data/lib/fog/openstack/requests/network/get_security_group.rb +52 -0
- data/lib/fog/openstack/requests/network/get_security_group_rule.rb +47 -0
- data/lib/fog/openstack/requests/network/get_subnet.rb +47 -0
- data/lib/fog/openstack/requests/network/list_floating_ips.rb +25 -0
- data/lib/fog/openstack/requests/network/list_lb_health_monitors.rb +25 -0
- data/lib/fog/openstack/requests/network/list_lb_members.rb +25 -0
- data/lib/fog/openstack/requests/network/list_lb_pools.rb +25 -0
- data/lib/fog/openstack/requests/network/list_lb_vips.rb +25 -0
- data/lib/fog/openstack/requests/network/list_networks.rb +25 -0
- data/lib/fog/openstack/requests/network/list_ports.rb +25 -0
- data/lib/fog/openstack/requests/network/list_routers.rb +25 -0
- data/lib/fog/openstack/requests/network/list_security_group_rules.rb +48 -0
- data/lib/fog/openstack/requests/network/list_security_groups.rb +53 -0
- data/lib/fog/openstack/requests/network/list_subnets.rb +25 -0
- data/lib/fog/openstack/requests/network/remove_router_interface.rb +34 -0
- data/lib/fog/openstack/requests/network/set_tenant.rb +20 -0
- data/lib/fog/openstack/requests/network/update_lb_health_monitor.rb +43 -0
- data/lib/fog/openstack/requests/network/update_lb_member.rb +39 -0
- data/lib/fog/openstack/requests/network/update_lb_pool.rb +40 -0
- data/lib/fog/openstack/requests/network/update_lb_vip.rb +42 -0
- data/lib/fog/openstack/requests/network/update_network.rb +39 -0
- data/lib/fog/openstack/requests/network/update_port.rb +43 -0
- data/lib/fog/openstack/requests/network/update_quota.rb +27 -0
- data/lib/fog/openstack/requests/network/update_router.rb +69 -0
- data/lib/fog/openstack/requests/network/update_subnet.rb +43 -0
- data/lib/fog/openstack/requests/orchestration/abandon_stack.rb +15 -0
- data/lib/fog/openstack/requests/orchestration/build_info.rb +15 -0
- data/lib/fog/openstack/requests/orchestration/create_stack.rb +75 -0
- data/lib/fog/openstack/requests/orchestration/delete_stack.rb +58 -0
- data/lib/fog/openstack/requests/orchestration/get_stack_template.rb +20 -0
- data/lib/fog/openstack/requests/orchestration/list_events.rb +46 -0
- data/lib/fog/openstack/requests/orchestration/list_resource_events.rb +28 -0
- data/lib/fog/openstack/requests/orchestration/list_resource_types.rb +27 -0
- data/lib/fog/openstack/requests/orchestration/list_resources.rb +46 -0
- data/lib/fog/openstack/requests/orchestration/list_stack_data.rb +27 -0
- data/lib/fog/openstack/requests/orchestration/list_stack_data_detailed.rb +49 -0
- data/lib/fog/openstack/requests/orchestration/list_stack_events.rb +27 -0
- data/lib/fog/openstack/requests/orchestration/patch_stack.rb +37 -0
- data/lib/fog/openstack/requests/orchestration/preview_stack.rb +16 -0
- data/lib/fog/openstack/requests/orchestration/show_event_details.rb +26 -0
- data/lib/fog/openstack/requests/orchestration/show_resource_data.rb +26 -0
- data/lib/fog/openstack/requests/orchestration/show_resource_metadata.rb +26 -0
- data/lib/fog/openstack/requests/orchestration/show_resource_schema.rb +15 -0
- data/lib/fog/openstack/requests/orchestration/show_resource_template.rb +20 -0
- data/lib/fog/openstack/requests/orchestration/show_stack_details.rb +26 -0
- data/lib/fog/openstack/requests/orchestration/update_stack.rb +66 -0
- data/lib/fog/openstack/requests/orchestration/validate_template.rb +16 -0
- data/lib/fog/openstack/requests/planning/add_role_to_plan.rb +40 -0
- data/lib/fog/openstack/requests/planning/create_plan.rb +33 -0
- data/lib/fog/openstack/requests/planning/delete_plan.rb +23 -0
- data/lib/fog/openstack/requests/planning/get_plan.rb +58 -0
- data/lib/fog/openstack/requests/planning/get_plan_templates.rb +28 -0
- data/lib/fog/openstack/requests/planning/list_plans.rb +61 -0
- data/lib/fog/openstack/requests/planning/list_roles.rb +32 -0
- data/lib/fog/openstack/requests/planning/patch_plan.rb +51 -0
- data/lib/fog/openstack/requests/planning/remove_role_from_plan.rb +32 -0
- data/lib/fog/openstack/requests/storage/copy_object.rb +25 -0
- data/lib/fog/openstack/requests/storage/delete_container.rb +20 -0
- data/lib/fog/openstack/requests/storage/delete_multiple_objects.rb +65 -0
- data/lib/fog/openstack/requests/storage/delete_object.rb +21 -0
- data/lib/fog/openstack/requests/storage/delete_static_large_object.rb +41 -0
- data/lib/fog/openstack/requests/storage/get_container.rb +42 -0
- data/lib/fog/openstack/requests/storage/get_containers.rb +31 -0
- data/lib/fog/openstack/requests/storage/get_object.rb +27 -0
- data/lib/fog/openstack/requests/storage/get_object_http_url.rb +21 -0
- data/lib/fog/openstack/requests/storage/get_object_https_url.rb +81 -0
- data/lib/fog/openstack/requests/storage/head_container.rb +26 -0
- data/lib/fog/openstack/requests/storage/head_containers.rb +23 -0
- data/lib/fog/openstack/requests/storage/head_object.rb +21 -0
- data/lib/fog/openstack/requests/storage/post_set_meta_temp_url_key.rb +33 -0
- data/lib/fog/openstack/requests/storage/public_url.rb +28 -0
- data/lib/fog/openstack/requests/storage/put_container.rb +24 -0
- data/lib/fog/openstack/requests/storage/put_dynamic_obj_manifest.rb +41 -0
- data/lib/fog/openstack/requests/storage/put_object.rb +41 -0
- data/lib/fog/openstack/requests/storage/put_object_manifest.rb +14 -0
- data/lib/fog/openstack/requests/storage/put_static_obj_manifest.rb +55 -0
- data/lib/fog/openstack/requests/volume/accept_transfer.rb +22 -0
- data/lib/fog/openstack/requests/volume/create_transfer.rb +25 -0
- data/lib/fog/openstack/requests/volume/create_volume.rb +22 -0
- data/lib/fog/openstack/requests/volume/create_volume_snapshot.rb +26 -0
- data/lib/fog/openstack/requests/volume/create_volume_type.rb +41 -0
- data/lib/fog/openstack/requests/volume/delete_snapshot.rb +23 -0
- data/lib/fog/openstack/requests/volume/delete_transfer.rb +15 -0
- data/lib/fog/openstack/requests/volume/delete_volume.rb +23 -0
- data/lib/fog/openstack/requests/volume/delete_volume_type.rb +23 -0
- data/lib/fog/openstack/requests/volume/extend_volume.rb +25 -0
- data/lib/fog/openstack/requests/volume/get_quota.rb +26 -0
- data/lib/fog/openstack/requests/volume/get_quota_defaults.rb +26 -0
- data/lib/fog/openstack/requests/volume/get_quota_usage.rb +44 -0
- data/lib/fog/openstack/requests/volume/get_snapshot_details.rb +15 -0
- data/lib/fog/openstack/requests/volume/get_transfer_details.rb +17 -0
- data/lib/fog/openstack/requests/volume/get_volume_details.rb +16 -0
- data/lib/fog/openstack/requests/volume/get_volume_type_details.rb +32 -0
- data/lib/fog/openstack/requests/volume/list_snapshots.rb +41 -0
- data/lib/fog/openstack/requests/volume/list_snapshots_detailed.rb +27 -0
- data/lib/fog/openstack/requests/volume/list_transfers.rb +18 -0
- data/lib/fog/openstack/requests/volume/list_transfers_detailed.rb +18 -0
- data/lib/fog/openstack/requests/volume/list_volume_types.rb +41 -0
- data/lib/fog/openstack/requests/volume/list_volumes.rb +30 -0
- data/lib/fog/openstack/requests/volume/list_volumes_detailed.rb +16 -0
- data/lib/fog/openstack/requests/volume/list_zones.rb +32 -0
- data/lib/fog/openstack/requests/volume/set_tenant.rb +19 -0
- data/lib/fog/openstack/requests/volume/update_quota.rb +28 -0
- data/lib/fog/openstack/requests/volume/update_volume_type.rb +41 -0
- data/lib/fog/openstack/requests/volume_v1/accept_transfer.rb +2 -0
- data/lib/fog/openstack/requests/volume_v1/create_transfer.rb +2 -0
- data/lib/fog/openstack/requests/volume_v1/create_volume.rb +49 -0
- data/lib/fog/openstack/requests/volume_v1/create_volume_snapshot.rb +44 -0
- data/lib/fog/openstack/requests/volume_v1/create_volume_type.rb +2 -0
- data/lib/fog/openstack/requests/volume_v1/delete_snapshot.rb +2 -0
- data/lib/fog/openstack/requests/volume_v1/delete_transfer.rb +2 -0
- data/lib/fog/openstack/requests/volume_v1/delete_volume.rb +2 -0
- data/lib/fog/openstack/requests/volume_v1/delete_volume_type.rb +2 -0
- data/lib/fog/openstack/requests/volume_v1/extend_volume.rb +2 -0
- data/lib/fog/openstack/requests/volume_v1/get_quota.rb +2 -0
- data/lib/fog/openstack/requests/volume_v1/get_quota_defaults.rb +2 -0
- data/lib/fog/openstack/requests/volume_v1/get_quota_usage.rb +2 -0
- data/lib/fog/openstack/requests/volume_v1/get_snapshot_details.rb +32 -0
- data/lib/fog/openstack/requests/volume_v1/get_transfer_details.rb +2 -0
- data/lib/fog/openstack/requests/volume_v1/get_volume_details.rb +35 -0
- data/lib/fog/openstack/requests/volume_v1/get_volume_type_details.rb +2 -0
- data/lib/fog/openstack/requests/volume_v1/list_snapshots.rb +2 -0
- data/lib/fog/openstack/requests/volume_v1/list_snapshots_detailed.rb +2 -0
- data/lib/fog/openstack/requests/volume_v1/list_transfers.rb +2 -0
- data/lib/fog/openstack/requests/volume_v1/list_transfers_detailed.rb +2 -0
- data/lib/fog/openstack/requests/volume_v1/list_volume_types.rb +2 -0
- data/lib/fog/openstack/requests/volume_v1/list_volumes.rb +46 -0
- data/lib/fog/openstack/requests/volume_v1/list_volumes_detailed.rb +46 -0
- data/lib/fog/openstack/requests/volume_v1/list_zones.rb +2 -0
- data/lib/fog/openstack/requests/volume_v1/real.rb +11 -0
- data/lib/fog/openstack/requests/volume_v1/real_mock.rb +14 -0
- data/lib/fog/openstack/requests/volume_v1/set_tenant.rb +2 -0
- data/lib/fog/openstack/requests/volume_v1/update_quota.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/accept_transfer.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/create_transfer.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/create_volume.rb +49 -0
- data/lib/fog/openstack/requests/volume_v2/create_volume_snapshot.rb +43 -0
- data/lib/fog/openstack/requests/volume_v2/create_volume_type.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/delete_snapshot.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/delete_transfer.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/delete_volume.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/delete_volume_type.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/extend_volume.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/get_quota.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/get_quota_defaults.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/get_quota_usage.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/get_snapshot_details.rb +32 -0
- data/lib/fog/openstack/requests/volume_v2/get_transfer_details.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/get_volume_details.rb +35 -0
- data/lib/fog/openstack/requests/volume_v2/get_volume_type_details.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/list_snapshots.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/list_snapshots_detailed.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/list_transfers.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/list_transfers_detailed.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/list_volume_types.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/list_volumes.rb +46 -0
- data/lib/fog/openstack/requests/volume_v2/list_volumes_detailed.rb +46 -0
- data/lib/fog/openstack/requests/volume_v2/list_zones.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/real.rb +11 -0
- data/lib/fog/openstack/requests/volume_v2/real_mock.rb +14 -0
- data/lib/fog/openstack/requests/volume_v2/set_tenant.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/update_quota.rb +2 -0
- data/lib/fog/openstack/requests/volume_v2/update_volume_type.rb +2 -0
- data/lib/fog/openstack/storage.rb +181 -0
- data/lib/fog/openstack/version.rb +5 -0
- data/lib/fog/openstack/volume.rb +31 -0
- data/lib/fog/openstack/volume_v1.rb +163 -0
- data/lib/fog/openstack/volume_v2.rb +164 -0
- data/tests/helper.rb +21 -0
- data/tests/helpers/collection_helper.rb +97 -0
- data/tests/helpers/compute/flavors_helper.rb +32 -0
- data/tests/helpers/compute/server_helper.rb +25 -0
- data/tests/helpers/compute/servers_helper.rb +10 -0
- data/tests/helpers/formats_helper.rb +98 -0
- data/tests/helpers/formats_helper_tests.rb +110 -0
- data/tests/helpers/mock_helper.rb +17 -0
- data/tests/helpers/model_helper.rb +31 -0
- data/tests/helpers/responds_to_helper.rb +11 -0
- data/tests/helpers/schema_validator_tests.rb +107 -0
- data/tests/helpers/succeeds_helper.rb +9 -0
- data/tests/openstack/authenticate_tests.rb +200 -0
- data/tests/openstack/models/compute/images_tests.rb +13 -0
- data/tests/openstack/models/compute/security_group_tests.rb +54 -0
- data/tests/openstack/models/compute/server_tests.rb +220 -0
- data/tests/openstack/models/identity/ec2_credential_tests.rb +41 -0
- data/tests/openstack/models/identity/ec2_credentials_tests.rb +58 -0
- data/tests/openstack/models/identity/role_tests.rb +26 -0
- data/tests/openstack/models/identity/roles_tests.rb +20 -0
- data/tests/openstack/models/identity/tenant_tests.rb +30 -0
- data/tests/openstack/models/identity/tenants_tests.rb +26 -0
- data/tests/openstack/models/identity/user_tests.rb +46 -0
- data/tests/openstack/models/identity/users_tests.rb +42 -0
- data/tests/openstack/models/image/image_tests.rb +36 -0
- data/tests/openstack/models/image/images_tests.rb +19 -0
- data/tests/openstack/models/network/floating_ip_tests.rb +22 -0
- data/tests/openstack/models/network/floating_ips_tests.rb +19 -0
- data/tests/openstack/models/network/lb_health_monitor_tests.rb +52 -0
- data/tests/openstack/models/network/lb_health_monitors_tests.rb +21 -0
- data/tests/openstack/models/network/lb_member_tests.rb +28 -0
- data/tests/openstack/models/network/lb_members_tests.rb +21 -0
- data/tests/openstack/models/network/lb_pool_tests.rb +53 -0
- data/tests/openstack/models/network/lb_pools_tests.rb +20 -0
- data/tests/openstack/models/network/lb_vip_tests.rb +39 -0
- data/tests/openstack/models/network/lb_vips_tests.rb +21 -0
- data/tests/openstack/models/network/network_tests.rb +61 -0
- data/tests/openstack/models/network/networks_tests.rb +21 -0
- data/tests/openstack/models/network/port_tests.rb +28 -0
- data/tests/openstack/models/network/ports_tests.rb +25 -0
- data/tests/openstack/models/network/router_tests.rb +39 -0
- data/tests/openstack/models/network/routers_tests.rb +21 -0
- data/tests/openstack/models/network/security_group_rule_tests.rb +27 -0
- data/tests/openstack/models/network/security_group_rules_tests.rb +25 -0
- data/tests/openstack/models/network/security_group_tests.rb +17 -0
- data/tests/openstack/models/network/security_groups_tests.rb +16 -0
- data/tests/openstack/models/network/subnet_tests.rb +30 -0
- data/tests/openstack/models/network/subnets_tests.rb +27 -0
- data/tests/openstack/models/planning/.gitkeep +0 -0
- data/tests/openstack/models/planning/plan_tests.rb +51 -0
- data/tests/openstack/models/planning/plans_tests.rb +18 -0
- data/tests/openstack/models/planning/role_tests.rb +14 -0
- data/tests/openstack/models/storage/file_tests.rb +251 -0
- data/tests/openstack/requests/baremetal/chassis_tests.rb +48 -0
- data/tests/openstack/requests/baremetal/driver_tests.rb +40 -0
- data/tests/openstack/requests/baremetal/node_tests.rb +83 -0
- data/tests/openstack/requests/baremetal/port_tests.rb +56 -0
- data/tests/openstack/requests/compute/address_tests.rb +58 -0
- data/tests/openstack/requests/compute/aggregate_tests.rb +59 -0
- data/tests/openstack/requests/compute/availability_zone_tests.rb +18 -0
- data/tests/openstack/requests/compute/flavor_tests.rb +95 -0
- data/tests/openstack/requests/compute/helper.rb +41 -0
- data/tests/openstack/requests/compute/image_tests.rb +58 -0
- data/tests/openstack/requests/compute/keypair_tests.rb +30 -0
- data/tests/openstack/requests/compute/limit_tests.rb +59 -0
- data/tests/openstack/requests/compute/quota_tests.rb +60 -0
- data/tests/openstack/requests/compute/security_group_tests.rb +61 -0
- data/tests/openstack/requests/compute/server_tests.rb +289 -0
- data/tests/openstack/requests/compute/service_tests.rb +33 -0
- data/tests/openstack/requests/compute/tenant_tests.rb +19 -0
- data/tests/openstack/requests/compute/volume_tests.rb +38 -0
- data/tests/openstack/requests/identity/ec2_credentials_tests.rb +44 -0
- data/tests/openstack/requests/identity/helper.rb +13 -0
- data/tests/openstack/requests/identity/role_tests.rb +45 -0
- data/tests/openstack/requests/identity/tenant_tests.rb +56 -0
- data/tests/openstack/requests/identity/user_tests.rb +41 -0
- data/tests/openstack/requests/image/image_tests.rb +134 -0
- data/tests/openstack/requests/metering/meter_tests.rb +52 -0
- data/tests/openstack/requests/metering/resource_tests.rb +19 -0
- data/tests/openstack/requests/network/lb_health_monitor_tests.rb +93 -0
- data/tests/openstack/requests/network/lb_member_tests.rb +60 -0
- data/tests/openstack/requests/network/lb_pool_tests.rb +80 -0
- data/tests/openstack/requests/network/lb_vip_tests.rb +71 -0
- data/tests/openstack/requests/network/network_tests.rb +107 -0
- data/tests/openstack/requests/network/port_tests.rb +66 -0
- data/tests/openstack/requests/network/quota_tests.rb +65 -0
- data/tests/openstack/requests/network/router_tests.rb +73 -0
- data/tests/openstack/requests/network/security_group_rule_tests.rb +58 -0
- data/tests/openstack/requests/network/security_group_tests.rb +43 -0
- data/tests/openstack/requests/network/subnet_tests.rb +66 -0
- data/tests/openstack/requests/orchestration/stack_tests.rb +64 -0
- data/tests/openstack/requests/planning/.gitkeep +0 -0
- data/tests/openstack/requests/planning/plan_tests.rb +65 -0
- data/tests/openstack/requests/planning/role_tests.rb +16 -0
- data/tests/openstack/requests/storage/container_tests.rb +64 -0
- data/tests/openstack/requests/storage/large_object_tests.rb +372 -0
- data/tests/openstack/requests/storage/object_tests.rb +208 -0
- data/tests/openstack/requests/volume/availability_zone_tests.rb +13 -0
- data/tests/openstack/requests/volume/quota_tests.rb +50 -0
- data/tests/openstack/requests/volume/volume_type_tests.rb +32 -0
- data/tests/openstack/storage_tests.rb +18 -0
- data/tests/openstack/version_tests.rb +55 -0
- data/tests/openstack/volume_tests.rb +18 -0
- metadata +967 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8a6165984c1f19c2ae03e5673d3d223e1a5b196b
|
4
|
+
data.tar.gz: 95d5177e637bce30149f49cb0c5324c77ab3243b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9151bde397b04c12c2fe65ef5c996d44addfd11b46655ec28313855aebc60c308a33428f4a5a0f64ca96f3ad2193e629a3af801831ff1651e242a10b4ec7ed07
|
7
|
+
data.tar.gz: 2564f645ef566d60c1940c854e7bb836babb895666c67c286a3d49d8ef282d4f04179aec19627f5df002b29395a44314739d2141957d760ea70e88a9807307a9
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
fog-openstack
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.1.2
|
data/.travis.yml
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
language: ruby
|
2
|
+
sudo: false
|
3
|
+
script: bundle exec rake test
|
4
|
+
matrix:
|
5
|
+
fast_finish: true
|
6
|
+
include:
|
7
|
+
- rvm: 1.8.7
|
8
|
+
gemfile: gemfiles/Gemfile-ruby-1.8.7
|
9
|
+
- rvm: 1.9.3
|
10
|
+
gemfile: Gemfile
|
11
|
+
- rvm: 2.0.0
|
12
|
+
gemfile: Gemfile
|
13
|
+
- rvm: 2.1.0
|
14
|
+
gemfile: Gemfile
|
15
|
+
- rvm: 2.1.1
|
16
|
+
gemfile: Gemfile
|
17
|
+
- rvm: 2.1.1
|
18
|
+
gemfile: gemfiles/Gemfile-edge
|
19
|
+
- rvm: 2.2.0
|
20
|
+
gemfile: Gemfile
|
21
|
+
- rvm: 2.2.0
|
22
|
+
gemfile: gemfiles/Gemfile-edge
|
23
|
+
- rvm: jruby-18mode
|
24
|
+
gemfile: gemfiles/Gemfile-ruby-1.8.7
|
25
|
+
- rvm: jruby-19mode
|
26
|
+
gemfile: Gemfile
|
27
|
+
- rvm: jruby-head
|
28
|
+
gemfile: Gemfile
|
29
|
+
allow_failures:
|
30
|
+
- rvm: jruby-head
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at matt.darby@rackspace.com. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
## Getting Involved
|
2
|
+
|
3
|
+
New contributors are always welcome, when it doubt please ask questions. We strive to be an open and welcoming community. Please be nice to one another.
|
4
|
+
|
5
|
+
### Coding
|
6
|
+
|
7
|
+
* Pick a task:
|
8
|
+
* Offer feedback on open [pull requests](https://github.com/fog/fog-openstack/pulls).
|
9
|
+
* Review open [issues](https://github.com/fog/fog-openstack/issues) for things to help on.
|
10
|
+
* [Create an issue](https://github.com/fog/fog-openstack/issues/new) to start a discussion on additions or features.
|
11
|
+
* Fork the project, add your changes and tests to cover them in a topic branch.
|
12
|
+
* Commit your changes and rebase against `fog/fog-openstack` to ensure everything is up to date.
|
13
|
+
* [Submit a pull request](https://github.com/fog/fog-openstack/compare/).
|
14
|
+
|
15
|
+
### Non-Coding
|
16
|
+
|
17
|
+
* Offer feedback on open [issues](https://github.com/fog/fog-openstack/issues).
|
18
|
+
* Organize or volunteer at events.
|
data/Gemfile
ADDED
data/LICENSE.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014-2015 [CONTRIBUTORS.md](https://github.com/fog/fog-rackspace/blob/master/CONTRIBUTORS.md)
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# Fog::Openstack
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/fog/openstack`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'fog-openstack'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install fog-openstack
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/fog-openstack. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
|
+
|
37
|
+
|
38
|
+
## License
|
39
|
+
|
40
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "fog/openstack"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'fog/openstack/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "fog-openstack"
|
8
|
+
spec.version = Fog::Openstack::VERSION
|
9
|
+
spec.authors = ["Matt Darby"]
|
10
|
+
spec.email = ["matt.darby@rackspace.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{OpenStack fog provider gem}
|
13
|
+
spec.description = %q{OpenStack fog provider gem.}
|
14
|
+
spec.homepage = "https://github.com/fog/fog-openstack"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "exe"
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_development_dependency 'bundler', '~> 1.6'
|
23
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
24
|
+
spec.add_development_dependency 'shindo', '~> 0.3'
|
25
|
+
spec.add_development_dependency 'rubyzip', '~> 0.9.9'
|
26
|
+
spec.add_development_dependency "mime-types"
|
27
|
+
spec.add_development_dependency "mime-types-data"
|
28
|
+
|
29
|
+
spec.add_dependency 'fog-core', '>= 1.35'
|
30
|
+
spec.add_dependency 'fog-json', '>= 1.0'
|
31
|
+
spec.add_dependency 'fog-xml', '>= 0.1'
|
32
|
+
spec.add_dependency 'ipaddress', '>= 0.8'
|
33
|
+
end
|
@@ -0,0 +1,508 @@
|
|
1
|
+
require 'fog/openstack/version'
|
2
|
+
require 'fog/core'
|
3
|
+
require 'fog/json'
|
4
|
+
|
5
|
+
require 'fog/openstack/core'
|
6
|
+
require 'fog/openstack/common'
|
7
|
+
require 'fog/openstack/errors'
|
8
|
+
|
9
|
+
module Fog
|
10
|
+
module OpenStack
|
11
|
+
extend Fog::Provider
|
12
|
+
|
13
|
+
# `require` is necessary until they can be refactored into autoload
|
14
|
+
require 'fog/openstack/image_v1'
|
15
|
+
require 'fog/openstack/storage'
|
16
|
+
require 'fog/openstack/volume_v1'
|
17
|
+
require 'fog/openstack/volume_v2'
|
18
|
+
require 'fog/openstack/planning'
|
19
|
+
|
20
|
+
autoload :Compute, File.expand_path('../openstack/compute', __FILE__)
|
21
|
+
autoload :IdentityV2, File.expand_path('../openstack/identity_v2', __FILE__)
|
22
|
+
autoload :IdentityV3, File.expand_path('../openstack/identity_v3', __FILE__)
|
23
|
+
autoload :Image, File.expand_path('../openstack/image', __FILE__)
|
24
|
+
autoload :ImageV2, File.expand_path('../openstack/image_v2', __FILE__)
|
25
|
+
autoload :Metering, File.expand_path('../openstack/metering', __FILE__)
|
26
|
+
autoload :Network, File.expand_path('../openstack/network', __FILE__)
|
27
|
+
autoload :Orchestration, File.expand_path('../openstack/orchestration', __FILE__)
|
28
|
+
autoload :Volume, File.expand_path('../openstack/volume', __FILE__)
|
29
|
+
autoload :Baremetal, File.expand_path('../openstack/baremetal', __FILE__)
|
30
|
+
|
31
|
+
service(:compute , 'Compute')
|
32
|
+
service(:image, 'Image')
|
33
|
+
service(:identity, 'Identity')
|
34
|
+
service(:network, 'Network')
|
35
|
+
service(:storage, 'Storage')
|
36
|
+
service(:volume, 'Volume')
|
37
|
+
service(:metering, 'Metering')
|
38
|
+
service(:orchestration, 'Orchestration')
|
39
|
+
service(:baremetal, 'Baremetal')
|
40
|
+
service(:planning, 'Planning')
|
41
|
+
|
42
|
+
@@token_cache = {}
|
43
|
+
|
44
|
+
def self.clear_token_cache
|
45
|
+
@@token_cache.clear
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.authenticate(options, connection_options = {})
|
49
|
+
case options[:openstack_auth_uri].path
|
50
|
+
when /v1(\.\d+)?/
|
51
|
+
authenticate_v1(options, connection_options)
|
52
|
+
when /v2(\.\d+)?/
|
53
|
+
authenticate_v2(options, connection_options)
|
54
|
+
when /v3(\.\d+)?/
|
55
|
+
authenticate_v3(options, connection_options)
|
56
|
+
else
|
57
|
+
authenticate_v2(options, connection_options)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# legacy v1.0 style auth
|
62
|
+
def self.authenticate_v1(options, connection_options = {})
|
63
|
+
uri = options[:openstack_auth_uri]
|
64
|
+
connection = Fog::Core::Connection.new(uri.to_s, false, connection_options)
|
65
|
+
@openstack_api_key = options[:openstack_api_key]
|
66
|
+
@openstack_username = options[:openstack_username]
|
67
|
+
|
68
|
+
response = connection.request({
|
69
|
+
:expects => [200, 204],
|
70
|
+
:headers => {
|
71
|
+
'X-Auth-Key' => @openstack_api_key,
|
72
|
+
'X-Auth-User' => @openstack_username
|
73
|
+
},
|
74
|
+
:method => 'GET',
|
75
|
+
:path => (uri.path and not uri.path.empty?) ? uri.path : 'v1.0'
|
76
|
+
})
|
77
|
+
|
78
|
+
return {
|
79
|
+
:token => response.headers['X-Auth-Token'],
|
80
|
+
:server_management_url => response.headers['X-Server-Management-Url'] || response.headers['X-Storage-Url'],
|
81
|
+
:identity_public_endpoint => response.headers['X-Keystone']
|
82
|
+
}
|
83
|
+
end
|
84
|
+
|
85
|
+
# Keystone Style Auth
|
86
|
+
def self.authenticate_v2(options, connection_options = {})
|
87
|
+
uri = options[:openstack_auth_uri]
|
88
|
+
tenant_name = options[:openstack_tenant]
|
89
|
+
service_type = options[:openstack_service_type]
|
90
|
+
service_name = options[:openstack_service_name]
|
91
|
+
identity_service_type = options[:openstack_identity_service_type]
|
92
|
+
endpoint_type = (options[:openstack_endpoint_type] || 'publicURL').to_s
|
93
|
+
openstack_region = options[:openstack_region]
|
94
|
+
|
95
|
+
body = retrieve_tokens_v2(options, connection_options)
|
96
|
+
service = get_service(body, service_type, service_name)
|
97
|
+
|
98
|
+
options[:unscoped_token] = body['access']['token']['id']
|
99
|
+
|
100
|
+
unless service
|
101
|
+
unless tenant_name
|
102
|
+
response = Fog::Core::Connection.new(
|
103
|
+
"#{uri.scheme}://#{uri.host}:#{uri.port}/v2.0/tenants", false, connection_options).request({
|
104
|
+
:expects => [200, 204],
|
105
|
+
:headers => {'Content-Type' => 'application/json',
|
106
|
+
'Accept' => 'application/json',
|
107
|
+
'X-Auth-Token' => body['access']['token']['id']},
|
108
|
+
:method => 'GET'
|
109
|
+
})
|
110
|
+
|
111
|
+
body = Fog::JSON.decode(response.body)
|
112
|
+
if body['tenants'].empty?
|
113
|
+
raise Fog::Errors::NotFound.new('No Tenant Found')
|
114
|
+
else
|
115
|
+
options[:openstack_tenant] = body['tenants'].first['name']
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
body = retrieve_tokens_v2(options, connection_options)
|
120
|
+
service = get_service(body, service_type, service_name)
|
121
|
+
|
122
|
+
end
|
123
|
+
|
124
|
+
service['endpoints'] = service['endpoints'].select do |endpoint|
|
125
|
+
endpoint['region'] == openstack_region
|
126
|
+
end if openstack_region
|
127
|
+
|
128
|
+
if service['endpoints'].empty?
|
129
|
+
raise Fog::Errors::NotFound.new("No endpoints available for region '#{openstack_region}'")
|
130
|
+
end if openstack_region
|
131
|
+
|
132
|
+
unless service
|
133
|
+
available = body['access']['serviceCatalog'].map { |endpoint|
|
134
|
+
endpoint['type']
|
135
|
+
}.sort.join ', '
|
136
|
+
|
137
|
+
missing = service_type.join ', '
|
138
|
+
|
139
|
+
message = "Could not find service #{missing}. Have #{available}"
|
140
|
+
|
141
|
+
raise Fog::Errors::NotFound, message
|
142
|
+
end
|
143
|
+
|
144
|
+
regions = service["endpoints"].map{ |e| e['region'] }.uniq
|
145
|
+
if regions.count > 1
|
146
|
+
raise Fog::Errors::NotFound.new("Multiple regions available choose one of these '#{regions.join(',')}'")
|
147
|
+
end
|
148
|
+
|
149
|
+
identity_service = get_service(body, identity_service_type) if identity_service_type
|
150
|
+
tenant = body['access']['token']['tenant']
|
151
|
+
user = body['access']['user']
|
152
|
+
|
153
|
+
management_url = service['endpoints'].find{|s| s[endpoint_type]}[endpoint_type]
|
154
|
+
identity_url = identity_service['endpoints'].find{|s| s['publicURL']}['publicURL'] if identity_service
|
155
|
+
|
156
|
+
{
|
157
|
+
:user => user,
|
158
|
+
:tenant => tenant,
|
159
|
+
:identity_public_endpoint => identity_url,
|
160
|
+
:server_management_url => management_url,
|
161
|
+
:token => body['access']['token']['id'],
|
162
|
+
:expires => body['access']['token']['expires'],
|
163
|
+
:current_user_id => body['access']['user']['id'],
|
164
|
+
:unscoped_token => options[:unscoped_token]
|
165
|
+
}
|
166
|
+
end
|
167
|
+
|
168
|
+
# Keystone Style Auth
|
169
|
+
def self.authenticate_v3(options, connection_options = {})
|
170
|
+
uri = options[:openstack_auth_uri]
|
171
|
+
project_name = options[:openstack_project_name]
|
172
|
+
service_type = options[:openstack_service_type]
|
173
|
+
service_name = options[:openstack_service_name]
|
174
|
+
identity_service_type = options[:openstack_identity_service_type]
|
175
|
+
endpoint_type = map_endpoint_type(options[:openstack_endpoint_type] || 'publicURL')
|
176
|
+
openstack_region = options[:openstack_region]
|
177
|
+
|
178
|
+
token, body = retrieve_tokens_v3 options, connection_options
|
179
|
+
|
180
|
+
service = get_service_v3(body, service_type, service_name, openstack_region, options)
|
181
|
+
|
182
|
+
options[:unscoped_token] = token
|
183
|
+
|
184
|
+
unless service
|
185
|
+
unless project_name
|
186
|
+
request_body = {
|
187
|
+
:expects => [200],
|
188
|
+
:headers => {'Content-Type' => 'application/json',
|
189
|
+
'Accept' => 'application/json',
|
190
|
+
'X-Auth-Token' => token},
|
191
|
+
:method => 'GET'
|
192
|
+
}
|
193
|
+
user_id = body['token']['user']['id']
|
194
|
+
response = Fog::Core::Connection.new(
|
195
|
+
"#{uri.scheme}://#{uri.host}:#{uri.port}/v3/users/#{user_id}/projects", false, connection_options).request(request_body)
|
196
|
+
|
197
|
+
projects_body = Fog::JSON.decode(response.body)
|
198
|
+
if projects_body['projects'].empty?
|
199
|
+
options[:openstack_domain_id] = body['token']['user']['domain']['id']
|
200
|
+
else
|
201
|
+
options[:openstack_project_name] = projects_body['projects'].first['name']
|
202
|
+
options[:openstack_domain_id] = projects_body['projects'].first['domain_id']
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
token, body = retrieve_tokens_v3(options, connection_options)
|
207
|
+
service = get_service_v3(body, service_type, service_name, openstack_region, options)
|
208
|
+
end
|
209
|
+
|
210
|
+
unless service
|
211
|
+
available_services = body['token']['catalog'].map { |service|
|
212
|
+
service['type']
|
213
|
+
}.sort.join ', '
|
214
|
+
|
215
|
+
available_regions = body['token']['catalog'].map { |service|
|
216
|
+
service['endpoints'].map { |endpoint|
|
217
|
+
endpoint['region']
|
218
|
+
}.uniq
|
219
|
+
}.uniq.sort.join ', '
|
220
|
+
|
221
|
+
missing = service_type.join ', '
|
222
|
+
|
223
|
+
message = "Could not find service #{missing}#{(' in region '+openstack_region) if openstack_region}."+
|
224
|
+
" Have #{available_services}#{(' in regions '+available_regions) if openstack_region}"
|
225
|
+
|
226
|
+
raise Fog::Errors::NotFound, message
|
227
|
+
end
|
228
|
+
|
229
|
+
service['endpoints'] = service['endpoints'].select do |endpoint|
|
230
|
+
endpoint['region'] == openstack_region && endpoint['interface'] == endpoint_type
|
231
|
+
end if openstack_region
|
232
|
+
|
233
|
+
if service['endpoints'].empty?
|
234
|
+
raise Fog::Errors::NotFound.new("No endpoints available for region '#{openstack_region}'")
|
235
|
+
end if openstack_region
|
236
|
+
|
237
|
+
regions = service["endpoints"].map { |e| e['region'] }.uniq
|
238
|
+
if regions.count > 1
|
239
|
+
raise Fog::Errors::NotFound.new("Multiple regions available choose one of these '#{regions.join(',')}'")
|
240
|
+
end
|
241
|
+
|
242
|
+
identity_service = get_service_v3(body, identity_service_type, nil, nil, :openstack_endpoint_path_matches => /\/v3/) if identity_service_type
|
243
|
+
|
244
|
+
management_url = service['endpoints'].find { |e| e['interface']==endpoint_type }['url']
|
245
|
+
identity_url = identity_service['endpoints'].find { |e| e['interface']=='public' }['url'] if identity_service
|
246
|
+
|
247
|
+
if body['token']['project']
|
248
|
+
tenant = body['token']['project']['name']
|
249
|
+
else
|
250
|
+
tenant = body['token']['user']['project']['name'] if body['token']['user']['project']
|
251
|
+
end
|
252
|
+
|
253
|
+
return {
|
254
|
+
:user => body['token']['user']['name'],
|
255
|
+
:tenant => tenant,
|
256
|
+
:identity_public_endpoint => identity_url,
|
257
|
+
:server_management_url => management_url,
|
258
|
+
:token => token,
|
259
|
+
:expires => body['token']['expires_at'],
|
260
|
+
:current_user_id => body['token']['user']['id'],
|
261
|
+
:unscoped_token => options[:unscoped_token]
|
262
|
+
}
|
263
|
+
end
|
264
|
+
|
265
|
+
def self.get_service(body, service_type=[], service_name=nil)
|
266
|
+
if not body['access'].nil?
|
267
|
+
body['access']['serviceCatalog'].find do |s|
|
268
|
+
if service_name.nil? or service_name.empty?
|
269
|
+
service_type.include?(s['type'])
|
270
|
+
else
|
271
|
+
service_type.include?(s['type']) and s['name'] == service_name
|
272
|
+
end
|
273
|
+
end
|
274
|
+
elsif not body['token']['catalog'].nil?
|
275
|
+
body['token']['catalog'].find do |s|
|
276
|
+
if service_name.nil? or service_name.empty?
|
277
|
+
service_type.include?(s['type'])
|
278
|
+
else
|
279
|
+
service_type.include?(s['type']) and s['name'] == service_name
|
280
|
+
end
|
281
|
+
end
|
282
|
+
|
283
|
+
end
|
284
|
+
end
|
285
|
+
|
286
|
+
def self.retrieve_tokens_v2(options, connection_options = {})
|
287
|
+
api_key = options[:openstack_api_key].to_s
|
288
|
+
username = options[:openstack_username].to_s
|
289
|
+
tenant_name = options[:openstack_tenant].to_s
|
290
|
+
auth_token = options[:openstack_auth_token] || options[:unscoped_token]
|
291
|
+
uri = options[:openstack_auth_uri]
|
292
|
+
|
293
|
+
identity_v2_connection = Fog::Core::Connection.new(uri.to_s, false, connection_options)
|
294
|
+
request_body = {:auth => Hash.new}
|
295
|
+
|
296
|
+
if auth_token
|
297
|
+
request_body[:auth][:token] = {
|
298
|
+
:id => auth_token
|
299
|
+
}
|
300
|
+
else
|
301
|
+
request_body[:auth][:passwordCredentials] = {
|
302
|
+
:username => username,
|
303
|
+
:password => api_key
|
304
|
+
}
|
305
|
+
end
|
306
|
+
request_body[:auth][:tenantName] = tenant_name if tenant_name
|
307
|
+
|
308
|
+
response = identity_v2_connection.request({
|
309
|
+
:expects => [200, 204],
|
310
|
+
:headers => {'Content-Type' => 'application/json'},
|
311
|
+
:body => Fog::JSON.encode(request_body),
|
312
|
+
:method => 'POST',
|
313
|
+
:path => (uri.path and not uri.path.empty?) ? uri.path : 'v2.0'
|
314
|
+
})
|
315
|
+
|
316
|
+
Fog::JSON.decode(response.body)
|
317
|
+
end
|
318
|
+
|
319
|
+
def self.retrieve_tokens_v3(options, connection_options = {})
|
320
|
+
|
321
|
+
api_key = options[:openstack_api_key].to_s
|
322
|
+
username = options[:openstack_username].to_s
|
323
|
+
userid = options[:openstack_userid]
|
324
|
+
domain_id = options[:openstack_domain_id]
|
325
|
+
domain_name = options[:openstack_domain_name]
|
326
|
+
project_domain = options[:openstack_project_domain]
|
327
|
+
project_domain_id = options[:openstack_project_domain_id]
|
328
|
+
user_domain = options[:openstack_user_domain]
|
329
|
+
user_domain_id = options[:openstack_user_domain_id]
|
330
|
+
project_name = options[:openstack_project_name]
|
331
|
+
project_id = options[:openstack_project_id]
|
332
|
+
auth_token = options[:openstack_auth_token] || options[:unscoped_token]
|
333
|
+
uri = options[:openstack_auth_uri]
|
334
|
+
|
335
|
+
connection = Fog::Core::Connection.new(uri.to_s, false, connection_options)
|
336
|
+
request_body = {:auth => {}}
|
337
|
+
|
338
|
+
scope = {}
|
339
|
+
|
340
|
+
if project_name || project_id
|
341
|
+
scope[:project] = if project_id.nil? then
|
342
|
+
if project_domain || project_domain_id
|
343
|
+
{:name => project_name, :domain => project_domain_id.nil? ? {:name => project_domain} : {:id => project_domain_id}}
|
344
|
+
else
|
345
|
+
{:name => project_name, :domain => domain_id.nil? ? {:name => domain_name} : {:id => domain_id}}
|
346
|
+
end
|
347
|
+
else
|
348
|
+
{:id => project_id}
|
349
|
+
end
|
350
|
+
elsif domain_name || domain_id
|
351
|
+
scope[:domain] = domain_id.nil? ? {:name => domain_name} : {:id => domain_id}
|
352
|
+
else
|
353
|
+
# unscoped token
|
354
|
+
end
|
355
|
+
|
356
|
+
if auth_token
|
357
|
+
request_body[:auth][:identity] = {
|
358
|
+
:methods => %w{token},
|
359
|
+
:token => {
|
360
|
+
:id => auth_token
|
361
|
+
}
|
362
|
+
}
|
363
|
+
else
|
364
|
+
request_body[:auth][:identity] = {
|
365
|
+
:methods => %w{password},
|
366
|
+
:password => {
|
367
|
+
:user => {
|
368
|
+
:password => api_key
|
369
|
+
}
|
370
|
+
}
|
371
|
+
}
|
372
|
+
|
373
|
+
if userid
|
374
|
+
request_body[:auth][:identity][:password][:user][:id] = userid
|
375
|
+
else
|
376
|
+
if user_domain || user_domain_id
|
377
|
+
request_body[:auth][:identity][:password][:user].merge! :domain => user_domain_id.nil? ? {:name => user_domain} : {:id => user_domain_id}
|
378
|
+
elsif domain_name || domain_id
|
379
|
+
request_body[:auth][:identity][:password][:user].merge! :domain => domain_id.nil? ? {:name => domain_name} : {:id => domain_id}
|
380
|
+
end
|
381
|
+
request_body[:auth][:identity][:password][:user][:name] = username
|
382
|
+
end
|
383
|
+
|
384
|
+
end
|
385
|
+
request_body[:auth][:scope] = scope unless scope.empty?
|
386
|
+
|
387
|
+
path = (uri.path and not uri.path.empty?) ? uri.path : 'v3'
|
388
|
+
|
389
|
+
response, expires = @@token_cache[{body: request_body, path: path}]
|
390
|
+
|
391
|
+
unless response && expires > Time.now
|
392
|
+
response = connection.request({ :expects => [201],
|
393
|
+
:headers => {'Content-Type' => 'application/json'},
|
394
|
+
:body => Fog::JSON.encode(request_body),
|
395
|
+
:method => 'POST',
|
396
|
+
:path => path
|
397
|
+
})
|
398
|
+
@@token_cache[{body: request_body, path: path}] = response, Time.now + 30 # 30-second TTL, enough for most requests
|
399
|
+
end
|
400
|
+
|
401
|
+
[response.headers["X-Subject-Token"], Fog::JSON.decode(response.body)]
|
402
|
+
end
|
403
|
+
|
404
|
+
def self.get_service_v3(hash, service_type=[], service_name=nil, region=nil, options={})
|
405
|
+
|
406
|
+
# Find all services matching any of the types in service_type, filtered by service_name if it's non-nil
|
407
|
+
services = hash['token']['catalog'].find_all do |s|
|
408
|
+
if service_name.nil? or service_name.empty?
|
409
|
+
service_type.include?(s['type'])
|
410
|
+
else
|
411
|
+
service_type.include?(s['type']) and s['name'] == service_name
|
412
|
+
end
|
413
|
+
end if hash['token']['catalog']
|
414
|
+
|
415
|
+
# Filter the found services by region (if specified) and whether the endpoint path matches the given regex (e.g. /\/v3/)
|
416
|
+
services.find do |s|
|
417
|
+
s['endpoints'].any? { |ep| endpoint_region?(ep, region) && endpoint_path_match?(ep, options[:openstack_endpoint_path_matches])}
|
418
|
+
end if services
|
419
|
+
|
420
|
+
end
|
421
|
+
|
422
|
+
def self.endpoint_region?(endpoint, region)
|
423
|
+
region.nil? || endpoint['region'] == region
|
424
|
+
end
|
425
|
+
|
426
|
+
def self.endpoint_path_match?(endpoint, match_regex)
|
427
|
+
match_regex.nil? || URI(endpoint['url']).path =~ match_regex
|
428
|
+
end
|
429
|
+
|
430
|
+
def self.get_supported_version(supported_versions, uri, auth_token, connection_options = {})
|
431
|
+
connection = Fog::Core::Connection.new("#{uri.scheme}://#{uri.host}:#{uri.port}", false, connection_options)
|
432
|
+
response = connection.request({
|
433
|
+
:expects => [200, 204, 300],
|
434
|
+
:headers => {'Content-Type' => 'application/json',
|
435
|
+
'Accept' => 'application/json',
|
436
|
+
'X-Auth-Token' => auth_token},
|
437
|
+
:method => 'GET'
|
438
|
+
})
|
439
|
+
|
440
|
+
body = Fog::JSON.decode(response.body)
|
441
|
+
version = nil
|
442
|
+
unless body['versions'].empty?
|
443
|
+
supported_version = body['versions'].find do |x|
|
444
|
+
x["id"].match(supported_versions) &&
|
445
|
+
(x["status"] == "CURRENT" || x["status"] == "SUPPORTED")
|
446
|
+
end
|
447
|
+
version = supported_version["id"] if supported_version
|
448
|
+
end
|
449
|
+
if version.nil?
|
450
|
+
raise Fog::OpenStack::Errors::ServiceUnavailable.new(
|
451
|
+
"OpenStack service only supports API versions #{supported_versions.inspect}")
|
452
|
+
end
|
453
|
+
|
454
|
+
version
|
455
|
+
end
|
456
|
+
|
457
|
+
def self.get_supported_version_path(supported_versions, uri, auth_token, connection_options = {})
|
458
|
+
# Find a version in the path (e.g. the v1 in /xyz/v1/tenantid/abc) and get the path up until that version (e.g. /xyz))
|
459
|
+
path_components = uri.path.split '/'
|
460
|
+
version_component_index = path_components.index{|comp| comp.match(/v[0-9].?[0-9]?/) }
|
461
|
+
versionless_path = (path_components.take(version_component_index).join '/' if version_component_index) || ''
|
462
|
+
connection = Fog::Core::Connection.new("#{uri.scheme}://#{uri.host}:#{uri.port}#{versionless_path}", false, connection_options)
|
463
|
+
response = connection.request({
|
464
|
+
:expects => [200, 204, 300],
|
465
|
+
:headers => {'Content-Type' => 'application/json',
|
466
|
+
'Accept' => 'application/json',
|
467
|
+
'X-Auth-Token' => auth_token},
|
468
|
+
:method => 'GET'
|
469
|
+
})
|
470
|
+
|
471
|
+
body = Fog::JSON.decode(response.body)
|
472
|
+
path = nil
|
473
|
+
unless body['versions'].empty?
|
474
|
+
supported_version = body['versions'].find do |x|
|
475
|
+
x["id"].match(supported_versions) &&
|
476
|
+
(x["status"] == "CURRENT" || x["status"] == "SUPPORTED")
|
477
|
+
end
|
478
|
+
path = URI.parse(supported_version['links'].first['href']).path if supported_version
|
479
|
+
end
|
480
|
+
if path.nil?
|
481
|
+
raise Fog::OpenStack::Errors::ServiceUnavailable.new(
|
482
|
+
"OpenStack service only supports API versions #{supported_versions.inspect}")
|
483
|
+
end
|
484
|
+
|
485
|
+
path.chomp '/'
|
486
|
+
end
|
487
|
+
|
488
|
+
# CGI.escape, but without special treatment on spaces
|
489
|
+
def self.escape(str, extra_exclude_chars = '')
|
490
|
+
str.gsub(/([^a-zA-Z0-9_.-#{extra_exclude_chars}]+)/) do
|
491
|
+
'%' + $1.unpack('H2' * $1.bytesize).join('%').upcase
|
492
|
+
end
|
493
|
+
end
|
494
|
+
|
495
|
+
def self.map_endpoint_type type
|
496
|
+
case type
|
497
|
+
when "publicURL"
|
498
|
+
"public"
|
499
|
+
when "internalURL"
|
500
|
+
"internal"
|
501
|
+
when "adminURL"
|
502
|
+
"admin"
|
503
|
+
end
|
504
|
+
|
505
|
+
end
|
506
|
+
end
|
507
|
+
|
508
|
+
end
|