cifrado 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/.gitignore +18 -0
- data/CHANGELOG.md +44 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +247 -0
- data/RELEASE.md +10 -0
- data/Rakefile +21 -0
- data/TODO.md +6 -0
- data/bin/cifrado +7 -0
- data/cifrado.gemspec +31 -0
- data/gem-public_cert.pem +20 -0
- data/lib/cifrado.rb +48 -0
- data/lib/cifrado/cli.rb +140 -0
- data/lib/cifrado/cli/cinema.rb +81 -0
- data/lib/cifrado/cli/delete.rb +36 -0
- data/lib/cifrado/cli/download.rb +54 -0
- data/lib/cifrado/cli/jukebox.rb +94 -0
- data/lib/cifrado/cli/list.rb +64 -0
- data/lib/cifrado/cli/post.rb +10 -0
- data/lib/cifrado/cli/progressbar.rb +86 -0
- data/lib/cifrado/cli/saio.rb +11 -0
- data/lib/cifrado/cli/saio/base.rb +20 -0
- data/lib/cifrado/cli/saio/bootstrap.rb +118 -0
- data/lib/cifrado/cli/saio/destroy.rb +16 -0
- data/lib/cifrado/cli/saio/scripts/saio.sh.erb +445 -0
- data/lib/cifrado/cli/set_acl.rb +10 -0
- data/lib/cifrado/cli/setup.rb +64 -0
- data/lib/cifrado/cli/stat.rb +41 -0
- data/lib/cifrado/cli/upload.rb +269 -0
- data/lib/cifrado/config.rb +18 -0
- data/lib/cifrado/core_ext/ruby18_base64.rb +15 -0
- data/lib/cifrado/crypto_services.rb +218 -0
- data/lib/cifrado/file_splitter.rb +67 -0
- data/lib/cifrado/rate_limit.rb +23 -0
- data/lib/cifrado/streaming_downloader.rb +49 -0
- data/lib/cifrado/streaming_uploader.rb +57 -0
- data/lib/cifrado/swift_client.rb +313 -0
- data/lib/cifrado/utils.rb +59 -0
- data/lib/cifrado/version.rb +3 -0
- data/tests/cli/list_tests.rb +28 -0
- data/tests/cli/upload_multi_tests.rb +94 -0
- data/tests/cli/upload_tests.rb +167 -0
- data/tests/cli_tests.rb +2 -0
- data/tests/crypto_services_tests.rb +145 -0
- data/tests/file_splitter_tests.rb +61 -0
- data/tests/helper.rb +117 -0
- data/tests/swift_client/create_directory.rb +14 -0
- data/tests/swift_client/download_tests.rb +208 -0
- data/tests/swift_client/file_available.rb +25 -0
- data/tests/swift_client/head_tests.rb +34 -0
- data/tests/swift_client/match_tests.rb +29 -0
- data/tests/swift_client/upload_tests.rb +70 -0
- data/tests/swift_client_tests.rb +29 -0
- data/tests/utils_tests.rb +33 -0
- data/vendor/fog/.document +3 -0
- data/vendor/fog/.gitignore +23 -0
- data/vendor/fog/.irbrc +82 -0
- data/vendor/fog/.travis.yml +21 -0
- data/vendor/fog/README.cifrado +3 -0
- data/vendor/fog/README.md +156 -0
- data/vendor/fog/RELEASE.md +39 -0
- data/vendor/fog/changelog.txt +4156 -0
- data/vendor/fog/fog.gemspec +70 -0
- data/vendor/fog/lib/fog.rb +17 -0
- data/vendor/fog/lib/fog/cdn.rb +30 -0
- data/vendor/fog/lib/fog/compute.rb +127 -0
- data/vendor/fog/lib/fog/compute/models/server.rb +73 -0
- data/vendor/fog/lib/fog/core.rb +38 -0
- data/vendor/fog/lib/fog/core/attributes.rb +221 -0
- data/vendor/fog/lib/fog/core/collection.rb +145 -0
- data/vendor/fog/lib/fog/core/connection.rb +36 -0
- data/vendor/fog/lib/fog/core/credentials.rb +65 -0
- data/vendor/fog/lib/fog/core/current_machine.rb +34 -0
- data/vendor/fog/lib/fog/core/deprecated_connection_accessors.rb +41 -0
- data/vendor/fog/lib/fog/core/deprecation.rb +23 -0
- data/vendor/fog/lib/fog/core/errors.rb +108 -0
- data/vendor/fog/lib/fog/core/hmac.rb +48 -0
- data/vendor/fog/lib/fog/core/json.rb +34 -0
- data/vendor/fog/lib/fog/core/logger.rb +45 -0
- data/vendor/fog/lib/fog/core/mock.rb +92 -0
- data/vendor/fog/lib/fog/core/model.rb +79 -0
- data/vendor/fog/lib/fog/core/parser.rb +116 -0
- data/vendor/fog/lib/fog/core/provider.rb +35 -0
- data/vendor/fog/lib/fog/core/scp.rb +96 -0
- data/vendor/fog/lib/fog/core/service.rb +223 -0
- data/vendor/fog/lib/fog/core/ssh.rb +137 -0
- data/vendor/fog/lib/fog/core/time.rb +32 -0
- data/vendor/fog/lib/fog/core/timeout.rb +11 -0
- data/vendor/fog/lib/fog/core/wait_for.rb +15 -0
- data/vendor/fog/lib/fog/digitalocean.rb +9 -0
- data/vendor/fog/lib/fog/digitalocean/compute.rb +100 -0
- data/vendor/fog/lib/fog/digitalocean/examples/getting_started.md +106 -0
- data/vendor/fog/lib/fog/digitalocean/models/compute/flavor.rb +14 -0
- data/vendor/fog/lib/fog/digitalocean/models/compute/flavors.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/models/compute/image.rb +15 -0
- data/vendor/fog/lib/fog/digitalocean/models/compute/images.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/models/compute/region.rb +14 -0
- data/vendor/fog/lib/fog/digitalocean/models/compute/regions.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/models/compute/server.rb +150 -0
- data/vendor/fog/lib/fog/digitalocean/models/compute/servers.rb +27 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/create_server.rb +49 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/create_ssh_key.rb +26 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/destroy_server.rb +28 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/get_server_details.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/list_flavors.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/list_images.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/list_regions.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/list_servers.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/list_ssh_keys.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/power_cycle_server.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/power_off_server.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/power_on_server.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/reboot_server.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/shutdown_server.rb +25 -0
- data/vendor/fog/lib/fog/dns.rb +59 -0
- data/vendor/fog/lib/fog/identity.rb +27 -0
- data/vendor/fog/lib/fog/image.rb +24 -0
- data/vendor/fog/lib/fog/local.rb +11 -0
- data/vendor/fog/lib/fog/local/models/storage/directories.rb +33 -0
- data/vendor/fog/lib/fog/local/models/storage/directory.rb +57 -0
- data/vendor/fog/lib/fog/local/models/storage/file.rb +131 -0
- data/vendor/fog/lib/fog/local/models/storage/files.rb +87 -0
- data/vendor/fog/lib/fog/local/storage.rb +103 -0
- data/vendor/fog/lib/fog/network.rb +26 -0
- data/vendor/fog/lib/fog/openstack.rb +214 -0
- data/vendor/fog/lib/fog/openstack/README.identity.md +69 -0
- data/vendor/fog/lib/fog/openstack/compute.rb +423 -0
- data/vendor/fog/lib/fog/openstack/identity.rb +299 -0
- data/vendor/fog/lib/fog/openstack/image.rb +217 -0
- data/vendor/fog/lib/fog/openstack/models/compute/address.rb +71 -0
- data/vendor/fog/lib/fog/openstack/models/compute/addresses.rb +33 -0
- data/vendor/fog/lib/fog/openstack/models/compute/flavor.rb +45 -0
- data/vendor/fog/lib/fog/openstack/models/compute/flavors.rb +28 -0
- data/vendor/fog/lib/fog/openstack/models/compute/host.rb +29 -0
- data/vendor/fog/lib/fog/openstack/models/compute/hosts.rb +32 -0
- data/vendor/fog/lib/fog/openstack/models/compute/image.rb +58 -0
- data/vendor/fog/lib/fog/openstack/models/compute/images.rb +33 -0
- data/vendor/fog/lib/fog/openstack/models/compute/key_pair.rb +60 -0
- data/vendor/fog/lib/fog/openstack/models/compute/key_pairs.rb +31 -0
- data/vendor/fog/lib/fog/openstack/models/compute/metadata.rb +68 -0
- data/vendor/fog/lib/fog/openstack/models/compute/metadatum.rb +29 -0
- data/vendor/fog/lib/fog/openstack/models/compute/network.rb +13 -0
- data/vendor/fog/lib/fog/openstack/models/compute/networks.rb +29 -0
- data/vendor/fog/lib/fog/openstack/models/compute/security_group.rb +44 -0
- data/vendor/fog/lib/fog/openstack/models/compute/security_groups.rb +27 -0
- data/vendor/fog/lib/fog/openstack/models/compute/server.rb +278 -0
- data/vendor/fog/lib/fog/openstack/models/compute/servers.rb +44 -0
- data/vendor/fog/lib/fog/openstack/models/compute/snapshot.rb +44 -0
- data/vendor/fog/lib/fog/openstack/models/compute/snapshots.rb +26 -0
- data/vendor/fog/lib/fog/openstack/models/compute/tenant.rb +24 -0
- data/vendor/fog/lib/fog/openstack/models/compute/tenants.rb +24 -0
- data/vendor/fog/lib/fog/openstack/models/compute/volume.rb +59 -0
- data/vendor/fog/lib/fog/openstack/models/compute/volumes.rb +26 -0
- data/vendor/fog/lib/fog/openstack/models/identity/ec2_credential.rb +44 -0
- data/vendor/fog/lib/fog/openstack/models/identity/ec2_credentials.rb +53 -0
- data/vendor/fog/lib/fog/openstack/models/identity/role.rb +50 -0
- data/vendor/fog/lib/fog/openstack/models/identity/roles.rb +21 -0
- data/vendor/fog/lib/fog/openstack/models/identity/tenant.rb +62 -0
- data/vendor/fog/lib/fog/openstack/models/identity/tenants.rb +29 -0
- data/vendor/fog/lib/fog/openstack/models/identity/user.rb +70 -0
- data/vendor/fog/lib/fog/openstack/models/identity/users.rb +32 -0
- data/vendor/fog/lib/fog/openstack/models/image/image.rb +91 -0
- data/vendor/fog/lib/fog/openstack/models/image/images.rb +60 -0
- data/vendor/fog/lib/fog/openstack/models/meta_parent.rb +33 -0
- data/vendor/fog/lib/fog/openstack/models/network/floating_ip.rb +52 -0
- data/vendor/fog/lib/fog/openstack/models/network/floating_ips.rb +34 -0
- data/vendor/fog/lib/fog/openstack/models/network/network.rb +47 -0
- data/vendor/fog/lib/fog/openstack/models/network/networks.rb +34 -0
- data/vendor/fog/lib/fog/openstack/models/network/port.rb +53 -0
- data/vendor/fog/lib/fog/openstack/models/network/ports.rb +34 -0
- data/vendor/fog/lib/fog/openstack/models/network/subnet.rb +56 -0
- data/vendor/fog/lib/fog/openstack/models/network/subnets.rb +34 -0
- data/vendor/fog/lib/fog/openstack/models/storage/directories.rb +39 -0
- data/vendor/fog/lib/fog/openstack/models/storage/directory.rb +50 -0
- data/vendor/fog/lib/fog/openstack/models/storage/file.rb +152 -0
- data/vendor/fog/lib/fog/openstack/models/storage/files.rb +94 -0
- data/vendor/fog/lib/fog/openstack/models/volume/volume.rb +47 -0
- data/vendor/fog/lib/fog/openstack/models/volume/volumes.rb +27 -0
- data/vendor/fog/lib/fog/openstack/network.rb +247 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/add_fixed_ip.rb +29 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/allocate_address.rb +42 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/associate_address.rb +27 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/attach_volume.rb +38 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/boot_from_snapshot.rb +41 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/change_server_password.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/confirm_resize_server.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/create_flavor.rb +85 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/create_image.rb +49 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/create_key_pair.rb +49 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/create_security_group.rb +52 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/create_security_group_rule.rb +59 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/create_server.rb +131 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/create_volume.rb +54 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/create_volume_snapshot.rb +47 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/delete_flavor.rb +28 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/delete_image.rb +40 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/delete_key_pair.rb +31 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/delete_metadata.rb +28 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/delete_security_group.rb +33 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/delete_security_group_rule.rb +31 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/delete_server.rb +38 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/delete_snapshot.rb +26 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/delete_volume.rb +26 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/detach_volume.rb +26 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/disassociate_address.rb +27 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_address.rb +41 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_console_output.rb +28 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_flavor_details.rb +43 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_host_details.rb +74 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_image_details.rb +33 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_limits.rb +93 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_metadata.rb +29 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_quota.rb +31 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_quota_defaults.rb +31 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_security_group.rb +49 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_server_details.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_server_volumes.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_snapshot_details.rb +39 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_usage.rb +53 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_vnc_console.rb +40 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_volume_details.rb +42 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_address_pools.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_addresses.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_all_addresses.rb +64 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_flavors.rb +38 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_flavors_detail.rb +38 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_hosts.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_images.rb +33 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_images_detail.rb +39 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_key_pairs.rb +39 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_metadata.rb +28 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_private_addresses.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_public_addresses.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_security_groups.rb +50 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_servers.rb +37 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_servers_detail.rb +44 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_snapshots.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_tenants.rb +45 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_usages.rb +43 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_volumes.rb +51 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/live_migrate_server.rb +31 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/migrate_server.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/pause_server.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/reboot_server.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/rebuild_server.rb +31 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/release_address.rb +34 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/remove_fixed_ip.rb +29 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/rescue_server.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/reset_server_state.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/resize_server.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/resume_server.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/revert_resize_server.rb +30 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/server_action.rb +18 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/server_actions.rb +27 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/server_diagnostics.rb +25 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/set_metadata.rb +45 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/set_tenant.rb +21 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/suspend_server.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/unpause_server.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/update_metadata.rb +46 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/update_quota.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/update_server.rb +35 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/add_user_to_tenant.rb +34 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/check_token.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/create_ec2_credential.rb +58 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/create_role.rb +37 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/create_tenant.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/create_user.rb +47 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/create_user_role.rb +26 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/delete_ec2_credential.rb +44 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/delete_role.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/delete_tenant.rb +31 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/delete_user.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/delete_user_role.rb +26 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/get_ec2_credential.rb +49 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/get_role.rb +28 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/get_tenant.rb +31 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/get_tenants_by_id.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/get_tenants_by_name.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/get_user_by_id.rb +34 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/get_user_by_name.rb +31 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/list_ec2_credentials.rb +44 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/list_endpoints_for_token.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/list_roles.rb +36 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/list_roles_for_user_on_tenant.rb +30 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/list_tenants.rb +45 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/list_user_global_roles.rb +22 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/list_users.rb +34 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/remove_user_from_tenant.rb +20 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/set_tenant.rb +21 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/update_tenant.rb +28 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/update_user.rb +36 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/validate_token.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/image/add_member_to_image.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/image/create_image.rb +79 -0
- data/vendor/fog/lib/fog/openstack/requests/image/delete_image.rb +25 -0
- data/vendor/fog/lib/fog/openstack/requests/image/get_image.rb +45 -0
- data/vendor/fog/lib/fog/openstack/requests/image/get_image_by_id.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/image/get_image_members.rb +29 -0
- data/vendor/fog/lib/fog/openstack/requests/image/get_shared_images.rb +29 -0
- data/vendor/fog/lib/fog/openstack/requests/image/list_public_images.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/image/list_public_images_detailed.rb +31 -0
- data/vendor/fog/lib/fog/openstack/requests/image/remove_member_from_image.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/image/set_tenant.rb +21 -0
- data/vendor/fog/lib/fog/openstack/requests/image/update_image.rb +70 -0
- data/vendor/fog/lib/fog/openstack/requests/image/update_image_members.rb +37 -0
- data/vendor/fog/lib/fog/openstack/requests/network/associate_floating_ip.rb +49 -0
- data/vendor/fog/lib/fog/openstack/requests/network/create_floating_ip.rb +50 -0
- data/vendor/fog/lib/fog/openstack/requests/network/create_network.rb +44 -0
- data/vendor/fog/lib/fog/openstack/requests/network/create_port.rb +52 -0
- data/vendor/fog/lib/fog/openstack/requests/network/create_subnet.rb +56 -0
- data/vendor/fog/lib/fog/openstack/requests/network/delete_floating_ip.rb +30 -0
- data/vendor/fog/lib/fog/openstack/requests/network/delete_network.rb +30 -0
- data/vendor/fog/lib/fog/openstack/requests/network/delete_port.rb +30 -0
- data/vendor/fog/lib/fog/openstack/requests/network/delete_subnet.rb +30 -0
- data/vendor/fog/lib/fog/openstack/requests/network/disassociate_floating_ip.rb +49 -0
- data/vendor/fog/lib/fog/openstack/requests/network/get_floating_ip.rb +42 -0
- data/vendor/fog/lib/fog/openstack/requests/network/get_network.rb +42 -0
- data/vendor/fog/lib/fog/openstack/requests/network/get_port.rb +48 -0
- data/vendor/fog/lib/fog/openstack/requests/network/get_subnet.rb +49 -0
- data/vendor/fog/lib/fog/openstack/requests/network/list_floating_ips.rb +27 -0
- data/vendor/fog/lib/fog/openstack/requests/network/list_networks.rb +27 -0
- data/vendor/fog/lib/fog/openstack/requests/network/list_ports.rb +27 -0
- data/vendor/fog/lib/fog/openstack/requests/network/list_subnets.rb +27 -0
- data/vendor/fog/lib/fog/openstack/requests/network/set_tenant.rb +21 -0
- data/vendor/fog/lib/fog/openstack/requests/network/update_network.rb +41 -0
- data/vendor/fog/lib/fog/openstack/requests/network/update_port.rb +44 -0
- data/vendor/fog/lib/fog/openstack/requests/network/update_subnet.rb +44 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/copy_object.rb +27 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/delete_container.rb +22 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/delete_object.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/get_container.rb +44 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/get_containers.rb +33 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/get_object.rb +29 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/get_object_https_url.rb +51 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/head_container.rb +28 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/head_containers.rb +25 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/head_object.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/post_set_meta_temp_url_key.rb +37 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/put_container.rb +22 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/put_object.rb +30 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/put_object_manifest.rb +25 -0
- data/vendor/fog/lib/fog/openstack/requests/volume/create_volume.rb +54 -0
- data/vendor/fog/lib/fog/openstack/requests/volume/create_volume_snapshot.rb +47 -0
- data/vendor/fog/lib/fog/openstack/requests/volume/delete_snapshot.rb +26 -0
- data/vendor/fog/lib/fog/openstack/requests/volume/delete_volume.rb +26 -0
- data/vendor/fog/lib/fog/openstack/requests/volume/get_snapshot_details.rb +39 -0
- data/vendor/fog/lib/fog/openstack/requests/volume/get_volume_details.rb +42 -0
- data/vendor/fog/lib/fog/openstack/requests/volume/list_snapshots.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/volume/list_volumes.rb +55 -0
- data/vendor/fog/lib/fog/openstack/requests/volume/set_tenant.rb +21 -0
- data/vendor/fog/lib/fog/openstack/storage.rb +162 -0
- data/vendor/fog/lib/fog/openstack/volume.rb +219 -0
- data/vendor/fog/lib/fog/providers.rb +2 -0
- data/vendor/fog/lib/fog/schema/data_validator.rb +154 -0
- data/vendor/fog/lib/fog/storage.rb +97 -0
- data/vendor/fog/lib/fog/version.rb +3 -0
- data/vendor/fog/lib/fog/volume.rb +25 -0
- metadata +576 -0
- metadata.gz.sig +0 -0
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'fog/core/model'
|
2
|
+
require 'fog/openstack/models/meta_parent'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Compute
|
6
|
+
class OpenStack
|
7
|
+
class Metadatum < Fog::Model
|
8
|
+
|
9
|
+
include Fog::Compute::OpenStack::MetaParent
|
10
|
+
|
11
|
+
identity :key
|
12
|
+
attribute :value
|
13
|
+
|
14
|
+
def destroy
|
15
|
+
requires :identity
|
16
|
+
service.delete_meta(collection_name, @parent.id, key)
|
17
|
+
true
|
18
|
+
end
|
19
|
+
|
20
|
+
def save
|
21
|
+
requires :identity, :value
|
22
|
+
service.update_meta(collection_name, @parent.id, key, value)
|
23
|
+
true
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/openstack/models/compute/network'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Compute
|
6
|
+
class OpenStack
|
7
|
+
class Networks < Fog::Collection
|
8
|
+
model Fog::Compute::OpenStack::Network
|
9
|
+
|
10
|
+
attribute :server
|
11
|
+
|
12
|
+
def all
|
13
|
+
requires :server
|
14
|
+
|
15
|
+
networks = Array.new
|
16
|
+
server.addresses.each_with_index do |address, index|
|
17
|
+
networks << {
|
18
|
+
:id => index + 1,
|
19
|
+
:name => address[0],
|
20
|
+
:addresses => address[1].map {|a| a['addr'] }
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
load(networks)
|
25
|
+
end
|
26
|
+
end # class Networks
|
27
|
+
end # class OpenStack
|
28
|
+
end # module Compute
|
29
|
+
end # module Fog
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'fog/core/model'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Compute
|
5
|
+
class OpenStack
|
6
|
+
|
7
|
+
class SecurityGroup < Fog::Model
|
8
|
+
|
9
|
+
identity :id
|
10
|
+
|
11
|
+
attribute :name
|
12
|
+
attribute :description
|
13
|
+
attribute :rules
|
14
|
+
attribute :tenant_id
|
15
|
+
|
16
|
+
|
17
|
+
def save
|
18
|
+
requires :name, :description
|
19
|
+
data = service.create_security_group(name, description)
|
20
|
+
merge_attributes(data.body['security_group'])
|
21
|
+
true
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
def destroy
|
26
|
+
requires :id
|
27
|
+
service.delete_security_group(id)
|
28
|
+
true
|
29
|
+
end
|
30
|
+
|
31
|
+
def create_security_group_rule(min, max, ip_protocol = "tcp", cidr = "0.0.0.0/0", group_id = nil)
|
32
|
+
requires :id
|
33
|
+
service.create_security_group_rule(id, ip_protocol, min, max, cidr, group_id)
|
34
|
+
end
|
35
|
+
|
36
|
+
def delete_security_group_rule(rule_id)
|
37
|
+
service.delete_security_group_rule(rule_id)
|
38
|
+
true
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/openstack/models/compute/security_group'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Compute
|
6
|
+
class OpenStack
|
7
|
+
|
8
|
+
class SecurityGroups < Fog::Collection
|
9
|
+
|
10
|
+
model Fog::Compute::OpenStack::SecurityGroup
|
11
|
+
|
12
|
+
def all
|
13
|
+
load(service.list_security_groups.body['security_groups'])
|
14
|
+
end
|
15
|
+
|
16
|
+
def get(security_group_id)
|
17
|
+
if security_group_id
|
18
|
+
new(service.get_security_group(security_group_id).body['security_group'])
|
19
|
+
end
|
20
|
+
rescue Fog::Compute::OpenStack::NotFound
|
21
|
+
nil
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,278 @@
|
|
1
|
+
require 'fog/compute/models/server'
|
2
|
+
require 'fog/openstack/models/compute/metadata'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Compute
|
6
|
+
class OpenStack
|
7
|
+
|
8
|
+
class Server < Fog::Compute::Server
|
9
|
+
|
10
|
+
identity :id
|
11
|
+
attribute :instance_name, :aliases => 'OS-EXT-SRV-ATTR:instance_name'
|
12
|
+
|
13
|
+
attribute :addresses
|
14
|
+
attribute :flavor
|
15
|
+
attribute :host_id, :aliases => 'hostId'
|
16
|
+
attribute :image
|
17
|
+
attribute :metadata
|
18
|
+
attribute :links
|
19
|
+
attribute :name
|
20
|
+
attribute :personality
|
21
|
+
attribute :progress
|
22
|
+
attribute :accessIPv4
|
23
|
+
attribute :accessIPv6
|
24
|
+
attribute :availability_zone
|
25
|
+
attribute :user_data_encoded
|
26
|
+
attribute :state, :aliases => 'status'
|
27
|
+
attribute :created, :type => :time
|
28
|
+
attribute :updated, :type => :time
|
29
|
+
|
30
|
+
attribute :tenant_id
|
31
|
+
attribute :user_id
|
32
|
+
attribute :key_name
|
33
|
+
attribute :fault
|
34
|
+
attribute :os_dcf_disk_config, :aliases => 'OS-DCF:diskConfig'
|
35
|
+
attribute :os_ext_srv_attr_host, :aliases => 'OS-EXT-SRV-ATTR:host'
|
36
|
+
attribute :os_ext_srv_attr_hypervisor_hostname, :aliases => 'OS-EXT-SRV-ATTR:hypervisor_hostname'
|
37
|
+
attribute :os_ext_srv_attr_instance_name, :aliases => 'OS-EXT-SRV-ATTR:instance_name'
|
38
|
+
attribute :os_ext_sts_power_state, :aliases => 'OS-EXT-STS:power_state'
|
39
|
+
attribute :os_ext_sts_task_state, :aliases => 'OS-EXT-STS:task_state'
|
40
|
+
attribute :os_ext_sts_vm_state, :aliases => 'OS-EXT-STS:vm_state'
|
41
|
+
|
42
|
+
attr_reader :password
|
43
|
+
attr_writer :image_ref, :flavor_ref, :os_scheduler_hints
|
44
|
+
|
45
|
+
|
46
|
+
def initialize(attributes={})
|
47
|
+
# Old 'connection' is renamed as service and should be used instead
|
48
|
+
prepare_service_value(attributes)
|
49
|
+
attributes[:metadata] = {}
|
50
|
+
|
51
|
+
self.security_groups = attributes.delete(:security_groups)
|
52
|
+
self.min_count = attributes.delete(:min_count)
|
53
|
+
self.max_count = attributes.delete(:max_count)
|
54
|
+
self.os_scheduler_hints = attributes.delete(:os_scheduler_hints)
|
55
|
+
|
56
|
+
super
|
57
|
+
end
|
58
|
+
|
59
|
+
def metadata
|
60
|
+
@metadata ||= begin
|
61
|
+
Fog::Compute::OpenStack::Metadata.new({
|
62
|
+
:service => service,
|
63
|
+
:parent => self
|
64
|
+
})
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def metadata=(new_metadata={})
|
69
|
+
metas = []
|
70
|
+
new_metadata.each_pair {|k,v| metas << {"key" => k, "value" => v} }
|
71
|
+
metadata.load(metas)
|
72
|
+
end
|
73
|
+
|
74
|
+
def user_data=(ascii_userdata)
|
75
|
+
self.user_data_encoded = [ascii_userdata].pack('m')
|
76
|
+
end
|
77
|
+
|
78
|
+
def destroy
|
79
|
+
requires :id
|
80
|
+
service.delete_server(id)
|
81
|
+
true
|
82
|
+
end
|
83
|
+
|
84
|
+
def images
|
85
|
+
requires :id
|
86
|
+
service.images(:server => self)
|
87
|
+
end
|
88
|
+
|
89
|
+
def private_ip_address
|
90
|
+
if addresses['private']
|
91
|
+
#assume only a single private
|
92
|
+
return addresses['private'].first
|
93
|
+
elsif addresses['internet']
|
94
|
+
#assume no private IP means private cloud
|
95
|
+
return addresses['internet'].first
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
def public_ip_address
|
100
|
+
if addresses['public']
|
101
|
+
#assume last is either original or assigned from floating IPs
|
102
|
+
return addresses['public'].last
|
103
|
+
elsif addresses['internet']
|
104
|
+
#assume no public IP means private cloud
|
105
|
+
return addresses['internet'].first
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
def image_ref
|
110
|
+
@image_ref
|
111
|
+
end
|
112
|
+
|
113
|
+
def image_ref=(new_image_ref)
|
114
|
+
@image_ref = new_image_ref
|
115
|
+
end
|
116
|
+
|
117
|
+
def flavor_ref
|
118
|
+
@flavor_ref
|
119
|
+
end
|
120
|
+
|
121
|
+
def flavor_ref=(new_flavor_ref)
|
122
|
+
@flavor_ref = new_flavor_ref
|
123
|
+
end
|
124
|
+
|
125
|
+
def ready?
|
126
|
+
self.state == 'ACTIVE'
|
127
|
+
end
|
128
|
+
|
129
|
+
def change_password(admin_password)
|
130
|
+
requires :id
|
131
|
+
service.change_server_password(id, admin_password)
|
132
|
+
true
|
133
|
+
end
|
134
|
+
|
135
|
+
def rebuild(image_ref, name, admin_pass=nil, metadata=nil, personality=nil)
|
136
|
+
requires :id
|
137
|
+
service.rebuild_server(id, image_ref, name, admin_pass, metadata, personality)
|
138
|
+
true
|
139
|
+
end
|
140
|
+
|
141
|
+
def resize(flavor_ref)
|
142
|
+
requires :id
|
143
|
+
service.resize_server(id, flavor_ref)
|
144
|
+
true
|
145
|
+
end
|
146
|
+
|
147
|
+
def revert_resize
|
148
|
+
requires :id
|
149
|
+
service.revert_resize_server(id)
|
150
|
+
true
|
151
|
+
end
|
152
|
+
|
153
|
+
def confirm_resize
|
154
|
+
requires :id
|
155
|
+
service.confirm_resize_server(id)
|
156
|
+
true
|
157
|
+
end
|
158
|
+
|
159
|
+
def security_groups
|
160
|
+
requires :id
|
161
|
+
|
162
|
+
groups = service.list_security_groups(id).body['security_groups']
|
163
|
+
|
164
|
+
groups.map do |group|
|
165
|
+
sg = Fog::Compute::OpenStack::SecurityGroup.new group
|
166
|
+
sg.connection = service
|
167
|
+
sg
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
def security_groups=(new_security_groups)
|
172
|
+
@security_groups = new_security_groups
|
173
|
+
end
|
174
|
+
|
175
|
+
def reboot(type = 'SOFT')
|
176
|
+
requires :id
|
177
|
+
service.reboot_server(id, type)
|
178
|
+
true
|
179
|
+
end
|
180
|
+
|
181
|
+
def create_image(name, metadata={})
|
182
|
+
requires :id
|
183
|
+
service.create_image(id, name, metadata)
|
184
|
+
end
|
185
|
+
|
186
|
+
def console(log_length = nil)
|
187
|
+
requires :id
|
188
|
+
service.get_console_output(id, log_length)
|
189
|
+
end
|
190
|
+
|
191
|
+
def migrate
|
192
|
+
requires :id
|
193
|
+
service.migrate_server(id)
|
194
|
+
end
|
195
|
+
|
196
|
+
def live_migrate(host, block_migration, disk_over_commit)
|
197
|
+
requires :id
|
198
|
+
service.live_migrate_server(id, host, block_migration, disk_over_commit)
|
199
|
+
end
|
200
|
+
|
201
|
+
def associate_address(floating_ip)
|
202
|
+
requires :id
|
203
|
+
service.associate_address id, floating_ip
|
204
|
+
end
|
205
|
+
|
206
|
+
def disassociate_address(floating_ip)
|
207
|
+
requires :id
|
208
|
+
service.disassociate_address id, floating_ip
|
209
|
+
end
|
210
|
+
|
211
|
+
def reset_vm_state(vm_state)
|
212
|
+
requires :id
|
213
|
+
service.reset_server_state id, vm_state
|
214
|
+
end
|
215
|
+
|
216
|
+
def min_count=(new_min_count)
|
217
|
+
@min_count = new_min_count
|
218
|
+
end
|
219
|
+
|
220
|
+
def max_count=(new_max_count)
|
221
|
+
@max_count = new_max_count
|
222
|
+
end
|
223
|
+
|
224
|
+
def networks
|
225
|
+
service.networks(:server => self)
|
226
|
+
end
|
227
|
+
|
228
|
+
# TODO: Implement /os-volumes-boot support with 'block_device_mapping'
|
229
|
+
def save
|
230
|
+
raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
|
231
|
+
requires :flavor_ref, :image_ref, :name
|
232
|
+
meta_hash = {}
|
233
|
+
metadata.each { |meta| meta_hash.store(meta.key, meta.value) }
|
234
|
+
options = {
|
235
|
+
'metadata' => meta_hash,
|
236
|
+
'personality' => personality,
|
237
|
+
'accessIPv4' => accessIPv4,
|
238
|
+
'accessIPv6' => accessIPv6,
|
239
|
+
'availability_zone' => availability_zone,
|
240
|
+
'user_data' => user_data_encoded,
|
241
|
+
'key_name' => key_name,
|
242
|
+
'security_groups' => @security_groups,
|
243
|
+
'min_count' => @min_count,
|
244
|
+
'max_count' => @max_count,
|
245
|
+
'os:scheduler_hints' => @os_scheduler_hints
|
246
|
+
}
|
247
|
+
options = options.reject {|key, value| value.nil?}
|
248
|
+
data = service.create_server(name, image_ref, flavor_ref, options)
|
249
|
+
merge_attributes(data.body['server'])
|
250
|
+
true
|
251
|
+
end
|
252
|
+
|
253
|
+
def setup(credentials = {})
|
254
|
+
requires :public_ip_address, :identity, :public_key, :username
|
255
|
+
Fog::SSH.new(public_ip_address, username, credentials).run([
|
256
|
+
%{mkdir .ssh},
|
257
|
+
%{echo "#{public_key}" >> ~/.ssh/authorized_keys},
|
258
|
+
%{passwd -l #{username}},
|
259
|
+
%{echo "#{Fog::JSON.encode(attributes)}" >> ~/attributes.json},
|
260
|
+
%{echo "#{Fog::JSON.encode(metadata)}" >> ~/metadata.json}
|
261
|
+
])
|
262
|
+
rescue Errno::ECONNREFUSED
|
263
|
+
sleep(1)
|
264
|
+
retry
|
265
|
+
end
|
266
|
+
|
267
|
+
private
|
268
|
+
|
269
|
+
def adminPass=(new_admin_pass)
|
270
|
+
@password = new_admin_pass
|
271
|
+
end
|
272
|
+
|
273
|
+
end
|
274
|
+
|
275
|
+
end
|
276
|
+
end
|
277
|
+
|
278
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/openstack/models/compute/server'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Compute
|
6
|
+
class OpenStack
|
7
|
+
|
8
|
+
class Servers < Fog::Collection
|
9
|
+
|
10
|
+
attribute :filters
|
11
|
+
|
12
|
+
model Fog::Compute::OpenStack::Server
|
13
|
+
|
14
|
+
def initialize(attributes)
|
15
|
+
self.filters ||= {}
|
16
|
+
super
|
17
|
+
end
|
18
|
+
|
19
|
+
def all(filters = filters)
|
20
|
+
self.filters = filters
|
21
|
+
data = service.list_servers_detail(filters).body['servers']
|
22
|
+
load(data)
|
23
|
+
end
|
24
|
+
|
25
|
+
def bootstrap(new_attributes = {})
|
26
|
+
server = create(new_attributes)
|
27
|
+
server.wait_for { ready? }
|
28
|
+
server.setup(:password => server.password)
|
29
|
+
server
|
30
|
+
end
|
31
|
+
|
32
|
+
def get(server_id)
|
33
|
+
if server = service.get_server_details(server_id).body['server']
|
34
|
+
new(server)
|
35
|
+
end
|
36
|
+
rescue Fog::Compute::OpenStack::NotFound
|
37
|
+
nil
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|