fog-ecloud 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +23 -0
- data/.rubocop.yml +20 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +17 -0
- data/CONTRIBUTING.md +18 -0
- data/CONTRIBUTORS.md +16 -0
- data/Gemfile +4 -0
- data/LICENSE.md +20 -0
- data/README.md +38 -0
- data/Rakefile +18 -0
- data/fog-ecloud.gemspec +35 -0
- data/gemfiles/Gemfile.1.9.2- +8 -0
- data/gemfiles/Gemfile.1.9.3+ +7 -0
- data/lib/fog/ecloud/collection.rb +24 -0
- data/lib/fog/ecloud/compute.rb +824 -0
- data/lib/fog/ecloud/core.rb +32 -0
- data/lib/fog/ecloud/generate_collection.rb +127 -0
- data/lib/fog/ecloud/ipaddr.rb +5 -0
- data/lib/fog/ecloud/mock_data_classes.rb +766 -0
- data/lib/fog/ecloud/model.rb +20 -0
- data/lib/fog/ecloud/models/compute/admin_organization.rb +43 -0
- data/lib/fog/ecloud/models/compute/admin_organizations.rb +21 -0
- data/lib/fog/ecloud/models/compute/api_key.rb +20 -0
- data/lib/fog/ecloud/models/compute/api_keys.rb +26 -0
- data/lib/fog/ecloud/models/compute/association.rb +23 -0
- data/lib/fog/ecloud/models/compute/associations.rb +34 -0
- data/lib/fog/ecloud/models/compute/authentication_level.rb +21 -0
- data/lib/fog/ecloud/models/compute/authentication_levels.rb +26 -0
- data/lib/fog/ecloud/models/compute/backup_internet_service.rb +45 -0
- data/lib/fog/ecloud/models/compute/backup_internet_services.rb +41 -0
- data/lib/fog/ecloud/models/compute/catalog.rb +39 -0
- data/lib/fog/ecloud/models/compute/catalog_configuration.rb +22 -0
- data/lib/fog/ecloud/models/compute/catalog_configurations.rb +26 -0
- data/lib/fog/ecloud/models/compute/catalog_item.rb +24 -0
- data/lib/fog/ecloud/models/compute/compute_pool.rb +70 -0
- data/lib/fog/ecloud/models/compute/compute_pools.rb +33 -0
- data/lib/fog/ecloud/models/compute/cpu_usage_detail.rb +16 -0
- data/lib/fog/ecloud/models/compute/cpu_usage_detail_summary.rb +26 -0
- data/lib/fog/ecloud/models/compute/detached_disk.rb +27 -0
- data/lib/fog/ecloud/models/compute/detached_disks.rb +26 -0
- data/lib/fog/ecloud/models/compute/environment.rb +111 -0
- data/lib/fog/ecloud/models/compute/environments.rb +39 -0
- data/lib/fog/ecloud/models/compute/firewall_acl.rb +27 -0
- data/lib/fog/ecloud/models/compute/firewall_acls.rb +27 -0
- data/lib/fog/ecloud/models/compute/group.rb +41 -0
- data/lib/fog/ecloud/models/compute/groups.rb +38 -0
- data/lib/fog/ecloud/models/compute/guest_process.rb +15 -0
- data/lib/fog/ecloud/models/compute/guest_processes.rb +26 -0
- data/lib/fog/ecloud/models/compute/hardware_configuration.rb +18 -0
- data/lib/fog/ecloud/models/compute/hardware_configurations.rb +26 -0
- data/lib/fog/ecloud/models/compute/internet_service.rb +97 -0
- data/lib/fog/ecloud/models/compute/internet_services.rb +44 -0
- data/lib/fog/ecloud/models/compute/ip_address.rb +39 -0
- data/lib/fog/ecloud/models/compute/ip_addresses.rb +32 -0
- data/lib/fog/ecloud/models/compute/layout.rb +20 -0
- data/lib/fog/ecloud/models/compute/layouts.rb +26 -0
- data/lib/fog/ecloud/models/compute/location.rb +22 -0
- data/lib/fog/ecloud/models/compute/locations.rb +28 -0
- data/lib/fog/ecloud/models/compute/login_banner.rb +16 -0
- data/lib/fog/ecloud/models/compute/login_banners.rb +26 -0
- data/lib/fog/ecloud/models/compute/memory_usage_detail.rb +16 -0
- data/lib/fog/ecloud/models/compute/memory_usage_detail_summary.rb +26 -0
- data/lib/fog/ecloud/models/compute/monitor.rb +46 -0
- data/lib/fog/ecloud/models/compute/monitors.rb +30 -0
- data/lib/fog/ecloud/models/compute/network.rb +46 -0
- data/lib/fog/ecloud/models/compute/networks.rb +32 -0
- data/lib/fog/ecloud/models/compute/node.rb +45 -0
- data/lib/fog/ecloud/models/compute/nodes.rb +42 -0
- data/lib/fog/ecloud/models/compute/operating_system.rb +16 -0
- data/lib/fog/ecloud/models/compute/operating_system_families.rb +26 -0
- data/lib/fog/ecloud/models/compute/operating_system_family.rb +21 -0
- data/lib/fog/ecloud/models/compute/operating_systems.rb +25 -0
- data/lib/fog/ecloud/models/compute/organization.rb +78 -0
- data/lib/fog/ecloud/models/compute/organizations.rb +38 -0
- data/lib/fog/ecloud/models/compute/password_complexity_rule.rb +49 -0
- data/lib/fog/ecloud/models/compute/password_complexity_rules.rb +26 -0
- data/lib/fog/ecloud/models/compute/physical_device.rb +21 -0
- data/lib/fog/ecloud/models/compute/physical_devices.rb +26 -0
- data/lib/fog/ecloud/models/compute/public_ip.rb +26 -0
- data/lib/fog/ecloud/models/compute/public_ips.rb +31 -0
- data/lib/fog/ecloud/models/compute/rnat.rb +27 -0
- data/lib/fog/ecloud/models/compute/rnats.rb +26 -0
- data/lib/fog/ecloud/models/compute/role.rb +23 -0
- data/lib/fog/ecloud/models/compute/roles.rb +36 -0
- data/lib/fog/ecloud/models/compute/row.rb +56 -0
- data/lib/fog/ecloud/models/compute/rows.rb +39 -0
- data/lib/fog/ecloud/models/compute/server.rb +323 -0
- data/lib/fog/ecloud/models/compute/server_configuration_option.rb +16 -0
- data/lib/fog/ecloud/models/compute/server_configuration_options.rb +26 -0
- data/lib/fog/ecloud/models/compute/servers.rb +65 -0
- data/lib/fog/ecloud/models/compute/ssh_key.rb +19 -0
- data/lib/fog/ecloud/models/compute/ssh_keys.rb +26 -0
- data/lib/fog/ecloud/models/compute/storage_usage_detail.rb +16 -0
- data/lib/fog/ecloud/models/compute/storage_usage_detail_summary.rb +26 -0
- data/lib/fog/ecloud/models/compute/support_ticket.rb +28 -0
- data/lib/fog/ecloud/models/compute/support_tickets.rb +26 -0
- data/lib/fog/ecloud/models/compute/tag.rb +13 -0
- data/lib/fog/ecloud/models/compute/tags.rb +26 -0
- data/lib/fog/ecloud/models/compute/task.rb +23 -0
- data/lib/fog/ecloud/models/compute/tasks.rb +29 -0
- data/lib/fog/ecloud/models/compute/template.rb +23 -0
- data/lib/fog/ecloud/models/compute/templates.rb +41 -0
- data/lib/fog/ecloud/models/compute/trusted_network_group.rb +33 -0
- data/lib/fog/ecloud/models/compute/trusted_network_groups.rb +27 -0
- data/lib/fog/ecloud/models/compute/user.rb +35 -0
- data/lib/fog/ecloud/models/compute/users.rb +26 -0
- data/lib/fog/ecloud/models/compute/virtual_machine_assigned_ip.rb +32 -0
- data/lib/fog/ecloud/models/compute/virtual_machine_assigned_ips.rb +26 -0
- data/lib/fog/ecloud/requests/compute/admin_disable_support_access.rb +9 -0
- data/lib/fog/ecloud/requests/compute/admin_edit_authentication_levels.rb +32 -0
- data/lib/fog/ecloud/requests/compute/admin_edit_login_banner.rb +30 -0
- data/lib/fog/ecloud/requests/compute/admin_edit_password_complexity_rules.rb +72 -0
- data/lib/fog/ecloud/requests/compute/admin_enable_support_access.rb +9 -0
- data/lib/fog/ecloud/requests/compute/backup_internet_service_create.rb +47 -0
- data/lib/fog/ecloud/requests/compute/backup_internet_service_delete.rb +9 -0
- data/lib/fog/ecloud/requests/compute/backup_internet_service_edit.rb +47 -0
- data/lib/fog/ecloud/requests/compute/compute_pool_edit.rb +35 -0
- data/lib/fog/ecloud/requests/compute/firewall_acls_create.rb +78 -0
- data/lib/fog/ecloud/requests/compute/firewall_acls_delete.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_admin_organization.rb +23 -0
- data/lib/fog/ecloud/requests/compute/get_api_key.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_api_keys.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_association.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_associations.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_authentication_level.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_authentication_levels.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_backup_internet_service.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_backup_internet_services.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_catalog.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_catalog_configuration.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_catalog_configurations.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_catalog_item.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_compute_pool.rb +21 -0
- data/lib/fog/ecloud/requests/compute/get_compute_pools.rb +31 -0
- data/lib/fog/ecloud/requests/compute/get_cpu_usage_detail.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_cpu_usage_detail_summary.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_detached_disk.rb +21 -0
- data/lib/fog/ecloud/requests/compute/get_detached_disks.rb +31 -0
- data/lib/fog/ecloud/requests/compute/get_environment.rb +31 -0
- data/lib/fog/ecloud/requests/compute/get_environments.rb +0 -0
- data/lib/fog/ecloud/requests/compute/get_firewall_acl.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_firewall_acls.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_group.rb +18 -0
- data/lib/fog/ecloud/requests/compute/get_groups.rb +18 -0
- data/lib/fog/ecloud/requests/compute/get_guest_process.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_guest_processes.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_hardware_configuration.rb +29 -0
- data/lib/fog/ecloud/requests/compute/get_hardware_configurations.rb +14 -0
- data/lib/fog/ecloud/requests/compute/get_internet_service.rb +21 -0
- data/lib/fog/ecloud/requests/compute/get_internet_services.rb +18 -0
- data/lib/fog/ecloud/requests/compute/get_ip_address.rb +20 -0
- data/lib/fog/ecloud/requests/compute/get_layout.rb +18 -0
- data/lib/fog/ecloud/requests/compute/get_layouts.rb +18 -0
- data/lib/fog/ecloud/requests/compute/get_location.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_locations.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_login_banner.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_login_banners.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_memory_usage_detail.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_memory_usage_detail_summary.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_monitor.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_monitors.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_network.rb +21 -0
- data/lib/fog/ecloud/requests/compute/get_network_summary.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_networks.rb +30 -0
- data/lib/fog/ecloud/requests/compute/get_node.rb +21 -0
- data/lib/fog/ecloud/requests/compute/get_nodes.rb +18 -0
- data/lib/fog/ecloud/requests/compute/get_operating_system.rb +24 -0
- data/lib/fog/ecloud/requests/compute/get_operating_system_families.rb +30 -0
- data/lib/fog/ecloud/requests/compute/get_organization.rb +24 -0
- data/lib/fog/ecloud/requests/compute/get_organizations.rb +23 -0
- data/lib/fog/ecloud/requests/compute/get_password_complexity_rule.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_password_complexity_rules.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_physical_device.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_physical_devices.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_process.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_processes.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_public_ip.rb +21 -0
- data/lib/fog/ecloud/requests/compute/get_public_ips.rb +31 -0
- data/lib/fog/ecloud/requests/compute/get_rnat.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_rnats.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_role.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_roles.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_row.rb +18 -0
- data/lib/fog/ecloud/requests/compute/get_rows.rb +12 -0
- data/lib/fog/ecloud/requests/compute/get_server.rb +21 -0
- data/lib/fog/ecloud/requests/compute/get_server_configuration_option.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_server_configuration_options.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_servers.rb +42 -0
- data/lib/fog/ecloud/requests/compute/get_ssh_key.rb +21 -0
- data/lib/fog/ecloud/requests/compute/get_ssh_keys.rb +30 -0
- data/lib/fog/ecloud/requests/compute/get_storage_usage_detail.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_storage_usage_detail_summary.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_support_ticket.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_support_tickets.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_tag.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_tags.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_task.rb +13 -0
- data/lib/fog/ecloud/requests/compute/get_tasks.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_template.rb +21 -0
- data/lib/fog/ecloud/requests/compute/get_templates.rb +48 -0
- data/lib/fog/ecloud/requests/compute/get_trusted_network_group.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_trusted_network_groups.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_user.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_users.rb +9 -0
- data/lib/fog/ecloud/requests/compute/get_virtual_machine_assigned_ips.rb +42 -0
- data/lib/fog/ecloud/requests/compute/groups_create.rb +31 -0
- data/lib/fog/ecloud/requests/compute/groups_delete.rb +26 -0
- data/lib/fog/ecloud/requests/compute/groups_edit.rb +29 -0
- data/lib/fog/ecloud/requests/compute/groups_movedown.rb +9 -0
- data/lib/fog/ecloud/requests/compute/groups_moveup.rb +9 -0
- data/lib/fog/ecloud/requests/compute/internet_service_create.rb +102 -0
- data/lib/fog/ecloud/requests/compute/internet_service_delete.rb +33 -0
- data/lib/fog/ecloud/requests/compute/internet_service_edit.rb +58 -0
- data/lib/fog/ecloud/requests/compute/monitors_create_default.rb +9 -0
- data/lib/fog/ecloud/requests/compute/monitors_create_ecv.rb +40 -0
- data/lib/fog/ecloud/requests/compute/monitors_create_http.rb +44 -0
- data/lib/fog/ecloud/requests/compute/monitors_create_loopback.rb +9 -0
- data/lib/fog/ecloud/requests/compute/monitors_create_ping.rb +35 -0
- data/lib/fog/ecloud/requests/compute/monitors_disable.rb +9 -0
- data/lib/fog/ecloud/requests/compute/monitors_edit_ecv.rb +40 -0
- data/lib/fog/ecloud/requests/compute/monitors_edit_http.rb +44 -0
- data/lib/fog/ecloud/requests/compute/monitors_edit_ping.rb +35 -0
- data/lib/fog/ecloud/requests/compute/monitors_enable.rb +9 -0
- data/lib/fog/ecloud/requests/compute/node_service_create.rb +93 -0
- data/lib/fog/ecloud/requests/compute/node_service_delete.rb +33 -0
- data/lib/fog/ecloud/requests/compute/node_service_edit.rb +39 -0
- data/lib/fog/ecloud/requests/compute/power_off.rb +9 -0
- data/lib/fog/ecloud/requests/compute/power_on.rb +9 -0
- data/lib/fog/ecloud/requests/compute/power_reset.rb +9 -0
- data/lib/fog/ecloud/requests/compute/power_shutdown.rb +9 -0
- data/lib/fog/ecloud/requests/compute/public_ip_activate.rb +9 -0
- data/lib/fog/ecloud/requests/compute/rnat_associations_create_device.rb +32 -0
- data/lib/fog/ecloud/requests/compute/rnat_associations_delete.rb +9 -0
- data/lib/fog/ecloud/requests/compute/rnat_associations_edit_network.rb +31 -0
- data/lib/fog/ecloud/requests/compute/rows_create.rb +29 -0
- data/lib/fog/ecloud/requests/compute/rows_delete.rb +21 -0
- data/lib/fog/ecloud/requests/compute/rows_edit.rb +29 -0
- data/lib/fog/ecloud/requests/compute/rows_movedown.rb +9 -0
- data/lib/fog/ecloud/requests/compute/rows_moveup.rb +9 -0
- data/lib/fog/ecloud/requests/compute/trusted_network_groups_create.rb +51 -0
- data/lib/fog/ecloud/requests/compute/trusted_network_groups_delete.rb +9 -0
- data/lib/fog/ecloud/requests/compute/trusted_network_groups_edit.rb +51 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_attach_disk.rb +61 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_copy.rb +116 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_copy_identical.rb +43 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_create_from_template.rb +244 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_delete.rb +46 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_detach_disk.rb +70 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_edit.rb +45 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_edit_assigned_ips.rb +80 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_edit_hardware_configuration.rb +75 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_import.rb +179 -0
- data/lib/fog/ecloud/requests/compute/virtual_machine_upload_file.rb +28 -0
- data/lib/fog/ecloud/version.rb +5 -0
- data/lib/fog/ecloud.rb +8 -0
- data/spec/minitest_helper.rb +31 -0
- data/tests/compute/helper.rb +27 -0
- data/tests/compute/models/admin_organization_tests.rb +16 -0
- data/tests/compute/models/compute_pool_tests.rb +17 -0
- data/tests/compute/models/detached_disk_tests.rb +26 -0
- data/tests/compute/models/environment_tests.rb +23 -0
- data/tests/compute/models/internet_service_tests.rb +28 -0
- data/tests/compute/models/ip_address_tests.rb +19 -0
- data/tests/compute/models/network_tests.rb +17 -0
- data/tests/compute/models/operating_system_families_tests.rb +13 -0
- data/tests/compute/models/operating_system_tests.rb +22 -0
- data/tests/compute/models/organization_tests.rb +21 -0
- data/tests/compute/models/public_ip_tests.rb +19 -0
- data/tests/compute/models/server_tests.rb +25 -0
- data/tests/compute/models/ssh_key_tests.rb +19 -0
- data/tests/compute/models/template_tests.rb +20 -0
- data/tests/helper.rb +24 -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 +115 -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
- metadata +457 -0
@@ -0,0 +1,115 @@
|
|
1
|
+
# Use so you can run in mock mode from the command line
|
2
|
+
#
|
3
|
+
# FOG_MOCK=true fog
|
4
|
+
|
5
|
+
if ENV["FOG_MOCK"] == "true"
|
6
|
+
Fog.mock!
|
7
|
+
end
|
8
|
+
|
9
|
+
# if in mocked mode, fill in some fake credentials for us
|
10
|
+
if Fog.mock?
|
11
|
+
Fog.credentials = {
|
12
|
+
:aws_access_key_id => 'aws_access_key_id',
|
13
|
+
:aws_secret_access_key => 'aws_secret_access_key',
|
14
|
+
:ia_access_key_id => 'aws_access_key_id',
|
15
|
+
:ia_secret_access_key => 'aws_secret_access_key',
|
16
|
+
:atmos_storage_token => 'atmos_token',
|
17
|
+
:atmos_storage_secret => 'atmos_secret',
|
18
|
+
:atmos_storage_endpoint => 'http://atmos.is.cool:1000/test1.0',
|
19
|
+
:bluebox_api_key => 'bluebox_api_key',
|
20
|
+
:bluebox_customer_id => 'bluebox_customer_id',
|
21
|
+
:brightbox_client_id => 'brightbox_client_id',
|
22
|
+
:brightbox_secret => 'brightbox_secret',
|
23
|
+
:cloudstack_disk_offering_id => '',
|
24
|
+
:cloudstack_host => 'http://cloudstack.example.org',
|
25
|
+
:cloudstack_network_ids => '',
|
26
|
+
:cloudstack_service_offering_id => '4437ac6c-9fe3-477a-57ec-60a5a45896a4',
|
27
|
+
:cloudstack_template_id => '8a31cf9c-f248-0588-256e-9dbf58785216',
|
28
|
+
:cloudstack_zone_id => 'c554c592-e09c-9df5-7688-4a32754a4305',
|
29
|
+
:clodo_api_key => 'clodo_api_key',
|
30
|
+
:clodo_username => 'clodo_username',
|
31
|
+
:digitalocean_api_key => 'digitalocean_api_key',
|
32
|
+
:digitalocean_client_id => 'digitalocean_client_id',
|
33
|
+
:dnsimple_email => 'dnsimple_email',
|
34
|
+
:dnsimple_password => 'dnsimple_password',
|
35
|
+
:dnsmadeeasy_api_key => 'dnsmadeeasy_api_key',
|
36
|
+
:dnsmadeeasy_secret_key => 'dnsmadeeasy_secret_key',
|
37
|
+
:ecloud_username => 'ecloud_username',
|
38
|
+
:ecloud_password => 'ecloud_password',
|
39
|
+
:ecloud_versions_uri => 'http://ecloud.versions.uri',
|
40
|
+
:glesys_username => 'glesys_username',
|
41
|
+
:glesys_api_key => 'glesys_api_key',
|
42
|
+
:go_grid_api_key => 'go_grid_api_key',
|
43
|
+
:go_grid_shared_secret => 'go_grid_shared_secret',
|
44
|
+
:google_storage_access_key_id => 'google_storage_access_key_id',
|
45
|
+
:google_storage_secret_access_key => 'google_storage_secret_access_key',
|
46
|
+
:google_project => 'google_project_name',
|
47
|
+
:google_client_email => 'fake@developer.gserviceaccount.com',
|
48
|
+
:google_key_location => '~/fake.p12',
|
49
|
+
:hp_access_key => 'hp_access_key',
|
50
|
+
:hp_secret_key => 'hp_secret_key',
|
51
|
+
:hp_tenant_id => 'hp_tenant_id',
|
52
|
+
:hp_avl_zone => 'hp_avl_zone',
|
53
|
+
:os_account_meta_temp_url_key => 'os_account_meta_temp_url_key',
|
54
|
+
:ibm_username => 'ibm_username',
|
55
|
+
:ibm_password => 'ibm_password',
|
56
|
+
:joyent_username => "joyentuser",
|
57
|
+
:joyent_password => "joyentpass",
|
58
|
+
:linode_api_key => 'linode_api_key',
|
59
|
+
:local_root => '~/.fog',
|
60
|
+
:bare_metal_cloud_password => 'bare_metal_cloud_password',
|
61
|
+
:bare_metal_cloud_username => 'bare_metal_cloud_username',
|
62
|
+
:ninefold_compute_key => 'ninefold_compute_key',
|
63
|
+
:ninefold_compute_secret => 'ninefold_compute_secret',
|
64
|
+
:ninefold_storage_secret => 'ninefold_storage_secret',
|
65
|
+
:ninefold_storage_token => 'ninefold_storage_token',
|
66
|
+
# :public_key_path => '~/.ssh/id_rsa.pub',
|
67
|
+
# :private_key_path => '~/.ssh/id_rsa',
|
68
|
+
:opennebula_endpoint => 'http://opennebula:2633/RPC2',
|
69
|
+
:opennebula_username => 'oneadmin',
|
70
|
+
:opennebula_password => 'oneadmin',
|
71
|
+
:openstack_api_key => 'openstack_api_key',
|
72
|
+
:openstack_username => 'openstack_username',
|
73
|
+
:openstack_tenant => 'openstack_tenant',
|
74
|
+
:openstack_auth_url => 'http://openstack:35357/v2.0/tokens',
|
75
|
+
:ovirt_url => 'http://ovirt:8080/api',
|
76
|
+
:ovirt_username => 'admin@internal',
|
77
|
+
:ovirt_password => '123123',
|
78
|
+
:profitbricks_username => 'profitbricks_username',
|
79
|
+
:profitbricks_password => 'profitbricks_password',
|
80
|
+
:libvirt_uri => 'qemu://libvirt/system',
|
81
|
+
:rackspace_api_key => 'rackspace_api_key',
|
82
|
+
:rackspace_region => 'dfw',
|
83
|
+
:rackspace_username => 'rackspace_username',
|
84
|
+
:riakcs_access_key_id => 'riakcs_access_key_id',
|
85
|
+
:riakcs_secret_access_key => 'riakcs_secret_access_key',
|
86
|
+
:sakuracloud_api_token => 'sakuracloud_api_token',
|
87
|
+
:sakuracloud_api_token_secret => 'sakuracloud_api_token_secret',
|
88
|
+
:storm_on_demand_username => 'storm_on_demand_username',
|
89
|
+
:storm_on_demand_password => 'storm_on_demand_password',
|
90
|
+
:vcloud_host => 'vcloud_host',
|
91
|
+
:vcloud_password => 'vcloud_password',
|
92
|
+
:vcloud_username => 'vcloud_username',
|
93
|
+
:vcloud_director_host => 'vcloud-director-host',
|
94
|
+
:vcloud_director_password => 'vcloud_director_password',
|
95
|
+
:vcloud_director_username => 'vcd_user@vcd_org_name',
|
96
|
+
:zerigo_email => 'zerigo_email',
|
97
|
+
:zerigo_token => 'zerigo_token',
|
98
|
+
:dynect_customer => 'dynect_customer',
|
99
|
+
:dynect_username => 'dynect_username',
|
100
|
+
:dynect_password => 'dynect_password',
|
101
|
+
:vsphere_server => 'virtualcenter.lan',
|
102
|
+
:vsphere_username => 'apiuser',
|
103
|
+
:vsphere_password => 'apipassword',
|
104
|
+
:vsphere_expected_pubkey_hash => 'abcdef1234567890',
|
105
|
+
:libvirt_uri => 'qemu:///system',
|
106
|
+
:libvirt_username => 'root',
|
107
|
+
:libvirt_password => 'password',
|
108
|
+
:cloudsigma_username => 'csuname',
|
109
|
+
:cloudsigma_password => 'cspass',
|
110
|
+
:docker_username => 'docker-fan',
|
111
|
+
:docker_password => 'i<3docker',
|
112
|
+
:docker_email => 'dockerfan@gmail.com',
|
113
|
+
:docker_url => 'unix://var/run/docker.sock'
|
114
|
+
}.merge(Fog.credentials)
|
115
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
def model_tests(collection, params = {}, mocks_implemented = true)
|
2
|
+
tests('success') do
|
3
|
+
|
4
|
+
@instance = collection.new(params)
|
5
|
+
|
6
|
+
tests("#save").succeeds do
|
7
|
+
pending if Fog.mocking? && !mocks_implemented
|
8
|
+
@instance.save
|
9
|
+
end
|
10
|
+
|
11
|
+
if block_given?
|
12
|
+
yield(@instance)
|
13
|
+
end
|
14
|
+
|
15
|
+
tests("#destroy").succeeds do
|
16
|
+
pending if Fog.mocking? && !mocks_implemented
|
17
|
+
@instance.destroy
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# Generates a unique identifier with a random differentiator.
|
24
|
+
# Useful when rapidly re-running tests, so we don't have to wait
|
25
|
+
# serveral minutes for deleted objects to disappear from the API
|
26
|
+
# E.g. 'fog-test-1234'
|
27
|
+
def uniq_id(base_name = 'fog-test')
|
28
|
+
# random_differentiator
|
29
|
+
suffix = rand(65536).to_s(16).rjust(4, '0')
|
30
|
+
[base_name, suffix] * '-'
|
31
|
+
end
|
@@ -0,0 +1,107 @@
|
|
1
|
+
Shindo.tests('Fog::Schema::DataValidator', 'meta') do
|
2
|
+
|
3
|
+
validator = Fog::Schema::DataValidator.new
|
4
|
+
|
5
|
+
tests('#validate') do
|
6
|
+
|
7
|
+
tests('returns true') do
|
8
|
+
|
9
|
+
returns(true, 'when value matches schema expectation') do
|
10
|
+
validator.validate({"key" => "Value"}, {"key" => String})
|
11
|
+
end
|
12
|
+
|
13
|
+
returns(true, 'when values within an array all match schema expectation') do
|
14
|
+
validator.validate({"key" => [1, 2]}, {"key" => [Integer]})
|
15
|
+
end
|
16
|
+
|
17
|
+
returns(true, 'when nested values match schema expectation') do
|
18
|
+
validator.validate({"key" => {:nested_key => "Value"}}, {"key" => {:nested_key => String}})
|
19
|
+
end
|
20
|
+
|
21
|
+
returns(true, 'when collection of values all match schema expectation') do
|
22
|
+
validator.validate([{"key" => "Value"}, {"key" => "Value"}], [{"key" => String}])
|
23
|
+
end
|
24
|
+
|
25
|
+
returns(true, 'when collection is empty although schema covers optional members') do
|
26
|
+
validator.validate([], [{"key" => String}])
|
27
|
+
end
|
28
|
+
|
29
|
+
returns(true, 'when additional keys are passed and not strict') do
|
30
|
+
validator.validate({"key" => "Value", :extra => "Bonus"}, {"key" => String}, {:allow_extra_keys => true})
|
31
|
+
end
|
32
|
+
|
33
|
+
returns(true, 'when value is nil and schema expects NilClass') do
|
34
|
+
validator.validate({"key" => nil}, {"key" => NilClass})
|
35
|
+
end
|
36
|
+
|
37
|
+
returns(true, 'when value and schema match as hashes') do
|
38
|
+
validator.validate({}, {})
|
39
|
+
end
|
40
|
+
|
41
|
+
returns(true, 'when value and schema match as arrays') do
|
42
|
+
validator.validate([], [])
|
43
|
+
end
|
44
|
+
|
45
|
+
returns(true, 'when value is a Time') do
|
46
|
+
validator.validate({"time" => Time.now}, {"time" => Time})
|
47
|
+
end
|
48
|
+
|
49
|
+
returns(true, 'when key is missing but value should be NilClass (#1477)') do
|
50
|
+
validator.validate({}, {"key" => NilClass}, {:allow_optional_rules => true})
|
51
|
+
end
|
52
|
+
|
53
|
+
returns(true, 'when key is missing but value is nullable (#1477)') do
|
54
|
+
validator.validate({}, {"key" => Fog::Nullable::String}, {:allow_optional_rules => true})
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
tests('returns false') do
|
60
|
+
|
61
|
+
returns(false, 'when value does not match schema expectation') do
|
62
|
+
validator.validate({"key" => nil}, {"key" => String})
|
63
|
+
end
|
64
|
+
|
65
|
+
returns(false, 'when key formats do not match') do
|
66
|
+
validator.validate({"key" => "Value"}, {:key => String})
|
67
|
+
end
|
68
|
+
|
69
|
+
returns(false, 'when additional keys are passed and strict') do
|
70
|
+
validator.validate({"key" => "Missing"}, {})
|
71
|
+
end
|
72
|
+
|
73
|
+
returns(false, 'when some keys do not appear') do
|
74
|
+
validator.validate({}, {"key" => String})
|
75
|
+
end
|
76
|
+
|
77
|
+
returns(false, 'when collection contains a member that does not match schema') do
|
78
|
+
validator.validate([{"key" => "Value"}, {"key" => 5}], [{"key" => String}])
|
79
|
+
end
|
80
|
+
|
81
|
+
returns(false, 'when collection has multiple schema patterns') do
|
82
|
+
validator.validate([{"key" => "Value"}], [{"key" => Integer}, {"key" => String}])
|
83
|
+
end
|
84
|
+
|
85
|
+
returns(false, 'when hash and array are compared') do
|
86
|
+
validator.validate({}, [])
|
87
|
+
end
|
88
|
+
|
89
|
+
returns(false, 'when array and hash are compared') do
|
90
|
+
validator.validate([], {})
|
91
|
+
end
|
92
|
+
|
93
|
+
returns(false, 'when a hash is expected but another data type is found') do
|
94
|
+
validator.validate({"key" => {:nested_key => []}}, {"key" => {:nested_key => {}}})
|
95
|
+
end
|
96
|
+
|
97
|
+
returns(false, 'when key is missing but value should be NilClass (#1477)') do
|
98
|
+
validator.validate({}, {"key" => NilClass}, {:allow_optional_rules => false})
|
99
|
+
end
|
100
|
+
|
101
|
+
returns(false, 'when key is missing but value is nullable (#1477)') do
|
102
|
+
validator.validate({}, {"key" => Fog::Nullable::String}, {:allow_optional_rules => false})
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|