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,27 @@
|
|
1
|
+
module Fog
|
2
|
+
module Identity
|
3
|
+
|
4
|
+
def self.[](provider)
|
5
|
+
self.new(:provider => provider)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.new(attributes)
|
9
|
+
attributes = attributes.dup # Prevent delete from having side effects
|
10
|
+
case provider = attributes.delete(:provider).to_s.downcase.to_sym
|
11
|
+
when :rackspace
|
12
|
+
require 'fog/rackspace/identity'
|
13
|
+
Fog::Rackspace::Identity.new(attributes)
|
14
|
+
when :openstack
|
15
|
+
require 'fog/openstack/identity'
|
16
|
+
Fog::Identity::OpenStack.new(attributes)
|
17
|
+
else
|
18
|
+
raise ArgumentError.new("#{provider} has no identity service")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.providers
|
23
|
+
Fog.services[:idenity]
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Fog
|
2
|
+
module Image
|
3
|
+
|
4
|
+
def self.[](provider)
|
5
|
+
self.new(:provider => provider)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.new(attributes)
|
9
|
+
attributes = attributes.dup # Prevent delete from having side effects
|
10
|
+
case provider = attributes.delete(:provider).to_s.downcase.to_sym
|
11
|
+
when :openstack
|
12
|
+
require 'fog/openstack/image'
|
13
|
+
Fog::Image::OpenStack.new(attributes)
|
14
|
+
else
|
15
|
+
raise ArgumentError.new("#{provider} has no identity service")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.providers
|
20
|
+
Fog.services[:image]
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/local/models/storage/directory'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Storage
|
6
|
+
class Local
|
7
|
+
|
8
|
+
class Directories < Fog::Collection
|
9
|
+
|
10
|
+
model Fog::Storage::Local::Directory
|
11
|
+
|
12
|
+
def all
|
13
|
+
data = Dir.entries(service.local_root).select do |entry|
|
14
|
+
entry[0...1] != '.' && ::File.directory?(service.path_to(entry))
|
15
|
+
end.map do |entry|
|
16
|
+
{:key => entry}
|
17
|
+
end
|
18
|
+
load(data)
|
19
|
+
end
|
20
|
+
|
21
|
+
def get(key)
|
22
|
+
if ::File.directory?(service.path_to(key))
|
23
|
+
new(:key => key)
|
24
|
+
else
|
25
|
+
nil
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'fog/core/model'
|
2
|
+
require 'fog/local/models/storage/files'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Storage
|
6
|
+
class Local
|
7
|
+
|
8
|
+
class Directory < Fog::Model
|
9
|
+
|
10
|
+
identity :key
|
11
|
+
|
12
|
+
def destroy
|
13
|
+
requires :key
|
14
|
+
|
15
|
+
if ::File.directory?(path)
|
16
|
+
Dir.rmdir(path)
|
17
|
+
true
|
18
|
+
else
|
19
|
+
false
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def files
|
24
|
+
@files ||= begin
|
25
|
+
Fog::Storage::Local::Files.new(
|
26
|
+
:directory => self,
|
27
|
+
:service => service
|
28
|
+
)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def public=(new_public)
|
33
|
+
new_public
|
34
|
+
end
|
35
|
+
|
36
|
+
def public_url
|
37
|
+
nil
|
38
|
+
end
|
39
|
+
|
40
|
+
def save
|
41
|
+
requires :key
|
42
|
+
|
43
|
+
FileUtils.mkpath(path)
|
44
|
+
true
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def path
|
50
|
+
service.path_to(key)
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,131 @@
|
|
1
|
+
require 'fog/core/model'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Storage
|
5
|
+
class Local
|
6
|
+
|
7
|
+
class File < Fog::Model
|
8
|
+
|
9
|
+
identity :key, :aliases => 'Key'
|
10
|
+
|
11
|
+
attribute :content_length, :aliases => 'Content-Length', :type => :integer
|
12
|
+
# attribute :content_type, :aliases => 'Content-Type'
|
13
|
+
attribute :last_modified, :aliases => 'Last-Modified'
|
14
|
+
|
15
|
+
require 'uri'
|
16
|
+
|
17
|
+
def body
|
18
|
+
attributes[:body] ||= if last_modified
|
19
|
+
collection.get(identity).body
|
20
|
+
else
|
21
|
+
''
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def body=(new_body)
|
26
|
+
attributes[:body] = new_body
|
27
|
+
end
|
28
|
+
|
29
|
+
def content_type
|
30
|
+
@content_type ||= begin
|
31
|
+
unless (mime_types = ::MIME::Types.of(key)).empty?
|
32
|
+
mime_types.first.content_type
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def directory
|
38
|
+
@directory
|
39
|
+
end
|
40
|
+
|
41
|
+
def copy(target_directory_key, target_file_key, options={})
|
42
|
+
requires :directory, :key
|
43
|
+
service.copy_object(directory.key, key, target_directory_key, target_file_key)
|
44
|
+
target_directory = service.directories.new(:key => target_directory_key)
|
45
|
+
target_directory.files.get(target_file_key)
|
46
|
+
end
|
47
|
+
|
48
|
+
def destroy
|
49
|
+
requires :directory, :key
|
50
|
+
::File.delete(path) if ::File.exists?(path)
|
51
|
+
dirs = path.split(::File::SEPARATOR)[0...-1]
|
52
|
+
dirs.length.times do |index|
|
53
|
+
dir_path = dirs[0..-index].join(::File::SEPARATOR)
|
54
|
+
if dir_path.empty? # path starts with ::File::SEPARATOR
|
55
|
+
next
|
56
|
+
end
|
57
|
+
# don't delete the containing directory or higher
|
58
|
+
if dir_path == service.path_to(directory.key)
|
59
|
+
break
|
60
|
+
end
|
61
|
+
pwd = Dir.pwd
|
62
|
+
if ::File.exists?(dir_path) && ::File.directory?(dir_path)
|
63
|
+
Dir.chdir(dir_path)
|
64
|
+
if Dir.glob('*').empty?
|
65
|
+
Dir.rmdir(dir_path)
|
66
|
+
end
|
67
|
+
Dir.chdir(pwd)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
true
|
71
|
+
end
|
72
|
+
|
73
|
+
def public=(new_public)
|
74
|
+
new_public
|
75
|
+
end
|
76
|
+
|
77
|
+
def public_url
|
78
|
+
requires :directory, :key
|
79
|
+
|
80
|
+
if service.endpoint
|
81
|
+
escaped_directory = URI.escape(directory.key)
|
82
|
+
escaped_key = URI.escape(key)
|
83
|
+
|
84
|
+
::File.join(service.endpoint, escaped_directory, escaped_key)
|
85
|
+
else
|
86
|
+
nil
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
def save(options = {})
|
91
|
+
requires :body, :directory, :key
|
92
|
+
dirs = path.split(::File::SEPARATOR)[0...-1]
|
93
|
+
dirs.length.times do |index|
|
94
|
+
dir_path = dirs[0..index].join(::File::SEPARATOR)
|
95
|
+
if dir_path.empty? # path starts with ::File::SEPARATOR
|
96
|
+
next
|
97
|
+
end
|
98
|
+
# create directory if it doesn't already exist
|
99
|
+
unless ::File.directory?(dir_path)
|
100
|
+
Dir.mkdir(dir_path)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
file = ::File.new(path, 'wb')
|
104
|
+
if body.is_a?(String)
|
105
|
+
file.write(body)
|
106
|
+
else
|
107
|
+
file.write(body.read)
|
108
|
+
end
|
109
|
+
file.close
|
110
|
+
merge_attributes(
|
111
|
+
:content_length => Fog::Storage.get_body_size(body),
|
112
|
+
:last_modified => ::File.mtime(path)
|
113
|
+
)
|
114
|
+
true
|
115
|
+
end
|
116
|
+
|
117
|
+
private
|
118
|
+
|
119
|
+
def directory=(new_directory)
|
120
|
+
@directory = new_directory
|
121
|
+
end
|
122
|
+
|
123
|
+
def path
|
124
|
+
service.path_to(::File.join(directory.key, key))
|
125
|
+
end
|
126
|
+
|
127
|
+
end
|
128
|
+
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/local/models/storage/file'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Storage
|
6
|
+
class Local
|
7
|
+
|
8
|
+
class Files < Fog::Collection
|
9
|
+
|
10
|
+
attribute :directory
|
11
|
+
|
12
|
+
model Fog::Storage::Local::File
|
13
|
+
|
14
|
+
def all
|
15
|
+
requires :directory
|
16
|
+
if directory.collection.get(directory.key)
|
17
|
+
pwd = Dir.pwd
|
18
|
+
Dir.chdir(service.path_to(directory.key))
|
19
|
+
data = Dir.glob('**/*').reject do |file|
|
20
|
+
::File.directory?(file)
|
21
|
+
end.map do |key|
|
22
|
+
path = file_path(key)
|
23
|
+
{
|
24
|
+
:content_length => ::File.size(path),
|
25
|
+
:key => key,
|
26
|
+
:last_modified => ::File.mtime(path)
|
27
|
+
}
|
28
|
+
end
|
29
|
+
Dir.chdir(pwd)
|
30
|
+
load(data)
|
31
|
+
else
|
32
|
+
nil
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def get(key, &block)
|
37
|
+
requires :directory
|
38
|
+
path = file_path(key)
|
39
|
+
if ::File.exists?(path)
|
40
|
+
data = {
|
41
|
+
:content_length => ::File.size(path),
|
42
|
+
:key => key,
|
43
|
+
:last_modified => ::File.mtime(path)
|
44
|
+
}
|
45
|
+
if block_given?
|
46
|
+
file = ::File.open(path)
|
47
|
+
while (chunk = file.read(Excon::CHUNK_SIZE)) && yield(chunk); end
|
48
|
+
file.close
|
49
|
+
new(data)
|
50
|
+
else
|
51
|
+
body = ::File.read(path)
|
52
|
+
new(data.merge!(:body => body))
|
53
|
+
end
|
54
|
+
else
|
55
|
+
nil
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def head(key)
|
60
|
+
requires :directory
|
61
|
+
path = file_path(key)
|
62
|
+
if ::File.exists?(path)
|
63
|
+
new({
|
64
|
+
:content_length => ::File.size(path),
|
65
|
+
:key => key,
|
66
|
+
:last_modified => ::File.mtime(path)
|
67
|
+
})
|
68
|
+
else
|
69
|
+
nil
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def new(attributes = {})
|
74
|
+
requires :directory
|
75
|
+
super({ :directory => directory }.merge!(attributes))
|
76
|
+
end
|
77
|
+
|
78
|
+
private
|
79
|
+
|
80
|
+
def file_path(key)
|
81
|
+
service.path_to(::File.join(directory.key, key))
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
require 'fog/local/storage'
|
2
|
+
require 'fog/storage'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Storage
|
6
|
+
class Local < Fog::Service
|
7
|
+
|
8
|
+
requires :local_root
|
9
|
+
recognizes :endpoint, :scheme, :host, :port, :path
|
10
|
+
|
11
|
+
model_path 'fog/local/models/storage'
|
12
|
+
collection :directories
|
13
|
+
model :directory
|
14
|
+
model :file
|
15
|
+
collection :files
|
16
|
+
|
17
|
+
require 'uri'
|
18
|
+
|
19
|
+
class Mock
|
20
|
+
|
21
|
+
attr_reader :endpoint
|
22
|
+
|
23
|
+
def self.data
|
24
|
+
@data ||= Hash.new do |hash, key|
|
25
|
+
hash[key] = {}
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.reset
|
30
|
+
@data = nil
|
31
|
+
end
|
32
|
+
|
33
|
+
def initialize(options={})
|
34
|
+
Fog::Mock.not_implemented
|
35
|
+
|
36
|
+
require 'mime/types'
|
37
|
+
@local_root = ::File.expand_path(options[:local_root])
|
38
|
+
|
39
|
+
@endpoint = options[:endpoint] || build_endpoint_from_options(options)
|
40
|
+
end
|
41
|
+
|
42
|
+
def data
|
43
|
+
self.class.data[@local_root]
|
44
|
+
end
|
45
|
+
|
46
|
+
def local_root
|
47
|
+
@local_root
|
48
|
+
end
|
49
|
+
|
50
|
+
def path_to(partial)
|
51
|
+
::File.join(@local_root, partial)
|
52
|
+
end
|
53
|
+
|
54
|
+
def reset_data
|
55
|
+
self.class.data.delete(@local_root)
|
56
|
+
end
|
57
|
+
|
58
|
+
private
|
59
|
+
def build_endpoint_from_options(options)
|
60
|
+
return unless options[:host]
|
61
|
+
|
62
|
+
URI::Generic.build(options).to_s
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
class Real
|
67
|
+
|
68
|
+
attr_reader :endpoint
|
69
|
+
|
70
|
+
def initialize(options={})
|
71
|
+
require 'mime/types'
|
72
|
+
@local_root = ::File.expand_path(options[:local_root])
|
73
|
+
|
74
|
+
@endpoint = options[:endpoint] || build_endpoint_from_options(options)
|
75
|
+
end
|
76
|
+
|
77
|
+
def local_root
|
78
|
+
@local_root
|
79
|
+
end
|
80
|
+
|
81
|
+
def path_to(partial)
|
82
|
+
::File.join(@local_root, partial)
|
83
|
+
end
|
84
|
+
|
85
|
+
def copy_object(source_directory_name, source_object_name, target_directory_name, target_object_name, options={})
|
86
|
+
require 'fileutils'
|
87
|
+
source_path = path_to(::File.join(source_directory_name, source_object_name))
|
88
|
+
target_path = path_to(::File.join(target_directory_name, target_object_name))
|
89
|
+
::FileUtils.mkdir_p(::File.dirname(target_path))
|
90
|
+
::FileUtils.copy_file(source_path, target_path)
|
91
|
+
end
|
92
|
+
|
93
|
+
private
|
94
|
+
def build_endpoint_from_options(options)
|
95
|
+
return unless options[:host]
|
96
|
+
|
97
|
+
URI::Generic.build(options).to_s
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|