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
@@ -0,0 +1,114 @@
|
|
1
|
+
module Fog
|
2
|
+
module OpenStack
|
3
|
+
module Core
|
4
|
+
attr_accessor :auth_token
|
5
|
+
attr_reader :auth_token_expiration
|
6
|
+
attr_reader :current_user
|
7
|
+
attr_reader :current_user_id
|
8
|
+
attr_reader :current_tenant
|
9
|
+
attr_reader :openstack_domain_name
|
10
|
+
attr_reader :openstack_user_domain
|
11
|
+
attr_reader :openstack_project_domain
|
12
|
+
attr_reader :openstack_domain_id
|
13
|
+
attr_reader :openstack_user_domain_id
|
14
|
+
attr_reader :openstack_project_domain_id
|
15
|
+
attr_reader :openstack_identity_prefix
|
16
|
+
|
17
|
+
def initialize_identity options
|
18
|
+
# Create @openstack_* instance variables from all :openstack_* options
|
19
|
+
options.select{|x|x.to_s.start_with? 'openstack'}.each do |openstack_param, value|
|
20
|
+
instance_variable_set "@#{openstack_param}".to_sym, value
|
21
|
+
end
|
22
|
+
|
23
|
+
@auth_token ||= options[:openstack_auth_token]
|
24
|
+
@openstack_identity_public_endpoint = options[:openstack_identity_endpoint]
|
25
|
+
|
26
|
+
@openstack_auth_uri = URI.parse(options[:openstack_auth_url])
|
27
|
+
@openstack_must_reauthenticate = false
|
28
|
+
@openstack_endpoint_type = options[:openstack_endpoint_type] || 'publicURL'
|
29
|
+
|
30
|
+
unless @auth_token
|
31
|
+
missing_credentials = Array.new
|
32
|
+
|
33
|
+
missing_credentials << :openstack_api_key unless @openstack_api_key
|
34
|
+
unless @openstack_username || @openstack_userid
|
35
|
+
missing_credentials << 'openstack_username or openstack_userid'
|
36
|
+
end
|
37
|
+
raise ArgumentError, "Missing required arguments: #{missing_credentials.join(', ')}" unless missing_credentials.empty?
|
38
|
+
end
|
39
|
+
|
40
|
+
@current_user = options[:current_user]
|
41
|
+
@current_user_id = options[:current_user_id]
|
42
|
+
@current_tenant = options[:current_tenant]
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
def credentials
|
47
|
+
options = {
|
48
|
+
:provider => 'openstack',
|
49
|
+
:openstack_auth_url => @openstack_auth_uri.to_s,
|
50
|
+
:openstack_auth_token => @auth_token,
|
51
|
+
:openstack_identity_endpoint => @openstack_identity_public_endpoint,
|
52
|
+
:current_user => @current_user,
|
53
|
+
:current_user_id => @current_user_id,
|
54
|
+
:current_tenant => @current_tenant,
|
55
|
+
:unscoped_token => @unscoped_token}
|
56
|
+
openstack_options.merge options
|
57
|
+
end
|
58
|
+
|
59
|
+
def reload
|
60
|
+
@connection.reset
|
61
|
+
end
|
62
|
+
|
63
|
+
private
|
64
|
+
|
65
|
+
def openstack_options
|
66
|
+
options={}
|
67
|
+
# Create a hash of (:openstack_*, value) of all the @openstack_* instance variables
|
68
|
+
self.instance_variables.select{|x|x.to_s.start_with? '@openstack'}.each do |openstack_param|
|
69
|
+
option_name = openstack_param.to_s[1..-1]
|
70
|
+
options[option_name.to_sym] = instance_variable_get openstack_param
|
71
|
+
end
|
72
|
+
options
|
73
|
+
end
|
74
|
+
|
75
|
+
def authenticate
|
76
|
+
if !@openstack_management_url || @openstack_must_reauthenticate
|
77
|
+
|
78
|
+
options = openstack_options
|
79
|
+
|
80
|
+
options[:openstack_auth_token] = @openstack_must_reauthenticate ? nil : @openstack_auth_token
|
81
|
+
|
82
|
+
credentials = Fog::OpenStack.authenticate(options, @connection_options)
|
83
|
+
|
84
|
+
@current_user = credentials[:user]
|
85
|
+
@current_user_id = credentials[:current_user_id]
|
86
|
+
@current_tenant = credentials[:tenant]
|
87
|
+
|
88
|
+
@openstack_must_reauthenticate = false
|
89
|
+
@auth_token = credentials[:token]
|
90
|
+
@openstack_management_url = credentials[:server_management_url]
|
91
|
+
@unscoped_token = credentials[:unscoped_token]
|
92
|
+
else
|
93
|
+
@auth_token = @openstack_auth_token
|
94
|
+
end
|
95
|
+
@openstack_management_uri = URI.parse(@openstack_management_url)
|
96
|
+
|
97
|
+
@host = @openstack_management_uri.host
|
98
|
+
@path = @openstack_management_uri.path
|
99
|
+
@path.sub!(/\/$/, '')
|
100
|
+
@port = @openstack_management_uri.port
|
101
|
+
@scheme = @openstack_management_uri.scheme
|
102
|
+
|
103
|
+
# Not all implementations have identity service in the catalog
|
104
|
+
if @openstack_identity_public_endpoint || @openstack_management_url
|
105
|
+
@identity_connection = Fog::Core::Connection.new(
|
106
|
+
@openstack_identity_public_endpoint || @openstack_management_url,
|
107
|
+
false, @connection_options)
|
108
|
+
end
|
109
|
+
|
110
|
+
true
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
@@ -0,0 +1,681 @@
|
|
1
|
+
#Compute (Nova)
|
2
|
+
|
3
|
+
This document explains how to get started using OpenStack Compute (Nova) with Fog. It assumes you have read the [Getting Started with Fog and the OpenStack](getting_started.md) document.
|
4
|
+
|
5
|
+
## Starting irb console
|
6
|
+
|
7
|
+
Start by executing the following command:
|
8
|
+
|
9
|
+
irb
|
10
|
+
|
11
|
+
Once `irb` has launched you need to require the Fog library by executing:
|
12
|
+
|
13
|
+
require 'fog'
|
14
|
+
|
15
|
+
## Create Service
|
16
|
+
|
17
|
+
Next, create a connection to the Compute Service:
|
18
|
+
|
19
|
+
service = Fog::Compute.new({
|
20
|
+
:provider => 'openstack', # OpenStack Fog provider
|
21
|
+
:openstack_auth_url => 'http://KEYSTONE_HOST:KEYSTONE_PORT/v2.0/tokens', # OpenStack Keystone endpoint
|
22
|
+
:openstack_username => OPEN_STACK_USER, # Your OpenStack Username
|
23
|
+
:openstack_tenant => OPEN_STACK_TENANT, # Your tenant id
|
24
|
+
:openstack_api_key => OPEN_STACK_PASSWORD, # Your OpenStack Password
|
25
|
+
:connection_options => {} # Optional
|
26
|
+
})
|
27
|
+
|
28
|
+
**Note** `openstack_username` and `openstack_tenant` default to `admin` if omitted.
|
29
|
+
|
30
|
+
### Optional Connection Parameters
|
31
|
+
|
32
|
+
Fog supports passing additional connection parameters to its underlying HTTP library (Excon) using the `:connection_options` parameter.
|
33
|
+
|
34
|
+
<table>
|
35
|
+
<tr>
|
36
|
+
<th>Key</th>
|
37
|
+
<th>Description</th>
|
38
|
+
</tr>
|
39
|
+
<tr>
|
40
|
+
<td>:connect_timeout</td>
|
41
|
+
<td>Connection timeout (default: 60 seconds)</td>
|
42
|
+
</tr>
|
43
|
+
<tr>
|
44
|
+
<td>:read_timeout</td>
|
45
|
+
<td>Read timeout for connection (default: 60 seconds)</td> </tr>
|
46
|
+
<tr>
|
47
|
+
<td>:write_timeout</td>
|
48
|
+
<td>Write timeout for connection (default: 60 seconds)</td>
|
49
|
+
</tr>
|
50
|
+
<tr>
|
51
|
+
<td>:proxy</td>
|
52
|
+
<td>Proxy for HTTP and HTTPS connections</td>
|
53
|
+
</tr>
|
54
|
+
<tr>
|
55
|
+
<td>:ssl_ca_path</td>
|
56
|
+
<td>Path to SSL certificate authorities</td>
|
57
|
+
</tr>
|
58
|
+
<tr>
|
59
|
+
<td>:ssl_ca_file</td>
|
60
|
+
<td>SSL certificate authority file</td>
|
61
|
+
</tr>
|
62
|
+
<tr>
|
63
|
+
<td>:ssl_verify_peer</td>
|
64
|
+
<td>SSL verify peer (default: true)</td>
|
65
|
+
</tr>
|
66
|
+
</table>
|
67
|
+
|
68
|
+
|
69
|
+
## Fog Abstractions
|
70
|
+
|
71
|
+
Fog provides both a **model** and **request** abstraction. The request abstraction provides the most efficient interface and the model abstraction wraps the request abstraction to provide a convenient `ActiveModel` like interface.
|
72
|
+
|
73
|
+
### Request Layer
|
74
|
+
|
75
|
+
The request abstraction maps directly to the [OpenStack Compute API](http://docs.openstack.org/api/openstack-compute/2/content/). It provides the most efficient interface to the OpenStack Compute service.
|
76
|
+
|
77
|
+
To see a list of requests supported by the service:
|
78
|
+
|
79
|
+
service.requests
|
80
|
+
|
81
|
+
This returns:
|
82
|
+
|
83
|
+
:list_servers, :list_servers_detail, :create_server, :get_server_details, :update_server, :delete_server, :server_actions, :server_action, :reboot_server, :rebuild_server, :resize_server, :confirm_resize_server, :revert_resize_server, :pause_server, :unpause_server, :suspend_server, :resume_server, :rescue_server, :change_server_password, :add_fixed_ip, :remove_fixed_ip, :server_diagnostics, :boot_from_snapshot, :reset_server_state, :get_console_output, :get_vnc_console, :live_migrate_server, :migrate_server, :list_images, :list_images_detail, :create_image, :get_image_details, :delete_image, :list_flavors, :list_flavors_detail, :get_flavor_details, :create_flavor, :delete_flavor, :add_flavor_access, :remove_flavor_access, :list_tenants_with_flavor_access, :list_metadata, :get_metadata, :set_metadata, :update_metadata, :delete_metadata, :delete_meta, :update_meta, :list_addresses, :list_address_pools, :list_all_addresses, :list_private_addresses, :list_public_addresses, :get_address, :allocate_address, :associate_address, :release_address, :disassociate_address, :list_security_groups, :get_security_group, :create_security_group, :create_security_group_rule, :delete_security_group, :delete_security_group_rule, :get_security_group_rule, :list_key_pairs, :create_key_pair, :delete_key_pair, :list_tenants, :set_tenant, :get_limits, :list_volumes, :create_volume, :get_volume_details, :delete_volume, :attach_volume, :detach_volume, :get_server_volumes, :create_volume_snapshot, :list_snapshots, :get_snapshot_details, :delete_snapshot, :list_usages, :get_usage, :get_quota, :get_quota_defaults, :update_quota, :list_hosts, :get_host_details
|
84
|
+
|
85
|
+
|
86
|
+
#### Example Request
|
87
|
+
|
88
|
+
To request a list of flavors:
|
89
|
+
|
90
|
+
response = service.list_flavors
|
91
|
+
|
92
|
+
This returns in the following `Excon::Response`:
|
93
|
+
|
94
|
+
#<Excon::Response:0x007f88a12d0268 @data={:body=>{"flavors"=>[{"id"=>"1", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"bookmark"}], "name"=>"m1.tiny"}, {"id"=>"2", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/2", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/2", "rel"=>"bookmark"}], "name"=>"m1.small"}, {"id"=>"3", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/3", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/3", "rel"=>"bookmark"}], "name"=>"m1.medium"}, {"id"=>"4", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/4", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/4", "rel"=>"bookmark"}], "name"=>"m1.large"}, {"id"=>"42", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/42", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/42", "rel"=>"bookmark"}], "name"=>"m1.nano"}, {"id"=>"5", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/5", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/5", "rel"=>"bookmark"}], "name"=>"m1.xlarge"}, {"id"=>"84", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/84", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/84", "rel"=>"bookmark"}], "name"=>"m1.micro"}]}, :headers=>{"Content-Type"=>"application/json", "Content-Length"=>"1748", "X-Compute-Request-Id"=>"req-ae3bcf11-deab-493b-a2d8-1432dead3f7a", "Date"=>"Thu, 09 Jan 2014 17:01:15 GMT"}, :status=>200, :remote_ip=>"localhost"}, @body="{\"flavors\": [{\"id\": \"1\", \"links\": [{\"href\": \"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1\", \"rel\": \"self\"}, {\"href\": \"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1\", \"rel\": \"bookmark\"}], \"name\": \"m1.tiny\"}, {\"id\": \"2\", \"links\": [{\"href\": \"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/2\", \"rel\": \"self\"}, {\"href\": \"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/2\", \"rel\": \"bookmark\"}], \"name\": \"m1.small\"}, {\"id\": \"3\", \"links\": [{\"href\": \"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/3\", \"rel\": \"self\"}, {\"href\": \"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/3\", \"rel\": \"bookmark\"}], \"name\": \"m1.medium\"}, {\"id\": \"4\", \"links\": [{\"href\": \"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/4\", \"rel\": \"self\"}, {\"href\": \"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/4\", \"rel\": \"bookmark\"}], \"name\": \"m1.large\"}, {\"id\": \"42\", \"links\": [{\"href\": \"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/42\", \"rel\": \"self\"}, {\"href\": \"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/42\", \"rel\": \"bookmark\"}], \"name\": \"m1.nano\"}, {\"id\": \"5\", \"links\": [{\"href\": \"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/5\", \"rel\": \"self\"}, {\"href\": \"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/5\", \"rel\": \"bookmark\"}], \"name\": \"m1.xlarge\"}, {\"id\": \"84\", \"links\": [{\"href\": \"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/84\", \"rel\": \"self\"}, {\"href\": \"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/84\", \"rel\": \"bookmark\"}], \"name\": \"m1.micro\"}]}", @headers={"Content-Type"=>"application/json", "Content-Length"=>"1748", "X-Compute-Request-Id"=>"req-ae3bcf11-deab-493b-a2d8-1432dead3f7a", "Date"=>"Thu, 09 Jan 2014 17:01:15 GMT"}, @status=200, @remote_ip="localhost">
|
95
|
+
|
96
|
+
To view the status of the response:
|
97
|
+
|
98
|
+
response.status
|
99
|
+
|
100
|
+
**Note**: Fog is aware of valid HTTP response statuses for each request type. If an unexpected HTTP response status occurs, Fog will raise an exception.
|
101
|
+
|
102
|
+
To view response body:
|
103
|
+
|
104
|
+
response.body
|
105
|
+
|
106
|
+
This will return:
|
107
|
+
|
108
|
+
{"flavors"=>[{"id"=>"1", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"bookmark"}], "name"=>"m1.tiny"}, {"id"=>"2", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/2", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/2", "rel"=>"bookmark"}], "name"=>"m1.small"}, {"id"=>"3", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/3", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/3", "rel"=>"bookmark"}], "name"=>"m1.medium"}, {"id"=>"4", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/4", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/4", "rel"=>"bookmark"}], "name"=>"m1.large"}, {"id"=>"42", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/42", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/42", "rel"=>"bookmark"}], "name"=>"m1.nano"}, {"id"=>"5", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/5", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/5", "rel"=>"bookmark"}], "name"=>"m1.xlarge"}, {"id"=>"84", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/84", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/84", "rel"=>"bookmark"}], "name"=>"m1.micro"}]}
|
109
|
+
|
110
|
+
|
111
|
+
To learn more about Compute request methods refer to [rdoc](http://rubydoc.info/gems/fog/Fog/Compute/Openstack/Real). To learn more about Excon refer to [Excon GitHub repo](https://github.com/geemus/excon).
|
112
|
+
|
113
|
+
### Model Layer
|
114
|
+
|
115
|
+
Fog models behave in a manner similar to `ActiveModel`. Models will generally respond to `create`, `save`, `persisted?`, `destroy`, `reload` and `attributes` methods. Additionally, fog will automatically create attribute accessors.
|
116
|
+
|
117
|
+
Here is a summary of common model methods:
|
118
|
+
|
119
|
+
<table>
|
120
|
+
<tr>
|
121
|
+
<th>Method</th>
|
122
|
+
<th>Description</th>
|
123
|
+
</tr>
|
124
|
+
<tr>
|
125
|
+
<td>create</td>
|
126
|
+
<td>
|
127
|
+
Accepts hash of attributes and creates object.<br>
|
128
|
+
Note: creation is a non-blocking call and you will be required to wait for a valid state before using resulting object.
|
129
|
+
</td>
|
130
|
+
</tr>
|
131
|
+
<tr>
|
132
|
+
<td>save</td>
|
133
|
+
<td>Saves object.<br>
|
134
|
+
Note: not all objects support updating object.</td>
|
135
|
+
</tr>
|
136
|
+
<tr>
|
137
|
+
<td>persisted?</td>
|
138
|
+
<td>Returns true if the object has been persisted.</td>
|
139
|
+
</tr>
|
140
|
+
<tr>
|
141
|
+
<td>destroy</td>
|
142
|
+
<td>
|
143
|
+
Destroys object.<br>
|
144
|
+
Note: this is a non-blocking call and object deletion might not be instantaneous.
|
145
|
+
</td>
|
146
|
+
<tr>
|
147
|
+
<td>reload</td>
|
148
|
+
<td>Updates object with latest state from service.</td>
|
149
|
+
<tr>
|
150
|
+
<td>ready?</td>
|
151
|
+
<td>Returns true if object is in a ready state and able to perform actions. This method will raise an exception if object is in an error state.</td>
|
152
|
+
</tr>
|
153
|
+
<tr>
|
154
|
+
<td>attributes</td>
|
155
|
+
<td>Returns a hash containing the list of model attributes and values.</td>
|
156
|
+
</tr>
|
157
|
+
<td>identity</td>
|
158
|
+
<td>
|
159
|
+
Returns the identity of the object.<br>
|
160
|
+
Note: This might not always be equal to object.id.
|
161
|
+
</td>
|
162
|
+
</tr>
|
163
|
+
<tr>
|
164
|
+
<td>wait_for</td>
|
165
|
+
<td>This method periodically reloads model and then yields to specified block until block returns true or a timeout occurs.</td>
|
166
|
+
</tr>
|
167
|
+
</table>
|
168
|
+
|
169
|
+
The remainder of this document details the model abstraction.
|
170
|
+
|
171
|
+
## List Images
|
172
|
+
|
173
|
+
To retrieve a list of available images:
|
174
|
+
|
175
|
+
service.images
|
176
|
+
|
177
|
+
This returns a collection of `Fog::Compute::OpenStack::Image` models:
|
178
|
+
|
179
|
+
<Fog::Compute::OpenStack::Images
|
180
|
+
filters={},
|
181
|
+
server=nil
|
182
|
+
[
|
183
|
+
<Fog::Compute::OpenStack::Image
|
184
|
+
id="821e2b73-5aed-4f9d-aaa7-2f4f297779f3",
|
185
|
+
name="cirros-0.3.1-x86_64-uec",
|
186
|
+
created_at="2013-07-11T19:59:19Z",
|
187
|
+
updated_at="2013-07-11T19:59:20Z",
|
188
|
+
progress=100,
|
189
|
+
status="ACTIVE",
|
190
|
+
minDisk=0,
|
191
|
+
minRam=0,
|
192
|
+
server=nil,
|
193
|
+
metadata= <Fog::Compute::OpenStack::Metadata
|
194
|
+
[
|
195
|
+
<Fog::Compute::OpenStack::Metadatum
|
196
|
+
key="kernel_id",
|
197
|
+
value="f443896b-089c-40e7-8712-bb48a676a8de"
|
198
|
+
>,
|
199
|
+
<Fog::Compute::OpenStack::Metadatum
|
200
|
+
key="ramdisk_id",
|
201
|
+
value="e21af7e2-a181-403a-84a4-fd9df36cb963"
|
202
|
+
>
|
203
|
+
]
|
204
|
+
>,
|
205
|
+
links=[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/images/821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/images/821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "rel"=>"bookmark"}, {"href"=>"http://localhost:9292/b5bf8e689bc64844b1d08094a2f2bdd5/images/821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "type"=>"application/vnd.openstack.image", "rel"=>"alternate"}]
|
206
|
+
>,
|
207
|
+
<Fog::Compute::OpenStack::Image
|
208
|
+
id="e21af7e2-a181-403a-84a4-fd9df36cb963",
|
209
|
+
name="cirros-0.3.1-x86_64-uec-ramdisk",
|
210
|
+
created_at="2013-07-11T19:59:18Z",
|
211
|
+
updated_at="2013-07-11T19:59:18Z",
|
212
|
+
progress=100,
|
213
|
+
status="ACTIVE",
|
214
|
+
minDisk=0,
|
215
|
+
minRam=0,
|
216
|
+
server=nil,
|
217
|
+
metadata= <Fog::Compute::OpenStack::Metadata
|
218
|
+
[]
|
219
|
+
>,
|
220
|
+
links=[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/images/e21af7e2-a181-403a-84a4-fd9df36cb963", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/images/e21af7e2-a181-403a-84a4-fd9df36cb963", "rel"=>"bookmark"}, {"href"=>"http://localhost:9292/b5bf8e689bc64844b1d08094a2f2bdd5/images/e21af7e2-a181-403a-84a4-fd9df36cb963", "type"=>"application/vnd.openstack.image", "rel"=>"alternate"}]
|
221
|
+
>,
|
222
|
+
…
|
223
|
+
|
224
|
+
## Get Image
|
225
|
+
|
226
|
+
To retrieve individual image:
|
227
|
+
|
228
|
+
service.images.get "821e2b73-5aed-4f9d-aaa7-2f4f297779f3"
|
229
|
+
|
230
|
+
This returns an `Fog::Compute::OpenStack::Image` instance:
|
231
|
+
|
232
|
+
<Fog::Compute::OpenStack::Image
|
233
|
+
id="821e2b73-5aed-4f9d-aaa7-2f4f297779f3",
|
234
|
+
name="cirros-0.3.1-x86_64-uec",
|
235
|
+
created_at="2013-07-11T19:59:19Z",
|
236
|
+
updated_at="2013-07-11T19:59:20Z",
|
237
|
+
progress=100,
|
238
|
+
status="ACTIVE",
|
239
|
+
minDisk=0,
|
240
|
+
minRam=0,
|
241
|
+
server=nil,
|
242
|
+
metadata= <Fog::Compute::OpenStack::Metadata
|
243
|
+
[
|
244
|
+
<Fog::Compute::OpenStack::Metadatum
|
245
|
+
key="kernel_id",
|
246
|
+
value="f443896b-089c-40e7-8712-bb48a676a8de"
|
247
|
+
>,
|
248
|
+
<Fog::Compute::OpenStack::Metadatum
|
249
|
+
key="ramdisk_id",
|
250
|
+
value="e21af7e2-a181-403a-84a4-fd9df36cb963"
|
251
|
+
>
|
252
|
+
]
|
253
|
+
>,
|
254
|
+
links=[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/images/821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/images/821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "rel"=>"bookmark"}, {"href"=>"http://localhost:9292/b5bf8e689bc64844b1d08094a2f2bdd5/images/821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "type"=>"application/vnd.openstack.image", "rel"=>"alternate"}]
|
255
|
+
>
|
256
|
+
|
257
|
+
## List Flavors
|
258
|
+
|
259
|
+
To retrieve a list of available flavors:
|
260
|
+
|
261
|
+
service.flavors
|
262
|
+
|
263
|
+
This returns a collection of `Fog::Compute::OpenStack::Flavor` models:
|
264
|
+
|
265
|
+
<Fog::Compute::OpenStack::Flavors
|
266
|
+
[
|
267
|
+
<Fog::Compute::OpenStack::Flavor
|
268
|
+
id="1",
|
269
|
+
name="m1.tiny",
|
270
|
+
ram=512,
|
271
|
+
disk=1,
|
272
|
+
vcpus=1,
|
273
|
+
links=[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"bookmark"}],
|
274
|
+
swap="",
|
275
|
+
rxtx_factor=1.0,
|
276
|
+
ephemeral=0,
|
277
|
+
is_public=true,
|
278
|
+
disabled=false
|
279
|
+
>,
|
280
|
+
<Fog::Compute::OpenStack::Flavor
|
281
|
+
id="2",
|
282
|
+
name="m1.small",
|
283
|
+
ram=2048,
|
284
|
+
disk=20,
|
285
|
+
vcpus=1,
|
286
|
+
links=[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/2", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/2", "rel"=>"bookmark"}],
|
287
|
+
swap="",
|
288
|
+
rxtx_factor=1.0,
|
289
|
+
ephemeral=0,
|
290
|
+
is_public=true,
|
291
|
+
disabled=false
|
292
|
+
>,
|
293
|
+
…
|
294
|
+
|
295
|
+
|
296
|
+
## Get Flavor
|
297
|
+
|
298
|
+
To retrieve individual flavor:
|
299
|
+
|
300
|
+
service.flavors.get 1
|
301
|
+
|
302
|
+
This returns a `Fog::Compute::OpenStack::Flavor` instance:
|
303
|
+
|
304
|
+
<Fog::Compute::OpenStack::Flavor
|
305
|
+
id="1",
|
306
|
+
name="m1.tiny",
|
307
|
+
ram=512,
|
308
|
+
disk=1,
|
309
|
+
vcpus=1,
|
310
|
+
links=[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"bookmark"}],
|
311
|
+
swap="",
|
312
|
+
rxtx_factor=1.0,
|
313
|
+
ephemeral=0,
|
314
|
+
is_public=true,
|
315
|
+
disabled=false
|
316
|
+
>
|
317
|
+
|
318
|
+
## List Servers
|
319
|
+
|
320
|
+
To retrieve a list of available servers:
|
321
|
+
|
322
|
+
service.servers
|
323
|
+
|
324
|
+
This returns a collection of `Fog::Compute::OpenStack::Servers` models:
|
325
|
+
|
326
|
+
<Fog::Compute::OpenStack::Servers
|
327
|
+
filters={}
|
328
|
+
[
|
329
|
+
<Fog::Compute::OpenStack::Server
|
330
|
+
id="4572529c-0cfc-433e-8dbf-7cc383ed5b7c",
|
331
|
+
instance_name=nil,
|
332
|
+
addresses={"private"=>[{"OS-EXT-IPS-MAC:mac_addr"=>"fa:16:3e:14:34:b8", "version"=>4, "addr"=>"10.0.0.5", "OS-EXT-IPS:type"=>"fixed"}]},
|
333
|
+
flavor={"id"=>"1", "links"=>[{"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"bookmark"}]},
|
334
|
+
host_id="bb705edc279c520d97ad6fbd0b8e75a5c716388616f58e527d0ff633",
|
335
|
+
image={"id"=>"821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "links"=>[{"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/images/821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "rel"=>"bookmark"}]},
|
336
|
+
metadata= <Fog::Compute::OpenStack::Metadata
|
337
|
+
[]
|
338
|
+
>,
|
339
|
+
links=[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/servers/4572529c-0cfc-433e-8dbf-7cc383ed5b7c", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/servers/4572529c-0cfc-433e-8dbf-7cc383ed5b7c", "rel"=>"bookmark"}],
|
340
|
+
name="doc-test",
|
341
|
+
personality=nil,
|
342
|
+
progress=0,
|
343
|
+
accessIPv4="",
|
344
|
+
accessIPv6="",
|
345
|
+
availability_zone="nova",
|
346
|
+
user_data_encoded=nil,
|
347
|
+
state="ACTIVE",
|
348
|
+
created=2013-10-10 18:17:46 UTC,
|
349
|
+
updated=2013-10-10 18:17:56 UTC,
|
350
|
+
tenant_id="b5bf8e689bc64844b1d08094a2f2bdd5",
|
351
|
+
user_id="dbee88bc901b4593867c105b2b1ad15b",
|
352
|
+
key_name=nil,
|
353
|
+
fault=nil,
|
354
|
+
config_drive="",
|
355
|
+
os_dcf_disk_config="MANUAL",
|
356
|
+
os_ext_srv_attr_host="devstack",
|
357
|
+
os_ext_srv_attr_hypervisor_hostname="devstack",
|
358
|
+
os_ext_srv_attr_instance_name="instance-00000016",
|
359
|
+
os_ext_sts_power_state=1,
|
360
|
+
os_ext_sts_task_state=nil,
|
361
|
+
os_ext_sts_vm_state="active"
|
362
|
+
>,
|
363
|
+
…
|
364
|
+
|
365
|
+
## Get Server
|
366
|
+
|
367
|
+
To return an individual server:
|
368
|
+
|
369
|
+
service.servers.get "4572529c-0cfc-433e-8dbf-7cc383ed5b7c"
|
370
|
+
|
371
|
+
This returns a `Fog::Compute::OpenStack::Server` instance:
|
372
|
+
|
373
|
+
<Fog::Compute::OpenStack::Server
|
374
|
+
id="4572529c-0cfc-433e-8dbf-7cc383ed5b7c",
|
375
|
+
instance_name=nil,
|
376
|
+
addresses={"private"=>[{"OS-EXT-IPS-MAC:mac_addr"=>"fa:16:3e:14:34:b8", "version"=>4, "addr"=>"10.0.0.5", "OS-EXT-IPS:type"=>"fixed"}]},
|
377
|
+
flavor={"id"=>"1", "links"=>[{"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"bookmark"}]},
|
378
|
+
host_id="bb705edc279c520d97ad6fbd0b8e75a5c716388616f58e527d0ff633",
|
379
|
+
image={"id"=>"821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "links"=>[{"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/images/821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "rel"=>"bookmark"}]},
|
380
|
+
metadata= <Fog::Compute::OpenStack::Metadata
|
381
|
+
[]
|
382
|
+
>,
|
383
|
+
links=[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/servers/4572529c-0cfc-433e-8dbf-7cc383ed5b7c", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/servers/4572529c-0cfc-433e-8dbf-7cc383ed5b7c", "rel"=>"bookmark"}],
|
384
|
+
name="doc-test",
|
385
|
+
personality=nil,
|
386
|
+
progress=0,
|
387
|
+
accessIPv4="",
|
388
|
+
accessIPv6="",
|
389
|
+
availability_zone="nova",
|
390
|
+
user_data_encoded=nil,
|
391
|
+
state="ACTIVE",
|
392
|
+
created=2013-10-10 18:17:46 UTC,
|
393
|
+
updated=2013-10-10 18:17:56 UTC,
|
394
|
+
tenant_id="b5bf8e689bc64844b1d08094a2f2bdd5",
|
395
|
+
user_id="dbee88bc901b4593867c105b2b1ad15b",
|
396
|
+
key_name=nil,
|
397
|
+
fault=nil,
|
398
|
+
config_drive="",
|
399
|
+
os_dcf_disk_config="MANUAL",
|
400
|
+
os_ext_srv_attr_host="devstack",
|
401
|
+
os_ext_srv_attr_hypervisor_hostname="devstack",
|
402
|
+
os_ext_srv_attr_instance_name="instance-00000016",
|
403
|
+
os_ext_sts_power_state=1,
|
404
|
+
os_ext_sts_task_state=nil,
|
405
|
+
os_ext_sts_vm_state="active"
|
406
|
+
>
|
407
|
+
|
408
|
+
## Create Server
|
409
|
+
|
410
|
+
If you are interested in creating a server utilizing ssh key authentication, you are recommended to use [bootstrap](#bootstrap) method.
|
411
|
+
|
412
|
+
To create a server:
|
413
|
+
|
414
|
+
flavor = service.flavors.first
|
415
|
+
image = service.images.first
|
416
|
+
server = service.servers.create(:name => 'fog-doc', :flavor_ref => flavor.id, :image_ref => image.id)
|
417
|
+
|
418
|
+
**Note**: The `:name`, `:flavor_ref`, and `image_ref` attributes are required for server creation.
|
419
|
+
|
420
|
+
This will return a `Fog::Compute::OpenStack::Server` instance:
|
421
|
+
|
422
|
+
<Fog::Compute::OpenStack::Server
|
423
|
+
id="81746324-94ab-44fb-9aa9-ee0b4d95fa34",
|
424
|
+
instance_name=nil,
|
425
|
+
addresses=nil,
|
426
|
+
flavor=nil,
|
427
|
+
host_id=nil,
|
428
|
+
image=nil,
|
429
|
+
metadata= <Fog::Compute::OpenStack::Metadata
|
430
|
+
[]
|
431
|
+
>,
|
432
|
+
links=[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/servers/81746324-94ab-44fb-9aa9-ee0b4d95fa34", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/servers/81746324-94ab-44fb-9aa9-ee0b4d95fa34", "rel"=>"bookmark"}],
|
433
|
+
name="fog-doc",
|
434
|
+
personality=nil,
|
435
|
+
progress=nil,
|
436
|
+
accessIPv4=nil,
|
437
|
+
accessIPv6=nil,
|
438
|
+
availability_zone=nil,
|
439
|
+
user_data_encoded=nil,
|
440
|
+
state=nil,
|
441
|
+
created=nil,
|
442
|
+
updated=nil,
|
443
|
+
tenant_id=nil,
|
444
|
+
user_id=nil,
|
445
|
+
key_name=nil,
|
446
|
+
fault=nil,
|
447
|
+
config_drive=nil,
|
448
|
+
os_dcf_disk_config="MANUAL",
|
449
|
+
os_ext_srv_attr_host=nil,
|
450
|
+
os_ext_srv_attr_hypervisor_hostname=nil,
|
451
|
+
os_ext_srv_attr_instance_name=nil,
|
452
|
+
os_ext_sts_power_state=nil,
|
453
|
+
os_ext_sts_task_state=nil,
|
454
|
+
os_ext_sts_vm_state=nil
|
455
|
+
>
|
456
|
+
|
457
|
+
Notice that your server contains several `nil` attributes. To see the latest status, reload the instance as follows:
|
458
|
+
|
459
|
+
server.reload
|
460
|
+
|
461
|
+
You can see that the server is currently being built:
|
462
|
+
|
463
|
+
<Fog::Compute::OpenStack::Server
|
464
|
+
id="5f50aeff-a745-4cbc-9f8b-0356142e6f95",
|
465
|
+
instance_name=nil,
|
466
|
+
addresses={"private"=>[{"OS-EXT-IPS-MAC:mac_addr"=>"fa:16:3e:71:0d:c4", "version"=>4, "addr"=>"10.0.0.2", "OS-EXT-IPS:type"=>"fixed"}]},
|
467
|
+
flavor={"id"=>"1", "links"=>[{"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"bookmark"}]},
|
468
|
+
host_id="bb705edc279c520d97ad6fbd0b8e75a5c716388616f58e527d0ff633",
|
469
|
+
image={"id"=>"821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "links"=>[{"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/images/821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "rel"=>"bookmark"}]},
|
470
|
+
metadata= <Fog::Compute::OpenStack::Metadata
|
471
|
+
[]
|
472
|
+
>,
|
473
|
+
links=[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/servers/5f50aeff-a745-4cbc-9f8b-0356142e6f95", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/servers/5f50aeff-a745-4cbc-9f8b-0356142e6f95", "rel"=>"bookmark"}],
|
474
|
+
name="fog-doc",
|
475
|
+
personality=nil,
|
476
|
+
progress=0,
|
477
|
+
accessIPv4="",
|
478
|
+
accessIPv6="",
|
479
|
+
availability_zone="nova",
|
480
|
+
user_data_encoded=nil,
|
481
|
+
state="BUILD",
|
482
|
+
created=2014-01-09 19:43:52 UTC,
|
483
|
+
updated=2014-01-09 19:43:58 UTC,
|
484
|
+
tenant_id="b5bf8e689bc64844b1d08094a2f2bdd5",
|
485
|
+
user_id="dbee88bc901b4593867c105b2b1ad15b",
|
486
|
+
key_name=nil,
|
487
|
+
fault=nil,
|
488
|
+
config_drive="",
|
489
|
+
os_dcf_disk_config="MANUAL",
|
490
|
+
os_ext_srv_attr_host="devstack",
|
491
|
+
os_ext_srv_attr_hypervisor_hostname="devstack",
|
492
|
+
os_ext_srv_attr_instance_name="instance-00000018",
|
493
|
+
os_ext_sts_power_state=0,
|
494
|
+
os_ext_sts_task_state="spawning",
|
495
|
+
os_ext_sts_vm_state="building"
|
496
|
+
>
|
497
|
+
|
498
|
+
You will be unable to perform any actions to this server until it reaches an `ACTIVE` state. Since this is true for most server actions, Fog provides the convenience method `wait_for`.
|
499
|
+
|
500
|
+
Fog can wait for the server to become ready as follows:
|
501
|
+
|
502
|
+
server.wait_for { ready? }
|
503
|
+
|
504
|
+
**Note**: The `Fog::Compute::OpenStack::Server` instance returned from the create method contains a `password` attribute. The `password` attribute will NOT be present in subsequent retrievals either through `service.servers` or `service.servers.get my_server_id`.
|
505
|
+
|
506
|
+
### Additional Parameters
|
507
|
+
|
508
|
+
The `create` method also supports the following key values:
|
509
|
+
|
510
|
+
<table>
|
511
|
+
<tr>
|
512
|
+
<th>Key</th>
|
513
|
+
<th>Description</th>
|
514
|
+
</tr>
|
515
|
+
<tr>
|
516
|
+
<td>:metadata</td>
|
517
|
+
<td>Hash containing server metadata.</td>
|
518
|
+
</tr>
|
519
|
+
<tr>
|
520
|
+
<td>:personality</td>
|
521
|
+
<td>Array of files to be injected onto the server. Please refer to the Fog <a href="http://rubydoc.info/github/fog/fog/Fog/Compute/OpenStack/Server:personality">personality </a> API documentation for further information.</td>
|
522
|
+
</tr>
|
523
|
+
</table>
|
524
|
+
|
525
|
+
## Bootstrap
|
526
|
+
|
527
|
+
In addition to the `create` method, Fog provides a `bootstrap` method which creates a server and then performs the following actions via ssh:
|
528
|
+
|
529
|
+
1. Create `ROOT_USER/.ssh/authorized_keys` file using the ssh key specified in `:public_key_path`.
|
530
|
+
2. Lock password for root user using `passwd -l root`.
|
531
|
+
3. Create `ROOT_USER/attributes.json` file with the contents of `server.attributes`.
|
532
|
+
4. Create `ROOT_USER/metadata.json` file with the contents of `server.metadata`.
|
533
|
+
|
534
|
+
**Note**: Unlike the `create` method, `bootstrap` is blocking method call. If non-blocking behavior is desired, developers should use the `:personality` parameter on the `create` method.
|
535
|
+
|
536
|
+
The following example demonstrates bootstraping a server:
|
537
|
+
|
538
|
+
service.servers.bootstrap :name => 'bootstrap-server',
|
539
|
+
:flavor_id => service.flavors.first.id,
|
540
|
+
:image_id => service.images.find {|img| img.name =~ /Ubuntu/}.id,
|
541
|
+
:public_key_path => '~/.ssh/fog_rsa.pub',
|
542
|
+
:private_key_path => '~/.ssh/fog_rsa'
|
543
|
+
|
544
|
+
**Note**: The `:name`, `:flavor_ref`, `:image_ref`, `:public_key_path`, `:private_key_path` are required for the `bootstrap` method.
|
545
|
+
|
546
|
+
The `bootstrap` method uses the same additional parameters as the `create` method. Refer to the [Additional Parameters](#additional-parameters) section for more information.
|
547
|
+
|
548
|
+
## SSH
|
549
|
+
|
550
|
+
Once a server has been created and set up for ssh key authentication, fog can execute remote commands as follows:
|
551
|
+
|
552
|
+
result = server.ssh ['pwd']
|
553
|
+
|
554
|
+
This will return the following:
|
555
|
+
|
556
|
+
[#<Fog::SSH::Result:0x1108241d0 @stderr="", @status=0, @stdout="/root\r\n", @command="pwd">]
|
557
|
+
|
558
|
+
**Note**: SSH key authentication can be set up using `bootstrap` method or by using the `:personality` attribute on the `:create` method. See [Bootstrap](#bootstrap) or [Create Server](#create-server) for more information.
|
559
|
+
|
560
|
+
## Delete Server
|
561
|
+
|
562
|
+
To delete a server:
|
563
|
+
|
564
|
+
server.destroy
|
565
|
+
|
566
|
+
**Note**: The server is not immediately destroyed, but it does occur shortly there after.
|
567
|
+
|
568
|
+
## Change Admin Password
|
569
|
+
|
570
|
+
To change the administrator password:
|
571
|
+
|
572
|
+
server.change_password "superSecure"
|
573
|
+
|
574
|
+
## Reboot
|
575
|
+
|
576
|
+
To perform a soft reboot:
|
577
|
+
|
578
|
+
server.reboot
|
579
|
+
|
580
|
+
To perform a hard reboot:
|
581
|
+
|
582
|
+
server.reboot 'HARD'
|
583
|
+
|
584
|
+
## Rebuild
|
585
|
+
|
586
|
+
Rebuild removes all data on the server and replaces it with the specified image. The id and all IP addresses remain the same.
|
587
|
+
|
588
|
+
The rebuild method has the following method signature:
|
589
|
+
|
590
|
+
def rebuild(image_ref, name, admin_pass=nil, metadata=nil, personality=nil)
|
591
|
+
|
592
|
+
A basic server build is as follows:
|
593
|
+
|
594
|
+
image = service.images.first
|
595
|
+
server.rebuild(image.id, name)
|
596
|
+
|
597
|
+
## Resize
|
598
|
+
|
599
|
+
Resizing a server allows you to change the resources dedicated to the server.
|
600
|
+
|
601
|
+
To resize a server:
|
602
|
+
|
603
|
+
flavor = service.flavor[2]
|
604
|
+
server.resize flavor.id
|
605
|
+
|
606
|
+
During the resize process the server will have a state of `RESIZE`. Once a server has completed resizing it will be in a `VERIFY_RESIZE` state.
|
607
|
+
|
608
|
+
You can use Fog's `wait_for` method to wait for this state as follows:
|
609
|
+
|
610
|
+
server.wait_for { server.status == 'VERIFY_RESIZE' }
|
611
|
+
|
612
|
+
|
613
|
+
In this case, `wait_for` is waiting for the server to become `VERIFY_READY` and will raise an exception if we enter an `ACTIVE` or `ERROR` state.
|
614
|
+
|
615
|
+
Once a server enters the `VERIFY_RESIZE` we will need to call `confirm_resize` to confirm the server was properly resized or `revert_resize` to rollback to the old size/flavor.
|
616
|
+
|
617
|
+
**Note:** A server will automatically confirm resize after 24 hours.
|
618
|
+
|
619
|
+
To confirm resize:
|
620
|
+
|
621
|
+
server.confirm_resize
|
622
|
+
|
623
|
+
To revert to previous size/flavor:
|
624
|
+
|
625
|
+
server.revert_resize
|
626
|
+
|
627
|
+
## Create Image
|
628
|
+
|
629
|
+
To create an image of your server:
|
630
|
+
|
631
|
+
response = server.create_image "back-image-#{server.name}", :metadata => { :environment => 'development' }
|
632
|
+
|
633
|
+
You can use the second parameter to specify image metadata. This is an optional parameter.`
|
634
|
+
|
635
|
+
During the imaging process, the image state will be `SAVING`. The image is ready for use when when state `ACTIVE` is reached. Fog can use `wait_for` to wait for an active state as follows:
|
636
|
+
|
637
|
+
image_id = response.body["image"]["id"]
|
638
|
+
image = service.images.get image_id
|
639
|
+
image.wait_for { ready? }
|
640
|
+
|
641
|
+
## List Attached Volumes
|
642
|
+
|
643
|
+
To list Cloud Block Volumes attached to server:
|
644
|
+
|
645
|
+
server.volume_attachments
|
646
|
+
|
647
|
+
## Attach Volume
|
648
|
+
|
649
|
+
To attach volume using the volume id:
|
650
|
+
|
651
|
+
server.attach_volume "0e7a706c-340d-48b3-802d-192850387f93", "/dev/xvdb"
|
652
|
+
|
653
|
+
If the volume id is unknown you can look it up as follows:
|
654
|
+
|
655
|
+
volume = service.volumes.first
|
656
|
+
server.attach_volume volume.id, "/dev/xvdb"
|
657
|
+
|
658
|
+
**Note** Valid device names are `/dev/xvd[a-p]`.
|
659
|
+
|
660
|
+
## Detach Volume
|
661
|
+
|
662
|
+
To detach a volume:
|
663
|
+
|
664
|
+
server.detach_volume volume.id
|
665
|
+
|
666
|
+
## Examples
|
667
|
+
|
668
|
+
Example code using Compute can be found [here](https://github.com/fog/fog/tree/master/lib/fog/openstack/examples/compute).
|
669
|
+
|
670
|
+
## Additional Resources
|
671
|
+
|
672
|
+
* [fog.io](http://fog.io/)
|
673
|
+
* [Fog rdoc](http://rubydoc.info/gems/fog/)
|
674
|
+
* [Fog Github repo](https://github.com/fog/fog)
|
675
|
+
* [Fog Github Issues](https://github.com/fog/fog/issues)
|
676
|
+
* [Excon Github repo](https://github.com/geemus/excon)
|
677
|
+
* [OpenStack Compute API](http://docs.openstack.org/api/openstack-compute/2/content/)
|
678
|
+
|
679
|
+
## Support and Feedback
|
680
|
+
|
681
|
+
Your feedback is appreciated! If you have specific issues with the **fog** SDK, you should file an [issue via Github](https://github.com/fog/fog/issues).
|