fog-ecloud 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,20 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Ecloud
|
|
3
|
+
class Model < Fog::Model
|
|
4
|
+
attr_accessor :loaded
|
|
5
|
+
alias_method :loaded?, :loaded
|
|
6
|
+
|
|
7
|
+
def reload
|
|
8
|
+
instance = super
|
|
9
|
+
@loaded = true
|
|
10
|
+
instance
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def load_unless_loaded!
|
|
14
|
+
unless @loaded
|
|
15
|
+
reload
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class Ecloud
|
|
4
|
+
class AdminOrganization < Fog::Ecloud::Model
|
|
5
|
+
identity :href
|
|
6
|
+
|
|
7
|
+
attribute :name, :aliases => :Name
|
|
8
|
+
attribute :type, :aliases => :Type
|
|
9
|
+
attribute :other_links, :aliases => :Links, :squash => :Link
|
|
10
|
+
attribute :multifactor_summary, :aliases => :MultifactorSummary
|
|
11
|
+
attribute :support_access, :aliases => :SupportAccess
|
|
12
|
+
|
|
13
|
+
def ssh_keys
|
|
14
|
+
@ssh_keys = Fog::Compute::Ecloud::SshKeys.new(:service => service, :href => "#{service.base_path}/admin/sshKeys/organizations/#{organization.id}")
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def password_complexity_rules
|
|
18
|
+
@password_complexity_rules = Fog::Compute::Ecloud::PasswordComplexityRules.new(:service => service, :href => "#{service.base_path}/admin/organizations/#{organization.id}/passwordComplexityRules")
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def login_banner
|
|
22
|
+
@login_banner = Fog::Compute::Ecloud::LoginBanner.new(:service => service, :href => "#{service.base_path}/admin/organizations/#{organization.id}/loginBanner")
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def authentication_levels
|
|
26
|
+
@authentication_levels = Fog::Compute::Ecloud::AuthenticationLevels.new(:service => service, :href => "#{service.base_path}/admin/organizations/#{organization.id}/authenticationLevels")
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def id
|
|
30
|
+
href.scan(/\d+/)[0]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def organization
|
|
34
|
+
@organization ||= begin
|
|
35
|
+
reload unless other_links
|
|
36
|
+
organization_link = other_links.find{|l| l[:type] == "application/vnd.tmrk.cloud.organization"}
|
|
37
|
+
self.service.organizations.new(organization_link)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'fog/ecloud/models/compute/admin_organization'
|
|
2
|
+
|
|
3
|
+
module Fog
|
|
4
|
+
module Compute
|
|
5
|
+
class Ecloud
|
|
6
|
+
class AdminOrganizations < Fog::Ecloud::Collection
|
|
7
|
+
identity :href
|
|
8
|
+
|
|
9
|
+
model Fog::Compute::Ecloud::AdminOrganization
|
|
10
|
+
|
|
11
|
+
def get(uri)
|
|
12
|
+
if data = service.get_admin_organization(uri)
|
|
13
|
+
new(data.body)
|
|
14
|
+
end
|
|
15
|
+
rescue Fog::Errors::NotFound
|
|
16
|
+
nil
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class Ecloud
|
|
4
|
+
class ApiKey < Fog::Ecloud::Model
|
|
5
|
+
identity :href
|
|
6
|
+
|
|
7
|
+
attribute :name, :aliases => :Name
|
|
8
|
+
attribute :type, :aliases => :Type
|
|
9
|
+
attribute :other_links, :aliases => :Links
|
|
10
|
+
attribute :access_key, :aliases => :AccessKey
|
|
11
|
+
attribute :status, :aliases => :Status
|
|
12
|
+
attribute :private_key, :aliases => :PrivateKey
|
|
13
|
+
|
|
14
|
+
def id
|
|
15
|
+
href.scan(/\d+/)[0]
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
require 'fog/ecloud/models/compute/api_key'
|
|
2
|
+
|
|
3
|
+
module Fog
|
|
4
|
+
module Compute
|
|
5
|
+
class Ecloud
|
|
6
|
+
class ApiKeys < Fog::Ecloud::Collection
|
|
7
|
+
identity :href
|
|
8
|
+
|
|
9
|
+
model Fog::Compute::Ecloud::ApiKey
|
|
10
|
+
|
|
11
|
+
def all
|
|
12
|
+
data = service.get_api_keys(href).body
|
|
13
|
+
load(data)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def get(uri)
|
|
17
|
+
if data = service.get_api_key(uri)
|
|
18
|
+
new(data.body)
|
|
19
|
+
end
|
|
20
|
+
rescue Fog::Errors::NotFound
|
|
21
|
+
nil
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class Ecloud
|
|
4
|
+
class Association < Fog::Ecloud::Model
|
|
5
|
+
identity :href
|
|
6
|
+
|
|
7
|
+
attribute :name, :aliases => :Name
|
|
8
|
+
attribute :type, :aliases => :Type
|
|
9
|
+
attribute :other_links, :aliases => :Links
|
|
10
|
+
attribute :ip_address, :aliases => :IpAddress
|
|
11
|
+
|
|
12
|
+
def delete
|
|
13
|
+
data = service.rnat_associations_delete(href).body
|
|
14
|
+
task = Fog::Compute::Ecloud::Tasks.new(:service => service, :href => href)[0]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def id
|
|
18
|
+
href.scan(/\d+/)[0]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
require 'fog/ecloud/models/compute/association'
|
|
2
|
+
|
|
3
|
+
module Fog
|
|
4
|
+
module Compute
|
|
5
|
+
class Ecloud
|
|
6
|
+
class Associations < Fog::Ecloud::Collection
|
|
7
|
+
identity :href
|
|
8
|
+
|
|
9
|
+
model Fog::Compute::Ecloud::Association
|
|
10
|
+
|
|
11
|
+
def all
|
|
12
|
+
data = service.get_associations(href).body
|
|
13
|
+
if data[:Associations]
|
|
14
|
+
data = data[:Associations]
|
|
15
|
+
if data.is_a?(String) && data.empty?
|
|
16
|
+
data = []
|
|
17
|
+
elsif data.is_a?(Hash)
|
|
18
|
+
data = data[:Association]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
load(data)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def get(uri)
|
|
25
|
+
if data = service.get_association(uri)
|
|
26
|
+
new(data.body)
|
|
27
|
+
end
|
|
28
|
+
rescue Fog::Errors::NotFound
|
|
29
|
+
nil
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class Ecloud
|
|
4
|
+
class AuthenticationLevel < Fog::Ecloud::Model
|
|
5
|
+
identity :href
|
|
6
|
+
|
|
7
|
+
attribute :basic_enabled, :aliases => :BasicEnabled, :type => :boolean
|
|
8
|
+
attribute :sha1_enabled, :aliases => :SHA1Enabled, :type => :boolean
|
|
9
|
+
attribute :Sha256_enabled, :aliases => :SHA256Enabled, :type => :boolean
|
|
10
|
+
attribute :Sha512_enabled, :aliases => :SHA512Enabled, :type => :boolean
|
|
11
|
+
attribute :hmacsha1_enabled, :aliases => :HMACSHA1Enabled, :type => :boolean
|
|
12
|
+
attribute :hmacsha256_enabled, :aliases => :HMACSHA256Enabled, :type => :boolean
|
|
13
|
+
attribute :hmacsha512_enabled, :aliases => :HMACSHA512Enabled, :type => :boolean
|
|
14
|
+
|
|
15
|
+
def id
|
|
16
|
+
href.scan(/\d+/)[0]
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
require 'fog/ecloud/models/compute/authentication_level'
|
|
2
|
+
|
|
3
|
+
module Fog
|
|
4
|
+
module Compute
|
|
5
|
+
class Ecloud
|
|
6
|
+
class AuthenticationLevels < Fog::Ecloud::Collection
|
|
7
|
+
identity :href
|
|
8
|
+
|
|
9
|
+
model Fog::Compute::Ecloud::AuthenticationLevel
|
|
10
|
+
|
|
11
|
+
def all
|
|
12
|
+
data = service.get_authentication_levels(href).body
|
|
13
|
+
load(data)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def get(uri)
|
|
17
|
+
if data = service.get_authentication_level(uri)
|
|
18
|
+
new(data.body)
|
|
19
|
+
end
|
|
20
|
+
rescue Fog::Errors::NotFound
|
|
21
|
+
nil
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class Ecloud
|
|
4
|
+
class BackupInternetService < Fog::Ecloud::Model
|
|
5
|
+
identity :href
|
|
6
|
+
|
|
7
|
+
attribute :name, :aliases => :Name
|
|
8
|
+
attribute :type, :aliases => :Type
|
|
9
|
+
attribute :other_links, :aliases => :Links
|
|
10
|
+
attribute :protocol, :aliases => :Protocol
|
|
11
|
+
attribute :enabled, :aliases => :Enabled, :type => :boolean
|
|
12
|
+
attribute :description, :aliases => :Description
|
|
13
|
+
attribute :persistence, :aliases => :Persistence
|
|
14
|
+
attribute :redirect_url, :aliases => :RedirectUrl
|
|
15
|
+
|
|
16
|
+
def tasks
|
|
17
|
+
@tasks = Fog::Compute::Ecloud::Tasks.new(:service => service, :href => href)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def internet_services
|
|
21
|
+
@internet_services = Fog::Compute::Ecloud::InternetServices.new(:service => service, :href => href)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def node_services
|
|
25
|
+
@node_services = Fog::Compute::Ecloud::NodeServices.new(:service => service, :href => href)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def edit(options)
|
|
29
|
+
options[:uri] = href
|
|
30
|
+
data = service.backup_internet_service_edit(options).body
|
|
31
|
+
object = collection.from_data(data)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def delete
|
|
35
|
+
data = service.backup_internet_service_delete(href).body
|
|
36
|
+
task = Fog::Compute::Ecloud::Tasks.new(:service => service, :href => data[:href])[0]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def id
|
|
40
|
+
href.scan(/\d+/)[0]
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
require 'fog/ecloud/models/compute/backup_internet_service'
|
|
2
|
+
|
|
3
|
+
module Fog
|
|
4
|
+
module Compute
|
|
5
|
+
class Ecloud
|
|
6
|
+
class BackupInternetServices < Fog::Ecloud::Collection
|
|
7
|
+
identity :href
|
|
8
|
+
|
|
9
|
+
model Fog::Compute::Ecloud::BackupInternetService
|
|
10
|
+
|
|
11
|
+
def all
|
|
12
|
+
data = service.get_backup_internet_services(href).body
|
|
13
|
+
load(data)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def get(uri)
|
|
17
|
+
if data = service.get_backup_internet_service(uri)
|
|
18
|
+
new(data.body)
|
|
19
|
+
end
|
|
20
|
+
rescue Fog::Errors::NotFound
|
|
21
|
+
nil
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def from_data(data)
|
|
25
|
+
new(data)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def create(options)
|
|
29
|
+
options[:uri] = href + "/action/createBackupInternetService"
|
|
30
|
+
options[:enabled] ||= true
|
|
31
|
+
data = service.backup_internet_service_create(options)
|
|
32
|
+
new(data)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def internet_service_id
|
|
36
|
+
href.scan(/\d+/)[0]
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
require 'fog/ecloud/models/compute/catalog_item'
|
|
2
|
+
|
|
3
|
+
module Fog
|
|
4
|
+
module Compute
|
|
5
|
+
class Ecloud
|
|
6
|
+
class Catalog < Fog::Ecloud::Collection
|
|
7
|
+
identity :href
|
|
8
|
+
|
|
9
|
+
model Fog::Compute::Ecloud::CatalogItem
|
|
10
|
+
|
|
11
|
+
def all
|
|
12
|
+
data = service.get_catalog(href).body#[:Locations][:Location][:Catalog][:CatalogEntry]
|
|
13
|
+
if data[:Locations][:Location].is_a?(Hash)
|
|
14
|
+
data = [] if data[:Locations][:Location][:Catalog].is_a?(String) && data[:Locations][:Location][:Catalog].empty?
|
|
15
|
+
load(data)
|
|
16
|
+
elsif data[:Locations][:Location].is_a?(Array)
|
|
17
|
+
r_data = []
|
|
18
|
+
data[:Locations][:Location].each do |d|
|
|
19
|
+
unless d[:Catalog].is_a?(String) && d[:Catalog].empty?
|
|
20
|
+
d[:Catalog][:CatalogEntry].each do |c|
|
|
21
|
+
r_data << c
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
load(r_data)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def get(uri)
|
|
30
|
+
if data = service.get_catalog_item(uri)
|
|
31
|
+
new(data.body)
|
|
32
|
+
end
|
|
33
|
+
rescue Fog::Errors::NotFound
|
|
34
|
+
nil
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class Ecloud
|
|
4
|
+
class CatalogConfiguration < Fog::Ecloud::Model
|
|
5
|
+
identity :href
|
|
6
|
+
|
|
7
|
+
attribute :type, :aliases => :Type
|
|
8
|
+
attribute :other_links, :aliases => :Links
|
|
9
|
+
attribute :processor_count, :aliases => :ProcessorCount, :type => :integer
|
|
10
|
+
attribute :memory, :aliases => :Memory
|
|
11
|
+
attribute :operating_system, :aliases => :OperatingSystem
|
|
12
|
+
attribute :disks, :aliases => :Disks
|
|
13
|
+
attribute :network_adapters, :aliases => :NetworkAdapters, :type => :integer
|
|
14
|
+
attribute :network_mappings, :aliases => :NetworkMappings
|
|
15
|
+
|
|
16
|
+
def id
|
|
17
|
+
href.scan(/\d+/)[0]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
require 'fog/ecloud/models/compute/catalog_configuration'
|
|
2
|
+
|
|
3
|
+
module Fog
|
|
4
|
+
module Compute
|
|
5
|
+
class Ecloud
|
|
6
|
+
class CatalogConfigurations < Fog::Ecloud::Collection
|
|
7
|
+
identity :href
|
|
8
|
+
|
|
9
|
+
model Fog::Compute::Ecloud::CatalogConfiguration
|
|
10
|
+
|
|
11
|
+
def all
|
|
12
|
+
data = service.get_catalog_configurations(href).body
|
|
13
|
+
load(data)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def get(uri)
|
|
17
|
+
if data = service.get_catalog_configuration(uri)
|
|
18
|
+
new(data.body)
|
|
19
|
+
end
|
|
20
|
+
rescue Fog::Errors::NotFound
|
|
21
|
+
nil
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class Ecloud
|
|
4
|
+
class CatalogItem < Fog::Ecloud::Model
|
|
5
|
+
identity :href
|
|
6
|
+
|
|
7
|
+
attribute :name, :aliases => :Name
|
|
8
|
+
attribute :type, :aliases => :Type
|
|
9
|
+
attribute :other_links, :aliases => :Links
|
|
10
|
+
attribute :status, :aliases => :Status
|
|
11
|
+
attribute :alerts, :aliases => :Alerts
|
|
12
|
+
attribute :files, :aliases => :Files
|
|
13
|
+
|
|
14
|
+
def configuration
|
|
15
|
+
@configuration = Fog::Compute::Ecloud::CatalogConfigurations.new(:service => service, :href => "#{service.base_path}/admin/catalog/#{id}/configuration")
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def id
|
|
19
|
+
href.scan(/\d+/)[0]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class Ecloud
|
|
4
|
+
class ComputePool < Fog::Ecloud::Model
|
|
5
|
+
identity :href
|
|
6
|
+
|
|
7
|
+
attribute :href, :aliases => :Href
|
|
8
|
+
attribute :name, :aliases => :Name
|
|
9
|
+
attribute :type, :aliases => :Type
|
|
10
|
+
attribute :other_links, :aliases => :Links, :squash => :Link
|
|
11
|
+
attribute :all_servers, :aliases => :VirtualMachines
|
|
12
|
+
attribute :purchased, :aliases => :Purchased
|
|
13
|
+
attribute :cpu_burst, :aliases => :CpuBurst
|
|
14
|
+
attribute :memory_burst, :aliases => :MemoryBurst
|
|
15
|
+
|
|
16
|
+
def servers
|
|
17
|
+
@servers ||= Fog::Compute::Ecloud::Servers.new( :service => service, :href => "#{service.base_path}/virtualMachines/computePools/#{id}" )
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def layout
|
|
21
|
+
@layout ||= Fog::Compute::Ecloud::Layouts.new(:service => service, :href => "#{service.base_path}/layout/computePools/#{id}").first
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def cpu_usage
|
|
25
|
+
# time ? query = "/details?time=#{Time.parse(time).utc.strftime('%Y-%m-%dT%H:%M:%SZ')}" : query = ""
|
|
26
|
+
@cpu_usage ||= Fog::Compute::Ecloud::CpuUsageDetailSummary.new(:service => service, :href => "#{service.base_path}/computePools/#{id}/usage/cpu")
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def memory_usage
|
|
30
|
+
# time ? query = "/details?time=#{Time.parse(time).utc.strftime('%Y-%m-%dT%H:%M:%SZ')}" : query = ""
|
|
31
|
+
@memory_usage ||= Fog::Compute::Ecloud::MemoryUsageDetailSummary.new(:service => service, :href => "#{service.base_path}/computePools/#{id}/usage/memory")
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def storage_usage
|
|
35
|
+
@storage_usage ||= Fog::Compute::Ecloud::StorageUsageDetailSummary.new(:service => service, :href => "#{service.base_path}/computePools/#{id}/usage/storage")
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def operating_system_families
|
|
39
|
+
@operating_system_families ||= Fog::Compute::Ecloud::OperatingSystemFamilies.new(:service => service, :href => "#{service.base_path}/operatingSystemFamilies/computePools/#{id}")
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def templates
|
|
43
|
+
@templates ||= self.service.templates(:href => "#{service.base_path}/templates/computePools/#{id}")
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def detached_disks
|
|
47
|
+
@detached_disks ||= self.service.detached_disks(:href => "#{service.base_path}/detacheddisks/computepools/#{id}")
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def environment
|
|
51
|
+
@environment ||= begin
|
|
52
|
+
reload unless other_links
|
|
53
|
+
environment_link = other_links.find{|l| l[:type] == "application/vnd.tmrk.cloud.environment"}
|
|
54
|
+
self.service.environments.get(environment_link[:href])
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def edit(options)
|
|
59
|
+
options[:uri] = href
|
|
60
|
+
data = service.compute_pool_edit(options).body
|
|
61
|
+
pool = collection.from_data(data)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def id
|
|
65
|
+
href.scan(/\d+/)[0]
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
require 'fog/ecloud/models/compute/compute_pool'
|
|
2
|
+
|
|
3
|
+
module Fog
|
|
4
|
+
module Compute
|
|
5
|
+
class Ecloud
|
|
6
|
+
class ComputePools < Fog::Ecloud::Collection
|
|
7
|
+
undef_method :create
|
|
8
|
+
|
|
9
|
+
attribute :href, :aliases => :Href
|
|
10
|
+
|
|
11
|
+
model Fog::Compute::Ecloud::ComputePool
|
|
12
|
+
|
|
13
|
+
def all
|
|
14
|
+
check_href!(:message => "the Compute Pool href of the Environment you want to enumerate")
|
|
15
|
+
data = service.get_compute_pools(href).body[:ComputePool]
|
|
16
|
+
load(data)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def get(uri)
|
|
20
|
+
if data = service.get_compute_pool(uri)
|
|
21
|
+
new(data.body)
|
|
22
|
+
end
|
|
23
|
+
rescue Fog::Errors::NotFound
|
|
24
|
+
nil
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def from_data(data)
|
|
28
|
+
new(data)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class Ecloud
|
|
4
|
+
class CpuUsageDetail < Fog::Ecloud::Model
|
|
5
|
+
identity :href
|
|
6
|
+
|
|
7
|
+
attribute :time, :aliases => :Time
|
|
8
|
+
attribute :value, :aliases => :Value
|
|
9
|
+
|
|
10
|
+
def id
|
|
11
|
+
href.scan(/\d+/)[0]
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
require 'fog/ecloud/models/compute/cpu_usage_detail'
|
|
2
|
+
|
|
3
|
+
module Fog
|
|
4
|
+
module Compute
|
|
5
|
+
class Ecloud
|
|
6
|
+
class CpuUsageDetailSummary < Fog::Ecloud::Collection
|
|
7
|
+
identity :href
|
|
8
|
+
|
|
9
|
+
model Fog::Compute::Ecloud::CpuUsageDetail
|
|
10
|
+
|
|
11
|
+
def all
|
|
12
|
+
data = service.get_cpu_usage_detail_summary(href).body[:CpuUsageDetailSummary][:CpuUsageDetail]
|
|
13
|
+
load(data)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def get(uri)
|
|
17
|
+
if data = service.get_cpu_usage_detail(uri)
|
|
18
|
+
new(data.body)
|
|
19
|
+
end
|
|
20
|
+
rescue Fog::Errors::NotFound
|
|
21
|
+
nil
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module Compute
|
|
3
|
+
class Ecloud
|
|
4
|
+
class DetachedDisk < Fog::Ecloud::Model
|
|
5
|
+
identity :href
|
|
6
|
+
|
|
7
|
+
attribute :name, :aliases => :Name
|
|
8
|
+
attribute :type, :aliases => :Type
|
|
9
|
+
attribute :other_links, :aliases => :Links
|
|
10
|
+
attribute :status, :aliases => :Status
|
|
11
|
+
attribute :size, :aliases => :Size
|
|
12
|
+
|
|
13
|
+
def ready?
|
|
14
|
+
unless status =~ /AttachInProgress|DetachInProgress/
|
|
15
|
+
true
|
|
16
|
+
else
|
|
17
|
+
false
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def id
|
|
22
|
+
href.scan(/\d+/)[0]
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
require 'fog/ecloud/models/compute/detached_disk'
|
|
2
|
+
|
|
3
|
+
module Fog
|
|
4
|
+
module Compute
|
|
5
|
+
class Ecloud
|
|
6
|
+
class DetachedDisks < Fog::Ecloud::Collection
|
|
7
|
+
identity :href
|
|
8
|
+
|
|
9
|
+
model Fog::Compute::Ecloud::DetachedDisk
|
|
10
|
+
|
|
11
|
+
def all
|
|
12
|
+
data = service.get_detached_disks(href).body[:DetachedDisk]
|
|
13
|
+
data = [] if data.nil?
|
|
14
|
+
load(data)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def get(uri)
|
|
18
|
+
data = service.get_detached_disk(uri).body
|
|
19
|
+
new(data)
|
|
20
|
+
rescue Fog::Errors::NotFound
|
|
21
|
+
nil
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|