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,72 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ecloud
|
4
|
+
class Real
|
5
|
+
def password_complexity_rules_edit(data)
|
6
|
+
validate_data([:rule_type], data)
|
7
|
+
if data[:rule_type] == "Custom"
|
8
|
+
raise ArgumentError.new("Required data missing: custom_rules") unless data[:custom_rules]
|
9
|
+
end
|
10
|
+
validate_data([:minimum_characters, :minimum_uppercase_characters, :minimum_lowercase_characters, :minimum_numeric_characters, :minimum_special_characters, :maximum_consecutive_characters_from_prior_passwords, :minimum_lifetime_restriction, :minimum_generations_before_reuse], data[:custom_rules])
|
11
|
+
body = build_password_complexity_rules_edit(data)
|
12
|
+
request(
|
13
|
+
:expects => 202,
|
14
|
+
:method => 'PUT',
|
15
|
+
:headers => {},
|
16
|
+
:body => body,
|
17
|
+
:uri => data[:uri],
|
18
|
+
:parse => true
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def build_password_complexity_rules_edit(data)
|
25
|
+
xml = Builder::XmlMarkup.new
|
26
|
+
xml.PasswordComplexityRules do
|
27
|
+
xml.RuleType data[:rule_type]
|
28
|
+
if data[:rule_type] == "Custom"
|
29
|
+
xml.CustomRules do
|
30
|
+
xml.MinimumCharacters do
|
31
|
+
xml.Enabled data[:custom_rules][:minimum_characters][:enabled]
|
32
|
+
xml.Value data[:custom_rules][:minimum_characters][:value]
|
33
|
+
end
|
34
|
+
xml.MinimumUpperCaseCharacters do
|
35
|
+
xml.Enabled data[:custom_rules][:minimum_uppercase_characters][:enabled]
|
36
|
+
xml.Value data[:custom_rules][:minimum_uppercase_characters][:value]
|
37
|
+
end
|
38
|
+
xml.MinimumLowerCaseCharacters do
|
39
|
+
xml.Enabled data[:custom_rules][:minimum_lowercase_characters][:enabled]
|
40
|
+
xml.Value data[:custom_rules][:minimum_lowercase_characters][:value]
|
41
|
+
end
|
42
|
+
xml.MinimumNumericCharacters do
|
43
|
+
xml.Enabled data[:custom_rules][:minimum_numeric_characters][:enabled]
|
44
|
+
xml.Value data[:custom_rules][:minimum_numeric_characters][:value]
|
45
|
+
end
|
46
|
+
xml.MinimumSpecialCharacters do
|
47
|
+
xml.Enabled data[:custom_rules][:minimum_special_characters][:enabled]
|
48
|
+
xml.Value data[:custom_rules][:minimum_special_characters][:value]
|
49
|
+
end
|
50
|
+
xml.MaximumConsecutiveCharactersFromPriorPasswords do
|
51
|
+
xml.Enabled data[:custom_rules][:maximum_consecutive_characters_from_prior_passwords][:enabled]
|
52
|
+
xml.Value data[:custom_rules][:maximum_consecutive_characters_from_prior_passwords][:value]
|
53
|
+
end
|
54
|
+
xml.MinimumLifetimeRestriction do
|
55
|
+
xml.Enabled data[:custom_rules][:minimum_lifetime_restriction][:enabled]
|
56
|
+
xml.Value data[:custom_rules][:minimum_lifetime_restriction][:value]
|
57
|
+
end
|
58
|
+
xml.MinimumGenerationsBeforeReuse do
|
59
|
+
xml.Enabled data[:custom_rules][:minimum_generations_before_reuse][:enabled]
|
60
|
+
xml.Value data[:custom_rules][:minimum_generations_before_reuse][:value]
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
if data[:description]
|
65
|
+
xml.Description data[:description]
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ecloud
|
4
|
+
class Real
|
5
|
+
include Shared
|
6
|
+
|
7
|
+
def backup_internet_service_create(data)
|
8
|
+
validate_data([:name, :protocol, :enabled, :persistence], data)
|
9
|
+
unless data[:persistence][:type]
|
10
|
+
raise ArgumentError.new("Required data missing: :persistence[:type]")
|
11
|
+
end
|
12
|
+
|
13
|
+
request(
|
14
|
+
:body => generate_backup_internet_service_request(data),
|
15
|
+
:expects => 201,
|
16
|
+
:method => "POST",
|
17
|
+
:headers => {},
|
18
|
+
:uri => data[:uri],
|
19
|
+
:parse => true
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def generate_backup_internet_service_request(data)
|
26
|
+
xml = Builder::XmlMarkup.new
|
27
|
+
xml.CreateBackupInternetService(:name => data[:name]) do
|
28
|
+
xml.Protocol data[:protocol]
|
29
|
+
xml.Enabled data[:enabled]
|
30
|
+
if data[:description]
|
31
|
+
xml.Description data[:description]
|
32
|
+
end
|
33
|
+
xml.Persistence do
|
34
|
+
xml.Type data[:persistence][:type]
|
35
|
+
if data[:persistence][:timeout]
|
36
|
+
xml.Timeout data[:persistence][:timeout]
|
37
|
+
end
|
38
|
+
end
|
39
|
+
if data[:redirect_url]
|
40
|
+
xml.RedirectUrl data[:redirect_url]
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ecloud
|
4
|
+
class Real
|
5
|
+
include Shared
|
6
|
+
|
7
|
+
def backup_internet_service_edit(data)
|
8
|
+
validate_data([:name, :protocol, :enabled, :persistence], data)
|
9
|
+
unless data[:persistence][:type]
|
10
|
+
raise ArgumentError.new("Required data missing: :persistence[:type]")
|
11
|
+
end
|
12
|
+
|
13
|
+
request(
|
14
|
+
:body => generate_backup_internet_service_request(data),
|
15
|
+
:expects => 202,
|
16
|
+
:method => "PUT",
|
17
|
+
:headers => {},
|
18
|
+
:uri => data[:uri],
|
19
|
+
:parse => true
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def generate_backup_internet_service_request(data)
|
26
|
+
xml = Builder::XmlMarkup.new
|
27
|
+
xml.BackupInternetService(:name => data[:name]) do
|
28
|
+
xml.Protocol data[:protocol]
|
29
|
+
xml.Enabled data[:enabled]
|
30
|
+
if data[:description]
|
31
|
+
xml.Description data[:description]
|
32
|
+
end
|
33
|
+
xml.Persistence do
|
34
|
+
xml.Type data[:persistence][:type]
|
35
|
+
if data[:persistence][:timeout]
|
36
|
+
xml.Timeout data[:persistence][:timeout]
|
37
|
+
end
|
38
|
+
end
|
39
|
+
if data[:redirect_url]
|
40
|
+
xml.RedirectUrl data[:redirect_url]
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ecloud
|
4
|
+
module Shared
|
5
|
+
def validate_edit_compute_pool_options(options)
|
6
|
+
required_opts = [:name]
|
7
|
+
unless required_opts.all? { |opt| options.key?(opt) }
|
8
|
+
raise ArgumentError.new("Required data missing: #{(required_opts - options.keys).map(&:inspect).join(", ")}")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def build_compute_pool_body_edit(options)
|
13
|
+
xml = Builder::XmlMarkup.new
|
14
|
+
xml.ComputePool(:name => options[:name]) do
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class Real
|
20
|
+
def compute_pool_edit(options)
|
21
|
+
validate_edit_compute_pool_options(options)
|
22
|
+
body = build_compute_pool_body_edit(options)
|
23
|
+
request(
|
24
|
+
:expects => 200,
|
25
|
+
:method => 'PUT',
|
26
|
+
:headers => {},
|
27
|
+
:body => body,
|
28
|
+
:uri => options[:uri],
|
29
|
+
:parse => true
|
30
|
+
)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ecloud
|
4
|
+
class Real
|
5
|
+
include Shared
|
6
|
+
|
7
|
+
def firewall_acls_create(data)
|
8
|
+
validate_data([:permission, :protocol, :source, :destination], data)
|
9
|
+
raise ArgumentError.new("Required data missing: source[:type] is required") unless data[:source][:type]
|
10
|
+
raise ArgumentError.new("Required data missing: destination[:type] is required") unless data[:destination][:type]
|
11
|
+
|
12
|
+
request(
|
13
|
+
:body => generate_create_firewall_acls_request(data),
|
14
|
+
:expects => 201,
|
15
|
+
:method => "POST",
|
16
|
+
:headers => {},
|
17
|
+
:uri => data[:uri],
|
18
|
+
:parse => true
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def generate_create_firewall_acls_request(data)
|
25
|
+
xml = Builder::XmlMarkup.new
|
26
|
+
xml.CreateFirewallAcl do
|
27
|
+
xml.Permission data[:permission]
|
28
|
+
xml.Protocol data[:protocol]
|
29
|
+
xml.Source do
|
30
|
+
xml.Type data[:source][:type]
|
31
|
+
if data[:source][:external_ip_address]
|
32
|
+
xml.ExternalIpAddress data[:external_ip_address]
|
33
|
+
end
|
34
|
+
if data[:source][:external_network]
|
35
|
+
xml.ExternalNetwork do
|
36
|
+
xml.Address data[:source][:external_network][:address]
|
37
|
+
xml.Size data[:source][:external_network][:size]
|
38
|
+
end
|
39
|
+
end
|
40
|
+
if data[:source][:ip_address]
|
41
|
+
xml.IpAddress(:href => data[:source][:ip_address])
|
42
|
+
end
|
43
|
+
if data[:source][:network]
|
44
|
+
xml.Network(:href => data[:source][:network][:href], :name => data[:source][:network][:name])
|
45
|
+
end
|
46
|
+
end
|
47
|
+
xml.Destination do
|
48
|
+
xml.Type data[:destination][:type]
|
49
|
+
if data[:destination][:external_ip_address]
|
50
|
+
xml.ExternalIpAddress data[:external_ip_address]
|
51
|
+
end
|
52
|
+
if data[:destination][:external_network]
|
53
|
+
xml.ExternalNetwork do
|
54
|
+
xml.Address data[:destination][:external_network][:address]
|
55
|
+
xml.Size data[:destination][:external_network][:size]
|
56
|
+
end
|
57
|
+
end
|
58
|
+
if data[:destination][:ip_address]
|
59
|
+
xml.IpAddress(:href => data[:destination][:ip_address])
|
60
|
+
end
|
61
|
+
if data[:destination][:network]
|
62
|
+
xml.Network(:href => data[:destination][:network][:href], :name => data[:destination][:network][:name])
|
63
|
+
end
|
64
|
+
end
|
65
|
+
xml.PortRange do
|
66
|
+
if data[:port_range][:start]
|
67
|
+
xml.Start data[:port_range][:start]
|
68
|
+
end
|
69
|
+
if data[:port_range][:end]
|
70
|
+
xml.End data[:port_range][:end]
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ecloud
|
4
|
+
class Real
|
5
|
+
basic_request :get_admin_organization
|
6
|
+
end
|
7
|
+
|
8
|
+
class Mock
|
9
|
+
def get_admin_organization(uri)
|
10
|
+
organization_id = id_from_uri(uri)
|
11
|
+
admin_organization = self.data[:admin_organizations][organization_id]
|
12
|
+
|
13
|
+
if admin_organization
|
14
|
+
body = Fog::Ecloud.slice(admin_organization, :id, :organization_id)
|
15
|
+
|
16
|
+
response(:body => body)
|
17
|
+
else response(:status => 404) # ?
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ecloud
|
4
|
+
class Real
|
5
|
+
basic_request :get_compute_pool
|
6
|
+
end
|
7
|
+
|
8
|
+
class Mock
|
9
|
+
def get_compute_pool(uri)
|
10
|
+
compute_pool_id = id_from_uri(uri)
|
11
|
+
compute_pool = self.data[:compute_pools][compute_pool_id]
|
12
|
+
|
13
|
+
if compute_pool
|
14
|
+
response(:body => Fog::Ecloud.slice(compute_pool, :id, :environment))
|
15
|
+
else response(:status => 404) # ?
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ecloud
|
4
|
+
class Real
|
5
|
+
basic_request :get_compute_pools
|
6
|
+
end
|
7
|
+
|
8
|
+
class Mock
|
9
|
+
def get_compute_pools(uri) # /cloudapi/ecloud/computepools/environments/534
|
10
|
+
environment_id = id_from_uri(uri)
|
11
|
+
environment = self.data[:environments][environment_id]
|
12
|
+
|
13
|
+
compute_pools = self.data[:compute_pools].values.select{|cp| cp[:environment_id] == environment_id}
|
14
|
+
|
15
|
+
compute_pools = compute_pools.map{|cp| Fog::Ecloud.slice(cp, :id, :environment_id)}
|
16
|
+
|
17
|
+
compute_pool_response = {:ComputePool => (compute_pools.size > 1 ? compute_pools : compute_pools.first)} # GAH
|
18
|
+
body = {
|
19
|
+
:href => uri,
|
20
|
+
:type => "application/vnd.tmrk.cloud.computePool; type=collection",
|
21
|
+
:Links => {
|
22
|
+
:Link => environment,
|
23
|
+
}
|
24
|
+
}.merge(compute_pool_response)
|
25
|
+
|
26
|
+
response(:body => body)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ecloud
|
4
|
+
class Real
|
5
|
+
basic_request :get_detached_disk
|
6
|
+
end
|
7
|
+
|
8
|
+
class Mock
|
9
|
+
def get_detached_disk(uri)
|
10
|
+
detached_disk_id = id_from_uri(uri)
|
11
|
+
detached_disk = self.data[:detached_disks][detached_disk_id]
|
12
|
+
|
13
|
+
if detached_disk
|
14
|
+
response(:body => Fog::Ecloud.slice(detached_disk, :id, :compute_pool_id))
|
15
|
+
else raise Fog::Errors::NotFound
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ecloud
|
4
|
+
class Real
|
5
|
+
basic_request :get_detached_disks
|
6
|
+
end
|
7
|
+
|
8
|
+
class Mock
|
9
|
+
def get_detached_disks(uri)
|
10
|
+
compute_pool_id = id_from_uri(uri)
|
11
|
+
compute_pool = self.data[:compute_pools][compute_pool_id]
|
12
|
+
|
13
|
+
detached_disks = self.data[:detached_disks].values.select{|cp| cp[:compute_pool_id] == compute_pool_id}
|
14
|
+
|
15
|
+
detached_disks = detached_disks.map{|dd| Fog::Ecloud.slice(dd, :id, :compute_pool_id)}
|
16
|
+
|
17
|
+
detached_disk_response = {:DetachedDisk => (detached_disks.size > 1 ? detached_disks : detached_disks.first)} # GAH
|
18
|
+
body = {
|
19
|
+
:href => uri,
|
20
|
+
:type => "application/vnd.tmrk.cloud.detachedDisk; type=collection",
|
21
|
+
:Links => {
|
22
|
+
:Link => Fog::Ecloud.keep(compute_pool, :name, :href, :type),
|
23
|
+
}
|
24
|
+
}.merge(detached_disk_response)
|
25
|
+
|
26
|
+
response(:body => body)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ecloud
|
4
|
+
class Real
|
5
|
+
basic_request :get_environment
|
6
|
+
end
|
7
|
+
|
8
|
+
class Mock
|
9
|
+
def get_environment(uri)
|
10
|
+
environment_id = id_from_uri(uri)
|
11
|
+
organizations = self.data[:organizations].values
|
12
|
+
environment = nil
|
13
|
+
catch(:found) do
|
14
|
+
organizations.each do |organization|
|
15
|
+
organization[:Locations][:Location].each do |location|
|
16
|
+
environment = location[:Environments][:Environment].find{|e| e[:id] == environment_id}
|
17
|
+
throw :found if environment
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
if environment
|
22
|
+
body = environment.dup
|
23
|
+
body.delete(:id)
|
24
|
+
response(:body => body)
|
25
|
+
else response(:status => 404) # ?
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
File without changes
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ecloud
|
4
|
+
class Real
|
5
|
+
basic_request :get_group
|
6
|
+
end
|
7
|
+
|
8
|
+
class Mock
|
9
|
+
def get_group(uri)
|
10
|
+
group_id = id_from_uri(uri)
|
11
|
+
group = self.data[:groups][group_id]
|
12
|
+
|
13
|
+
response(:body => group)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|