fog-ecloud 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -0
- data/fog-ecloud.gemspec +4 -1
- data/lib/fog/bin/ecloud.rb +1 -1
- data/lib/fog/compute/ecloud.rb +826 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/admin_organization.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/admin_organizations.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/api_key.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/api_keys.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/association.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/associations.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/authentication_level.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/authentication_levels.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/backup_internet_service.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/backup_internet_services.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/catalog.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/catalog_configuration.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/catalog_configurations.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/catalog_item.rb +0 -0
- data/lib/fog/{ecloud → compute/ecloud/models}/collection.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/compute_pool.rb +2 -2
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/compute_pools.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/cpu_usage_detail.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/cpu_usage_detail_summary.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/detached_disk.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/detached_disks.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/environment.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/environments.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/firewall_acl.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/firewall_acls.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/group.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/groups.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/guest_process.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/guest_processes.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/hardware_configuration.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/hardware_configurations.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/internet_service.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/internet_services.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/ip_address.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/ip_addresses.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/layout.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/layouts.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/location.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/locations.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/login_banner.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/login_banners.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/memory_usage_detail.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/memory_usage_detail_summary.rb +1 -1
- data/lib/fog/{ecloud → compute/ecloud/models}/model.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/monitor.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/monitors.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/network.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/networks.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/node.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/nodes.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/operating_system.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/operating_system_families.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/operating_system_family.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/operating_systems.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/organization.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/organizations.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/password_complexity_rule.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/password_complexity_rules.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/physical_device.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/physical_devices.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/public_ip.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/public_ips.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/rnat.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/rnats.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/role.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/roles.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/row.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/rows.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/server.rb +5 -5
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/server_configuration_option.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/server_configuration_options.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/servers.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/ssh_key.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/ssh_keys.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/storage_usage_detail.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/storage_usage_detail_summary.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/support_ticket.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/support_tickets.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/tag.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/tags.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/task.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/tasks.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/template.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/templates.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/trusted_network_group.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/trusted_network_groups.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/user.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/users.rb +1 -1
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/virtual_machine_assigned_ip.rb +0 -0
- data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/virtual_machine_assigned_ips.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/admin_disable_support_access.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/admin_edit_authentication_levels.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/admin_edit_login_banner.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/admin_edit_password_complexity_rules.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/admin_enable_support_access.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/backup_internet_service_create.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/backup_internet_service_delete.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/backup_internet_service_edit.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/compute_pool_edit.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/firewall_acls_create.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/firewall_acls_delete.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_admin_organization.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_api_key.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_api_keys.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_association.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_associations.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_authentication_level.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_authentication_levels.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_backup_internet_service.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_backup_internet_services.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_catalog.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_catalog_configuration.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_catalog_configurations.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_catalog_item.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_compute_pool.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_compute_pools.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_cpu_usage_detail.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_cpu_usage_detail_summary.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_detached_disk.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_detached_disks.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_environment.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_environments.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_firewall_acl.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_firewall_acls.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_group.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_groups.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_guest_process.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_guest_processes.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_hardware_configuration.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_hardware_configurations.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_internet_service.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_internet_services.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_ip_address.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_layout.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_layouts.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_location.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_locations.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_login_banner.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_login_banners.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_memory_usage_detail.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_memory_usage_detail_summary.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_monitor.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_monitors.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_network.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_network_summary.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_networks.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_node.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_nodes.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_operating_system.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_operating_system_families.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_organization.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_organizations.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_password_complexity_rule.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_password_complexity_rules.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_physical_device.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_physical_devices.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_process.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_processes.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_public_ip.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_public_ips.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_rnat.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_rnats.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_role.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_roles.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_row.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_rows.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_server.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_server_configuration_option.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_server_configuration_options.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_servers.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_ssh_key.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_ssh_keys.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_storage_usage_detail.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_storage_usage_detail_summary.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_support_ticket.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_support_tickets.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_tag.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_tags.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_task.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_tasks.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_template.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_templates.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_trusted_network_group.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_trusted_network_groups.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_user.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_users.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_virtual_machine_assigned_ips.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/groups_create.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/groups_delete.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/groups_edit.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/groups_movedown.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/groups_moveup.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/internet_service_create.rb +2 -2
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/internet_service_delete.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/internet_service_edit.rb +3 -3
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/monitors_create_default.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/monitors_create_ecv.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/monitors_create_http.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/monitors_create_loopback.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/monitors_create_ping.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/monitors_disable.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/monitors_edit_ecv.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/monitors_edit_http.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/monitors_edit_ping.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/monitors_enable.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/node_service_create.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/node_service_delete.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/node_service_edit.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/power_off.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/power_on.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/power_reset.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/power_shutdown.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/public_ip_activate.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/rnat_associations_create_device.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/rnat_associations_delete.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/rnat_associations_edit_network.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/rows_create.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/rows_delete.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/rows_edit.rb +0 -0
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/rows_movedown.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/rows_moveup.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/trusted_network_groups_create.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/trusted_network_groups_delete.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/trusted_network_groups_edit.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_attach_disk.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_copy.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_copy_identical.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_create_from_template.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_delete.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_detach_disk.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_edit.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_edit_assigned_ips.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_edit_hardware_configuration.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_import.rb +1 -1
- data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_upload_file.rb +3 -3
- data/lib/fog/ecloud.rb +37 -3
- data/lib/fog/ecloud/compute.rb +1 -824
- data/lib/fog/ecloud/version.rb +1 -1
- metadata +238 -239
- data/lib/fog/ecloud/core.rb +0 -32
- data/lib/fog/ecloud/generate_collection.rb +0 -127
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba48be01cb0c4f4af5cf107563c528f2e828b557
|
4
|
+
data.tar.gz: 0b9629b3d32eb16aab63e64a04b06c27177740ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57bf7711527a28076c985b98c7793e727e67dc2d482b16e96e280c5ba6f7fc5e8451ce2748cef24e2fb7d8a9a9a10c1d3c603a5bc5c9075be8d5c46489e2d17d
|
7
|
+
data.tar.gz: e1904ac3dceb915ec294a4b28b8e4aa7945bdd3a0e6a6863aafcd6ec703ad2273e424efc9bc6142172f2a81f6c78fe944aab131bcf26b6830bbc9eaefa3c471c
|
data/.rubocop.yml
CHANGED
data/fog-ecloud.gemspec
CHANGED
@@ -14,7 +14,10 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = ""
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
|
-
|
17
|
+
files = `git ls-files -z`.split("\x0")
|
18
|
+
files.delete(".hound.yml")
|
19
|
+
spec.files = files
|
20
|
+
|
18
21
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
22
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
23
|
spec.require_paths = ["lib"]
|
data/lib/fog/bin/ecloud.rb
CHANGED
@@ -18,7 +18,7 @@ class Ecloud < Fog::Bin
|
|
18
18
|
hash[key] = case key
|
19
19
|
when :compute
|
20
20
|
Fog::Logger.warning("Ecloud[:compute] is not recommended, use Compute[:ecloud] for portability")
|
21
|
-
Fog::Compute.new(:provider =>
|
21
|
+
Fog::Compute.new(:provider => "Ecloud")
|
22
22
|
else
|
23
23
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
24
24
|
end
|
@@ -0,0 +1,826 @@
|
|
1
|
+
require File.expand_path("../ecloud/models/model", __FILE__)
|
2
|
+
require File.expand_path("../ecloud/models/collection", __FILE__)
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Compute
|
6
|
+
class Ecloud < Fog::Service
|
7
|
+
API_URL = "https://services.enterprisecloud.terremark.com"
|
8
|
+
|
9
|
+
attr_reader :authentication_method, :version
|
10
|
+
|
11
|
+
#### Credentials
|
12
|
+
# requires
|
13
|
+
recognizes :ecloud_username, :ecloud_password, :ecloud_version,
|
14
|
+
:ecloud_access_key, :ecloud_private_key,
|
15
|
+
:ecloud_authentication_method, :base_path
|
16
|
+
|
17
|
+
#### Models
|
18
|
+
model_path "fog/compute/ecloud/models/"
|
19
|
+
model :organization
|
20
|
+
collection :organizations
|
21
|
+
model :location
|
22
|
+
collection :locations
|
23
|
+
model :catalog_item
|
24
|
+
collection :catalog
|
25
|
+
model :catalog_configuration
|
26
|
+
collection :catalog_configurations
|
27
|
+
model :environment
|
28
|
+
collection :environments
|
29
|
+
model :task
|
30
|
+
collection :tasks
|
31
|
+
model :compute_pool
|
32
|
+
collection :compute_pools
|
33
|
+
model :server
|
34
|
+
collection :servers
|
35
|
+
model :virtual_machine_assigned_ip
|
36
|
+
collection :virtual_machine_assigned_ips
|
37
|
+
model :hardware_configuration
|
38
|
+
collection :hardware_configurations
|
39
|
+
model :server_configuration_option
|
40
|
+
collection :server_configuration_options
|
41
|
+
model :guest_process
|
42
|
+
collection :guest_processes
|
43
|
+
model :layout
|
44
|
+
collection :layouts
|
45
|
+
model :row
|
46
|
+
collection :rows
|
47
|
+
model :group
|
48
|
+
collection :groups
|
49
|
+
model :internet_service
|
50
|
+
collection :internet_services
|
51
|
+
model :node
|
52
|
+
collection :nodes
|
53
|
+
model :monitor
|
54
|
+
collection :monitors
|
55
|
+
model :cpu_usage_detail
|
56
|
+
collection :cpu_usage_detail_summary
|
57
|
+
model :memory_usage_detail
|
58
|
+
collection :memory_usage_detail_summary
|
59
|
+
model :storage_usage_detail
|
60
|
+
collection :storage_usage_detail_summary
|
61
|
+
model :operating_system_family
|
62
|
+
collection :operating_system_families
|
63
|
+
model :operating_system
|
64
|
+
collection :operating_systems
|
65
|
+
model :template
|
66
|
+
collection :templates
|
67
|
+
model :firewall_acl
|
68
|
+
collection :firewall_acls
|
69
|
+
model :network
|
70
|
+
collection :networks
|
71
|
+
model :ip_address
|
72
|
+
collection :ip_addresses
|
73
|
+
model :physical_device
|
74
|
+
collection :physical_devices
|
75
|
+
model :public_ip
|
76
|
+
collection :public_ips
|
77
|
+
model :trusted_network_group
|
78
|
+
collection :trusted_network_groups
|
79
|
+
model :backup_internet_service
|
80
|
+
collection :backup_internet_services
|
81
|
+
model :rnat
|
82
|
+
collection :rnats
|
83
|
+
model :association
|
84
|
+
collection :associations
|
85
|
+
model :tag
|
86
|
+
collection :tags
|
87
|
+
model :admin_organization
|
88
|
+
collection :admin_organizations
|
89
|
+
model :ssh_key
|
90
|
+
collection :ssh_keys
|
91
|
+
model :password_complexity_rule
|
92
|
+
collection :password_complexity_rules
|
93
|
+
model :authentication_level
|
94
|
+
collection :authentication_levels
|
95
|
+
model :login_banner
|
96
|
+
collection :login_banners
|
97
|
+
model :user
|
98
|
+
collection :users
|
99
|
+
model :role
|
100
|
+
collection :roles
|
101
|
+
model :ssh_key
|
102
|
+
collection :ssh_keys
|
103
|
+
model :support_ticket
|
104
|
+
collection :support_tickets
|
105
|
+
model :detached_disk
|
106
|
+
collection :detached_disks
|
107
|
+
|
108
|
+
#### Requests
|
109
|
+
request_path "fog/compute/ecloud/requests/"
|
110
|
+
request :backup_internet_service_create
|
111
|
+
request :backup_internet_service_delete
|
112
|
+
request :backup_internet_service_edit
|
113
|
+
request :compute_pool_edit
|
114
|
+
request :firewall_acls_create
|
115
|
+
request :firewall_acls_delete
|
116
|
+
request :get_admin_organization
|
117
|
+
request :get_api_key
|
118
|
+
request :get_api_keys
|
119
|
+
request :get_association
|
120
|
+
request :get_associations
|
121
|
+
request :get_authentication_level
|
122
|
+
request :get_authentication_levels
|
123
|
+
request :get_backup_internet_service
|
124
|
+
request :get_backup_internet_services
|
125
|
+
request :get_catalog
|
126
|
+
request :get_catalog_configuration
|
127
|
+
request :get_catalog_configurations
|
128
|
+
request :get_catalog_item
|
129
|
+
request :get_compute_pool
|
130
|
+
request :get_compute_pools
|
131
|
+
request :get_cpu_usage_detail
|
132
|
+
request :get_cpu_usage_detail_summary
|
133
|
+
request :get_environment
|
134
|
+
request :get_firewall_acl
|
135
|
+
request :get_firewall_acls
|
136
|
+
request :get_group
|
137
|
+
request :get_groups
|
138
|
+
request :get_guest_process
|
139
|
+
request :get_guest_processes
|
140
|
+
request :get_hardware_configuration
|
141
|
+
request :get_internet_service
|
142
|
+
request :get_internet_services
|
143
|
+
request :get_ip_address
|
144
|
+
request :get_layout
|
145
|
+
request :get_layouts
|
146
|
+
request :get_location
|
147
|
+
request :get_locations
|
148
|
+
request :get_login_banner
|
149
|
+
request :get_login_banners
|
150
|
+
request :get_memory_usage_detail
|
151
|
+
request :get_memory_usage_detail_summary
|
152
|
+
request :get_monitor
|
153
|
+
request :get_monitors
|
154
|
+
request :get_network
|
155
|
+
request :get_network_summary
|
156
|
+
request :get_networks
|
157
|
+
request :get_node
|
158
|
+
request :get_nodes
|
159
|
+
request :get_operating_system
|
160
|
+
request :get_operating_system_families
|
161
|
+
request :get_organization
|
162
|
+
request :get_organizations
|
163
|
+
request :get_password_complexity_rule
|
164
|
+
request :get_password_complexity_rules
|
165
|
+
request :get_physical_device
|
166
|
+
request :get_physical_devices
|
167
|
+
request :get_public_ip
|
168
|
+
request :get_public_ips
|
169
|
+
request :get_rnat
|
170
|
+
request :get_rnats
|
171
|
+
request :get_role
|
172
|
+
request :get_roles
|
173
|
+
request :get_row
|
174
|
+
request :get_rows
|
175
|
+
request :get_server
|
176
|
+
request :get_server_configuration_option
|
177
|
+
request :get_server_configuration_options
|
178
|
+
request :get_servers
|
179
|
+
request :get_ssh_key
|
180
|
+
request :get_ssh_keys
|
181
|
+
request :get_storage_usage_detail
|
182
|
+
request :get_storage_usage_detail_summary
|
183
|
+
request :get_support_ticket
|
184
|
+
request :get_support_tickets
|
185
|
+
request :get_tag
|
186
|
+
request :get_tags
|
187
|
+
request :get_task
|
188
|
+
request :get_tasks
|
189
|
+
request :get_template
|
190
|
+
request :get_templates
|
191
|
+
request :get_trusted_network_group
|
192
|
+
request :get_trusted_network_groups
|
193
|
+
request :get_user
|
194
|
+
request :get_users
|
195
|
+
request :get_virtual_machine_assigned_ips
|
196
|
+
request :get_detached_disks
|
197
|
+
request :get_detached_disk
|
198
|
+
request :groups_create
|
199
|
+
request :groups_delete
|
200
|
+
request :groups_edit
|
201
|
+
request :groups_movedown
|
202
|
+
request :groups_moveup
|
203
|
+
request :internet_service_create
|
204
|
+
request :internet_service_delete
|
205
|
+
request :internet_service_edit
|
206
|
+
request :monitors_create_default
|
207
|
+
request :monitors_create_ecv
|
208
|
+
request :monitors_create_http
|
209
|
+
request :monitors_create_loopback
|
210
|
+
request :monitors_create_ping
|
211
|
+
request :monitors_disable
|
212
|
+
request :monitors_edit_ecv
|
213
|
+
request :monitors_edit_http
|
214
|
+
request :monitors_edit_ping
|
215
|
+
request :monitors_enable
|
216
|
+
request :node_service_create
|
217
|
+
request :node_service_delete
|
218
|
+
request :node_service_edit
|
219
|
+
request :power_off
|
220
|
+
request :power_on
|
221
|
+
request :power_reset
|
222
|
+
request :power_shutdown
|
223
|
+
request :public_ip_activate
|
224
|
+
request :rnat_associations_create_device
|
225
|
+
request :rnat_associations_delete
|
226
|
+
request :rnat_associations_edit_network
|
227
|
+
request :rows_create
|
228
|
+
request :rows_delete
|
229
|
+
request :rows_edit
|
230
|
+
request :rows_movedown
|
231
|
+
request :rows_moveup
|
232
|
+
request :trusted_network_groups_create
|
233
|
+
request :trusted_network_groups_delete
|
234
|
+
request :trusted_network_groups_edit
|
235
|
+
request :virtual_machine_edit_assigned_ips
|
236
|
+
request :virtual_machine_copy
|
237
|
+
request :virtual_machine_copy_identical
|
238
|
+
request :virtual_machine_create_from_template
|
239
|
+
request :virtual_machine_delete
|
240
|
+
request :virtual_machine_edit
|
241
|
+
request :virtual_machine_edit_hardware_configuration
|
242
|
+
request :virtual_machine_import
|
243
|
+
request :virtual_machine_upload_file
|
244
|
+
request :virtual_machine_detach_disk
|
245
|
+
request :virtual_machine_attach_disk
|
246
|
+
|
247
|
+
module Shared
|
248
|
+
attr_accessor :base_path
|
249
|
+
attr_reader :versions_uri
|
250
|
+
|
251
|
+
def validate_data(required_opts = [], options = {})
|
252
|
+
unless required_opts.all? { |opt| options.key?(opt) }
|
253
|
+
raise ArgumentError.new("Required data missing: #{(required_opts - options.keys).map(&:inspect).join(', ')}")
|
254
|
+
end
|
255
|
+
end
|
256
|
+
|
257
|
+
def id_from_uri(uri)
|
258
|
+
uri.match(/(\d+)$/)[1].to_i
|
259
|
+
end
|
260
|
+
|
261
|
+
def default_organization_uri
|
262
|
+
"#{@base_path}/organizations"
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
266
|
+
class Real
|
267
|
+
include Shared
|
268
|
+
|
269
|
+
class << self
|
270
|
+
def basic_request(name, expects = [200], method = :get, headers = {}, body = "")
|
271
|
+
define_method(name) do |uri|
|
272
|
+
request(
|
273
|
+
:expects => expects,
|
274
|
+
:method => method,
|
275
|
+
:headers => headers,
|
276
|
+
:body => body,
|
277
|
+
:parse => true,
|
278
|
+
:uri => uri
|
279
|
+
)
|
280
|
+
end
|
281
|
+
end
|
282
|
+
end
|
283
|
+
|
284
|
+
def initialize(options = {})
|
285
|
+
@base_path = options[:base_path] || "/cloudapi/ecloud"
|
286
|
+
@connections = {}
|
287
|
+
@connection_options = options[:connection_options] || {}
|
288
|
+
@host = options[:ecloud_host] || API_URL
|
289
|
+
@persistent = options[:persistent] || false
|
290
|
+
@version = options[:ecloud_version] || "2013-06-01"
|
291
|
+
@authentication_method = options[:ecloud_authentication_method] || :cloud_api_auth
|
292
|
+
@access_key = options[:ecloud_access_key]
|
293
|
+
@private_key = options[:ecloud_private_key]
|
294
|
+
if @private_key.nil? || @authentication_method == :basic_auth
|
295
|
+
@authentication_method = :basic_auth
|
296
|
+
@username = options[:ecloud_username]
|
297
|
+
@password = options[:ecloud_password]
|
298
|
+
if @username.nil? || @password.nil?
|
299
|
+
raise ArgumentError, "No credentials (cloud auth, or basic auth) passed!"
|
300
|
+
end
|
301
|
+
else
|
302
|
+
@hmac = Fog::HMAC.new("sha256", @private_key)
|
303
|
+
end
|
304
|
+
end
|
305
|
+
|
306
|
+
def request(params)
|
307
|
+
# Convert the uri to a URI if it's a string.
|
308
|
+
if params[:uri].is_a?(String)
|
309
|
+
params[:uri] = URI.parse(@host + params[:uri])
|
310
|
+
end
|
311
|
+
host_url = "#{params[:uri].scheme}://#{params[:uri].host}#{params[:uri].port ? ':#{params[:uri].port}' : ''}"
|
312
|
+
|
313
|
+
# Hash connections on the host_url ... There"s nothing to say we won"t get URI"s that go to
|
314
|
+
# different hosts.
|
315
|
+
@connections[host_url] ||= Fog::XML::Connection.new(host_url, @persistent, @connection_options)
|
316
|
+
|
317
|
+
# Set headers to an empty hash if none are set.
|
318
|
+
headers = set_extra_headers_for(params) || set_extra_headers_for({})
|
319
|
+
|
320
|
+
# Make the request
|
321
|
+
options = {
|
322
|
+
:expects => (params[:expects] || 200),
|
323
|
+
:method => params[:method] || "GET",
|
324
|
+
:path => params[:uri].path + "#{"?#{params[:uri].query}" if params[:uri].query}",
|
325
|
+
:headers => headers
|
326
|
+
}
|
327
|
+
unless params[:body].nil? || params[:body].empty?
|
328
|
+
options.merge!(:body => params[:body])
|
329
|
+
end
|
330
|
+
response = @connections[host_url].request(options)
|
331
|
+
# Parse the response body into a hash
|
332
|
+
unless response.body.empty?
|
333
|
+
if params[:parse]
|
334
|
+
document = Fog::ToHashDocument.new
|
335
|
+
parser = Nokogiri::XML::SAX::PushParser.new(document)
|
336
|
+
parser << response.body
|
337
|
+
parser.finish
|
338
|
+
|
339
|
+
response.body = document.body
|
340
|
+
end
|
341
|
+
end
|
342
|
+
|
343
|
+
response
|
344
|
+
end
|
345
|
+
|
346
|
+
private
|
347
|
+
|
348
|
+
# if Authorization and x-tmrk-authorization are used, the x-tmrk-authorization takes precendence.
|
349
|
+
def set_extra_headers_for(params)
|
350
|
+
params[:headers] = {
|
351
|
+
"x-tmrk-version" => @version,
|
352
|
+
"Date" => Time.now.utc.strftime("%a, %d %b %Y %H:%M:%S GMT"),
|
353
|
+
}.merge(params[:headers] || {})
|
354
|
+
if params[:method] == "POST" || params[:method] == "PUT"
|
355
|
+
params[:headers].merge!("Content-Type" => "application/xml") unless params[:headers]["Content-Type"]
|
356
|
+
params[:headers].merge!("Accept" => "application/xml")
|
357
|
+
end
|
358
|
+
unless params[:body].nil? || params[:body].empty?
|
359
|
+
params[:headers].merge!("x-tmrk-contenthash" => "Sha256 #{Base64.encode64(Digest::SHA2.digest(params[:body].to_s)).chomp}")
|
360
|
+
end
|
361
|
+
if @authentication_method == :basic_auth
|
362
|
+
params[:headers].merge!("Authorization" => "Basic #{Base64.encode64(@username + ":" + @password).delete("\r\n")}")
|
363
|
+
elsif @authentication_method == :cloud_api_auth
|
364
|
+
signature = cloud_api_signature(params)
|
365
|
+
params[:headers].merge!(
|
366
|
+
"x-tmrk-authorization" => %{CloudApi AccessKey="#{@access_key}" SignatureType="HmacSha256" Signature="#{signature}"},
|
367
|
+
"Authorization" => %{CloudApi AccessKey="#{@access_key}" SignatureType="HmacSha256" Signature="#{signature}"}
|
368
|
+
)
|
369
|
+
end
|
370
|
+
params[:headers]
|
371
|
+
end
|
372
|
+
|
373
|
+
def cloud_api_signature(params)
|
374
|
+
verb = params[:method].upcase
|
375
|
+
headers = params[:headers]
|
376
|
+
path = params[:uri].path
|
377
|
+
canonicalized_headers = canonicalize_headers(headers)
|
378
|
+
canonicalized_resource = canonicalize_resource(path)
|
379
|
+
string = [
|
380
|
+
verb,
|
381
|
+
headers["Content-Length"].to_s,
|
382
|
+
headers["Content-Type"].to_s,
|
383
|
+
headers["Date"].to_s,
|
384
|
+
canonicalized_headers,
|
385
|
+
canonicalized_resource + "\n"
|
386
|
+
].join("\n")
|
387
|
+
Base64.encode64(@hmac.sign(string)).chomp
|
388
|
+
end
|
389
|
+
|
390
|
+
# section 5.6.3.2 in the ~1000 page pdf spec
|
391
|
+
def canonicalize_headers(headers)
|
392
|
+
tmp = headers.inject({}) do |ret, h|
|
393
|
+
ret[h.first.downcase] = h.last if h.first.match(/^x-tmrk/i)
|
394
|
+
ret
|
395
|
+
end
|
396
|
+
tmp.reject! { |k, _v| k == "x-tmrk-authorization" }
|
397
|
+
tmp = tmp.sort.map { |e| "#{e.first}:#{e.last}" }.join("\n")
|
398
|
+
tmp
|
399
|
+
end
|
400
|
+
|
401
|
+
# section 5.6.3.3 in the ~1000 page pdf spec
|
402
|
+
def canonicalize_resource(path)
|
403
|
+
uri, query_string = path.split("?")
|
404
|
+
return uri if query_string.nil?
|
405
|
+
query_string_pairs = query_string.split("&").sort.map { |e| e.split("=") }
|
406
|
+
tm_query_string = query_string_pairs.map { |x| "#{x.first.downcase}:#{x.last}" }.join("\n")
|
407
|
+
"#{uri.downcase}\n#{tm_query_string}\n"
|
408
|
+
end
|
409
|
+
end
|
410
|
+
|
411
|
+
class Mock
|
412
|
+
include Shared
|
413
|
+
|
414
|
+
def self.data
|
415
|
+
@data ||= Hash.new do |hash, key|
|
416
|
+
hash[key] = begin
|
417
|
+
compute_pool_id = Fog.credentials[:ecloud_compute_pool_id] || Fog::Mock.random_numbers(3).to_i
|
418
|
+
environment_id = Fog.credentials[:ecloud_environment_id] || Fog::Mock.random_numbers(3).to_i
|
419
|
+
public_ip_id = Fog.credentials[:ecloud_public_ip_id] || Fog::Mock.random_numbers(6).to_i
|
420
|
+
internet_service_id = Fog::Mock.random_numbers(6).to_i
|
421
|
+
node_service_id = Fog::Mock.random_numbers(6).to_i
|
422
|
+
environment_name = Fog.credentials[:ecloud_environment_name] || Fog::Mock.random_letters(12)
|
423
|
+
location_id = Fog::Mock.random_numbers(4).to_i
|
424
|
+
network_id = Fog.credentials[:ecloud_network_id] || Fog::Mock.random_numbers(6).to_i
|
425
|
+
network_ip = Fog::Ecloud.ip_address
|
426
|
+
public_ip = Fog.credentials[:ecloud_public_ip_name] || Fog::Ecloud.ip_address
|
427
|
+
ip_address_id = Fog::Ecloud.ip_address
|
428
|
+
ip_address2_id = Fog::Ecloud.ip_address
|
429
|
+
operating_system_id = Fog::Mock.random_numbers(7).to_i
|
430
|
+
operating_system_family_id = Fog::Mock.random_numbers(7).to_i
|
431
|
+
organization_id = Fog::Mock.random_numbers(7).to_i
|
432
|
+
organization_name = Fog::Mock.random_letters(7)
|
433
|
+
template_id = Fog.credentials[:ecloud_template_id] || Fog::Mock.random_numbers(7).to_i
|
434
|
+
ssh_key_id = Fog.credentials[:ecloud_ssh_key_id] || Fog::Mock.random_numbers(4).to_i
|
435
|
+
ssh_key_name = Fog.credentials[:ecloud_ssh_key_name] || "root"
|
436
|
+
|
437
|
+
environment = {
|
438
|
+
:id => environment_id,
|
439
|
+
:href => "/cloudapi/ecloud/environments/#{environment_id}",
|
440
|
+
:name => environment_name,
|
441
|
+
:type => "application/vnd.tmrk.cloud.environment"
|
442
|
+
}
|
443
|
+
|
444
|
+
organization = {
|
445
|
+
:href => "/cloudapi/ecloud/organizations/#{organization_id}",
|
446
|
+
:type => "application/vnd.tmrk.cloud.organization",
|
447
|
+
:name => organization_name,
|
448
|
+
:Links => {
|
449
|
+
:Link => [
|
450
|
+
Fog::Ecloud.keep(environment, :href, :name, :type),
|
451
|
+
{
|
452
|
+
:href => "/cloudapi/ecloud/admin/organizations/#{organization_id}",
|
453
|
+
:name => organization_name,
|
454
|
+
:type => "application/vnd.tmrk.cloud.admin.organization",
|
455
|
+
:rel => "alternate",
|
456
|
+
},
|
457
|
+
{
|
458
|
+
:href => "/cloudapi/ecloud/devicetags/organizations/#{organization_id}",
|
459
|
+
:type => "application/vnd.tmrk.cloud.deviceTag; type=collection",
|
460
|
+
:rel => "down",
|
461
|
+
},
|
462
|
+
{
|
463
|
+
:href => "/cloudapi/ecloud/alerts/organizations/#{organization_id}",
|
464
|
+
:type => "application/vnd.tmrk.cloud.alertLog",
|
465
|
+
:rel => "down",
|
466
|
+
},
|
467
|
+
],
|
468
|
+
},
|
469
|
+
:Locations => {
|
470
|
+
:Location => [
|
471
|
+
{
|
472
|
+
:href => "/cloudapi/ecloud/locations/#{location_id}",
|
473
|
+
:name => organization_name,
|
474
|
+
:Catalog => {
|
475
|
+
:href => "/cloudapi/ecloud/admin/catalog/organizations/#{organization_id}/locations/#{location_id}",
|
476
|
+
:type => "application/vnd.tmrk.cloud.admin.catalogEntry; type=collection"
|
477
|
+
},
|
478
|
+
:Environments => { :Environment => [environment] }
|
479
|
+
}
|
480
|
+
]
|
481
|
+
}
|
482
|
+
}
|
483
|
+
environment.merge!(
|
484
|
+
:Links => {
|
485
|
+
:Link => [Fog::Ecloud.keep(organization, :href, :name, :type)]
|
486
|
+
}
|
487
|
+
)
|
488
|
+
|
489
|
+
admin_organization = {
|
490
|
+
:id => organization_id,
|
491
|
+
:href => "/cloudapi/ecloud/admin/organizations/#{organization_id}",
|
492
|
+
:type => "application/vnd.tmrk.cloud.admin.organization",
|
493
|
+
:name => organization_name,
|
494
|
+
:Links => {
|
495
|
+
:Link => [
|
496
|
+
Fog::Ecloud.keep(organization, :href, :type, :name)
|
497
|
+
],
|
498
|
+
},
|
499
|
+
:organization_id => organization_id,
|
500
|
+
}
|
501
|
+
|
502
|
+
compute_pool = {
|
503
|
+
:id => compute_pool_id,
|
504
|
+
:href => "/cloudapi/ecloud/computepools/#{compute_pool_id}",
|
505
|
+
:name => Fog::Mock.random_letters(12),
|
506
|
+
:type => "application/vnd.tmrk.cloud.computePool",
|
507
|
+
:environment_id => environment_id,
|
508
|
+
:Links => {
|
509
|
+
:Link => [
|
510
|
+
Fog::Ecloud.keep(organization, :href, :name, :type),
|
511
|
+
Fog::Ecloud.keep(environment, :href, :name, :type),
|
512
|
+
]
|
513
|
+
}
|
514
|
+
}
|
515
|
+
|
516
|
+
public_ip = {
|
517
|
+
:id => public_ip_id,
|
518
|
+
:href => "/cloudapi/ecloud/publicips/#{public_ip_id}",
|
519
|
+
:name => public_ip,
|
520
|
+
:type => "application/vnd.tmrk.cloud.publicIp",
|
521
|
+
:IpType => "none",
|
522
|
+
:environment_id => environment_id,
|
523
|
+
:Links => {
|
524
|
+
:Link => [
|
525
|
+
Fog::Ecloud.keep(environment, :href, :name, :type),
|
526
|
+
],
|
527
|
+
},
|
528
|
+
:InternetServices => {
|
529
|
+
:InternetService => [
|
530
|
+
],
|
531
|
+
},
|
532
|
+
}
|
533
|
+
|
534
|
+
internet_service = {
|
535
|
+
:id => internet_service_id,
|
536
|
+
:href => "/cloudapi/ecloud/internetservices/#{internet_service_id}",
|
537
|
+
:name => Fog::Mock.random_letters(6),
|
538
|
+
:type => "application/vnd.tmrk.cloud.internetService",
|
539
|
+
:public_ip_id => public_ip_id,
|
540
|
+
:Links => {
|
541
|
+
:Link => [
|
542
|
+
Fog::Ecloud.keep(public_ip, :href, :name, :type),
|
543
|
+
],
|
544
|
+
},
|
545
|
+
:NodeServices => {
|
546
|
+
:NodeService => [
|
547
|
+
]
|
548
|
+
},
|
549
|
+
}
|
550
|
+
|
551
|
+
node_service = {
|
552
|
+
:id => node_service_id,
|
553
|
+
:href => "/cloudapi/ecloud/nodeservices/#{node_service_id}",
|
554
|
+
:name => Fog::Mock.random_letters(6),
|
555
|
+
:type => "application/vnd.tmrk.cloud.nodeService",
|
556
|
+
:internet_service_id => internet_service_id,
|
557
|
+
:Links => {
|
558
|
+
:Link => [
|
559
|
+
Fog::Ecloud.keep(internet_service, :href, :name, :type)
|
560
|
+
],
|
561
|
+
},
|
562
|
+
}
|
563
|
+
|
564
|
+
internet_service[:NodeServices][:NodeService].push(node_service)
|
565
|
+
public_ip[:InternetServices][:InternetService].push(internet_service)
|
566
|
+
|
567
|
+
network = {
|
568
|
+
:id => network_id,
|
569
|
+
:href => "/cloudapi/ecloud/networks/#{network_id}",
|
570
|
+
:name => "#{network_ip}/#{Fog::Mock.random_numbers(2)}",
|
571
|
+
:type => "application/vnd.tmrk.cloud.network",
|
572
|
+
:Address => network_ip,
|
573
|
+
:NetworkType => "Dmz",
|
574
|
+
:BroadcastAddress => network_ip,
|
575
|
+
:GatewayAddress => network_ip,
|
576
|
+
:environment_id => environment_id,
|
577
|
+
:Links => {
|
578
|
+
:Link => [
|
579
|
+
Fog::Ecloud.keep(environment, :href, :name, :type),
|
580
|
+
]
|
581
|
+
},
|
582
|
+
:IpAddresses => {
|
583
|
+
:IpAddress => [],
|
584
|
+
},
|
585
|
+
}
|
586
|
+
|
587
|
+
ip_address = {
|
588
|
+
:id => ip_address_id,
|
589
|
+
:href => "/cloudapi/ecloud/ipaddresses/networks/#{network_id}/#{ip_address_id}",
|
590
|
+
:name => ip_address_id,
|
591
|
+
:type => "application/vnd.tmrk.cloud.ipAddress",
|
592
|
+
:network_id => network_id,
|
593
|
+
:Links => {
|
594
|
+
:Link => [Fog::Ecloud.keep(network, :href, :name, :type)]
|
595
|
+
},
|
596
|
+
:Reserved => "false",
|
597
|
+
:Host => nil,
|
598
|
+
:DetectedOn => nil
|
599
|
+
}
|
600
|
+
|
601
|
+
ip_address2 = ip_address.dup.merge(:id => ip_address2_id, :href => "/cloudapi/ecloud/ipaddresses/networks/#{network_id}/#{ip_address2_id}", :name => ip_address2_id)
|
602
|
+
|
603
|
+
network[:IpAddresses][:IpAddress].push(ip_address).push(ip_address2)
|
604
|
+
|
605
|
+
short_name = "solaris10_64guest"
|
606
|
+
operating_system = {
|
607
|
+
:short_name => short_name,
|
608
|
+
:compute_pool_id => compute_pool_id,
|
609
|
+
:href => "/cloudapi/ecloud/operatingsystems/#{short_name}/computepools/#{compute_pool_id}",
|
610
|
+
:name => "Sun Solaris 10 (64-bit)",
|
611
|
+
:type => "application/vnd.tmrk.cloud.operatingSystem",
|
612
|
+
:FamilyName => "Solaris",
|
613
|
+
:Links => {
|
614
|
+
:Link => Fog::Ecloud.keep(compute_pool, :href, :name, :type),
|
615
|
+
},
|
616
|
+
:ConfigurationOptions => {
|
617
|
+
:Processor => {
|
618
|
+
:Minimum => "1",
|
619
|
+
:Maximum => "8",
|
620
|
+
:StepFactor => "1"
|
621
|
+
},
|
622
|
+
:Memory => {
|
623
|
+
:MinimumSize => {
|
624
|
+
:Unit => "MB",
|
625
|
+
:Value => "800"
|
626
|
+
},
|
627
|
+
:MaximumSize => {
|
628
|
+
:Unit => "MB",
|
629
|
+
:Value => "16384"
|
630
|
+
},
|
631
|
+
:StepFactor => {
|
632
|
+
:Unit => "MB",
|
633
|
+
:Value => "4"
|
634
|
+
}
|
635
|
+
},
|
636
|
+
:Disk => {
|
637
|
+
:Minimum => "1",
|
638
|
+
:Maximum => "15",
|
639
|
+
:SystemDisk => {
|
640
|
+
:ResourceCapacityRange => {
|
641
|
+
:MinimumSize => {
|
642
|
+
:Unit => "GB",
|
643
|
+
:Value => "1"
|
644
|
+
},
|
645
|
+
:MaximumSize => {
|
646
|
+
:Unit => "GB",
|
647
|
+
:Value => "512"
|
648
|
+
},
|
649
|
+
:StepFactor => {
|
650
|
+
:Unit => "GB",
|
651
|
+
:Value => "1"
|
652
|
+
}
|
653
|
+
},
|
654
|
+
:MonthlyCost => "0"
|
655
|
+
},
|
656
|
+
:DataDisk => {
|
657
|
+
:ResourceCapacityRange => {
|
658
|
+
:MinimumSize => {
|
659
|
+
:Unit => "GB",
|
660
|
+
:Value => "1"
|
661
|
+
},
|
662
|
+
:MaximumSize => {
|
663
|
+
:Unit => "GB",
|
664
|
+
:Value => "512"
|
665
|
+
},
|
666
|
+
:StepFactor => {
|
667
|
+
:Unit => "GB",
|
668
|
+
:Value => "1"
|
669
|
+
}
|
670
|
+
},
|
671
|
+
:MonthlyCost => "0"
|
672
|
+
}
|
673
|
+
},
|
674
|
+
:NetworkAdapter => {
|
675
|
+
:Minimum => "1",
|
676
|
+
:Maximum => "4",
|
677
|
+
:StepFactor => "1"
|
678
|
+
}
|
679
|
+
}
|
680
|
+
}
|
681
|
+
|
682
|
+
template = {
|
683
|
+
:id => template_id,
|
684
|
+
:href => "/cloudapi/ecloud/templates/#{template_id}/computepools/#{compute_pool_id}",
|
685
|
+
:type => "application/vnd.tmrk.cloud.template",
|
686
|
+
:name => "Sun Solaris 10 (x64)",
|
687
|
+
:compute_pool_id => compute_pool_id,
|
688
|
+
:OperatingSystem => Fog::Ecloud.keep(operating_system, :href, :name, :type),
|
689
|
+
:Memory => {
|
690
|
+
:MinimumSize => {
|
691
|
+
:Unit => "MB",
|
692
|
+
:Value => "800"
|
693
|
+
},
|
694
|
+
:MaximumSize => {
|
695
|
+
:Unit => "MB",
|
696
|
+
:Value => "16384"
|
697
|
+
},
|
698
|
+
:StepFactor => {
|
699
|
+
:Unit => "MB",
|
700
|
+
:Value => "4"
|
701
|
+
}
|
702
|
+
},
|
703
|
+
:Storage => {
|
704
|
+
:Size => {
|
705
|
+
:Unit => "GB",
|
706
|
+
:Value => "7"
|
707
|
+
}
|
708
|
+
},
|
709
|
+
:NetworkAdapters => "1",
|
710
|
+
:Links => {
|
711
|
+
:Link => [
|
712
|
+
Fog::Ecloud.keep(compute_pool, :href, :name, :type),
|
713
|
+
]
|
714
|
+
}
|
715
|
+
}
|
716
|
+
|
717
|
+
operating_system_family = {
|
718
|
+
:id => operating_system_family_id,
|
719
|
+
:compute_pool_id => compute_pool_id,
|
720
|
+
:OperatingSystemFamily => {
|
721
|
+
:Name => "Linux",
|
722
|
+
:OperatingSystems => {
|
723
|
+
:OperatingSystem => [Fog::Ecloud.keep(operating_system, :href, :name, :type)],
|
724
|
+
}
|
725
|
+
},
|
726
|
+
:Links => {
|
727
|
+
:Link => [
|
728
|
+
Fog::Ecloud.keep(compute_pool, :href, :name, :type),
|
729
|
+
]
|
730
|
+
}
|
731
|
+
}
|
732
|
+
|
733
|
+
ssh_key = {
|
734
|
+
:id => ssh_key_id,
|
735
|
+
:href => "/cloudapi/ecloud/admin/sshKeys/#{ssh_key_id}",
|
736
|
+
:name => ssh_key_name,
|
737
|
+
:admin_organization_id => organization_id,
|
738
|
+
:Links => {
|
739
|
+
:Link => [
|
740
|
+
Fog::Ecloud.keep(admin_organization, :href, :name, :type),
|
741
|
+
Fog::Ecloud.keep(organization, :href, :name, :type),
|
742
|
+
]
|
743
|
+
},
|
744
|
+
:Default => "true",
|
745
|
+
:FingerPrint => Fog::Ecloud.mac_address
|
746
|
+
}
|
747
|
+
|
748
|
+
layout = {
|
749
|
+
:id => environment_id,
|
750
|
+
:href => "/cloudapi/ecloud/layout/environments/#{environment_id}",
|
751
|
+
:type => "application/vnd.tmrk.cloud.deviceLayout",
|
752
|
+
:Links => {
|
753
|
+
:Link => [
|
754
|
+
Fog::Ecloud.keep(environment, :name, :href, :type),
|
755
|
+
],
|
756
|
+
},
|
757
|
+
:Rows => {
|
758
|
+
:Row => [
|
759
|
+
],
|
760
|
+
},
|
761
|
+
:environment_id => environment_id
|
762
|
+
}
|
763
|
+
|
764
|
+
{
|
765
|
+
:compute_pools => { compute_pool_id => compute_pool },
|
766
|
+
:environments => { environment_id => environment },
|
767
|
+
:public_ips => { public_ip_id => public_ip },
|
768
|
+
:internet_services => { internet_service_id => internet_service },
|
769
|
+
:node_services => { node_service_id => node_service },
|
770
|
+
:networks => { network_id => network },
|
771
|
+
:organizations => { organization_id => organization },
|
772
|
+
:admin_organizations => { organization_id => admin_organization },
|
773
|
+
:operating_systems => { operating_system_id => operating_system },
|
774
|
+
:operating_system_families => { operating_system_family_id => operating_system_family },
|
775
|
+
:servers => {},
|
776
|
+
:tasks => {},
|
777
|
+
:templates => { template_id => template },
|
778
|
+
:ssh_keys => { ssh_key_id => ssh_key },
|
779
|
+
:detached_disks => {},
|
780
|
+
:template_href => (Fog.credentials[:ecloud_template_href] || "/cloudapi/ecloud/templates/#{template_id}/computepools/#{compute_pool_id}"),
|
781
|
+
:rows => {},
|
782
|
+
:groups => {},
|
783
|
+
:layouts => { environment_id => layout }
|
784
|
+
}
|
785
|
+
end
|
786
|
+
end
|
787
|
+
end
|
788
|
+
|
789
|
+
def self.reset
|
790
|
+
@data = nil
|
791
|
+
end
|
792
|
+
|
793
|
+
def initialize(options = {})
|
794
|
+
@base_path = "/cloudapi/ecloud"
|
795
|
+
@ecloud_api_key = options[:ecloud]
|
796
|
+
end
|
797
|
+
|
798
|
+
def data
|
799
|
+
self.class.data[@ecloud_api_key]
|
800
|
+
end
|
801
|
+
|
802
|
+
def reset_data
|
803
|
+
self.class.data.delete(@ecloud_api_key)
|
804
|
+
end
|
805
|
+
|
806
|
+
def response(params = {})
|
807
|
+
body = params[:body]
|
808
|
+
headers = {
|
809
|
+
"Content-Type" => "application/xml"
|
810
|
+
}.merge(params[:headers] || {})
|
811
|
+
status = params[:status] || 200
|
812
|
+
|
813
|
+
response = Excon::Response.new(:body => body, :headers => headers, :status => status)
|
814
|
+
if params.key?(:expects) && ![*params[:expects]].include?(response.status)
|
815
|
+
raise(Excon::Errors.status_error(params, response))
|
816
|
+
else response
|
817
|
+
end
|
818
|
+
end
|
819
|
+
|
820
|
+
def deep_copy(o)
|
821
|
+
Marshal.load(Marshal.dump(o))
|
822
|
+
end
|
823
|
+
end
|
824
|
+
end
|
825
|
+
end
|
826
|
+
end
|