fog-oracle 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +16 -0
- data/.ruby-gemset +1 -0
- data/Gemfile +4 -0
- data/LICENSE.md +20 -0
- data/README.md +3 -0
- data/Rakefile +16 -0
- data/fog-oracle.gemspec +27 -0
- data/lib/fog/bin/oracle.rb +29 -0
- data/lib/fog/oracle.rb +1 -0
- data/lib/fog/oracle/compute.rb +320 -0
- data/lib/fog/oracle/core.rb +92 -0
- data/lib/fog/oracle/models/associations.rb +89 -0
- data/lib/fog/oracle/models/collection.rb +47 -0
- data/lib/fog/oracle/models/compute/access_group.rb +18 -0
- data/lib/fog/oracle/models/compute/access_group_type.rb +8 -0
- data/lib/fog/oracle/models/compute/access_groups.rb +22 -0
- data/lib/fog/oracle/models/compute/access_host.rb +14 -0
- data/lib/fog/oracle/models/compute/access_hosts.rb +22 -0
- data/lib/fog/oracle/models/compute/affinity_group.rb +15 -0
- data/lib/fog/oracle/models/compute/affinity_groups.rb +22 -0
- data/lib/fog/oracle/models/compute/affinity_type.rb +9 -0
- data/lib/fog/oracle/models/compute/archive_management_attributes.rb +16 -0
- data/lib/fog/oracle/models/compute/archive_management_attributeses.rb +22 -0
- data/lib/fog/oracle/models/compute/assemblies.rb +22 -0
- data/lib/fog/oracle/models/compute/assembly.rb +15 -0
- data/lib/fog/oracle/models/compute/assembly_virtual_disk.rb +15 -0
- data/lib/fog/oracle/models/compute/assembly_virtual_disks.rb +22 -0
- data/lib/fog/oracle/models/compute/assembly_vm.rb +12 -0
- data/lib/fog/oracle/models/compute/assembly_vms.rb +22 -0
- data/lib/fog/oracle/models/compute/backing_device_type.rb +12 -0
- data/lib/fog/oracle/models/compute/backup_management_attributes.rb +14 -0
- data/lib/fog/oracle/models/compute/backup_management_attributeses.rb +22 -0
- data/lib/fog/oracle/models/compute/base_object.rb +26 -0
- data/lib/fog/oracle/models/compute/bond_mode.rb +9 -0
- data/lib/fog/oracle/models/compute/business_selection.rb +13 -0
- data/lib/fog/oracle/models/compute/business_selections.rb +22 -0
- data/lib/fog/oracle/models/compute/clone_target_type.rb +9 -0
- data/lib/fog/oracle/models/compute/clone_type.rb +9 -0
- data/lib/fog/oracle/models/compute/cluster.rb +15 -0
- data/lib/fog/oracle/models/compute/cluster_heartbeat_device.rb +16 -0
- data/lib/fog/oracle/models/compute/cluster_heartbeat_devices.rb +22 -0
- data/lib/fog/oracle/models/compute/cluster_heartbeat_storage_type.rb +9 -0
- data/lib/fog/oracle/models/compute/cluster_storage_fs.rb +11 -0
- data/lib/fog/oracle/models/compute/cluster_storage_fses.rb +22 -0
- data/lib/fog/oracle/models/compute/clusters.rb +22 -0
- data/lib/fog/oracle/models/compute/comparison_type.rb +12 -0
- data/lib/fog/oracle/models/compute/comparison_types.rb +22 -0
- data/lib/fog/oracle/models/compute/control_domain.rb +22 -0
- data/lib/fog/oracle/models/compute/control_domains.rb +22 -0
- data/lib/fog/oracle/models/compute/cpu.rb +19 -0
- data/lib/fog/oracle/models/compute/cpu_compatibility_group.rb +11 -0
- data/lib/fog/oracle/models/compute/cpu_compatibility_groups.rb +22 -0
- data/lib/fog/oracle/models/compute/cpus.rb +22 -0
- data/lib/fog/oracle/models/compute/disk_type.rb +8 -0
- data/lib/fog/oracle/models/compute/disk_write_mode.rb +8 -0
- data/lib/fog/oracle/models/compute/equality_type.rb +14 -0
- data/lib/fog/oracle/models/compute/ethernet_port.rb +23 -0
- data/lib/fog/oracle/models/compute/ethernet_ports.rb +22 -0
- data/lib/fog/oracle/models/compute/event.rb +18 -0
- data/lib/fog/oracle/models/compute/event_field.rb +14 -0
- data/lib/fog/oracle/models/compute/event_management_attributes.rb +11 -0
- data/lib/fog/oracle/models/compute/event_management_attributeses.rb +22 -0
- data/lib/fog/oracle/models/compute/event_queries.rb +22 -0
- data/lib/fog/oracle/models/compute/event_query.rb +22 -0
- data/lib/fog/oracle/models/compute/event_severity.rb +10 -0
- data/lib/fog/oracle/models/compute/events.rb +22 -0
- data/lib/fog/oracle/models/compute/file_server.rb +21 -0
- data/lib/fog/oracle/models/compute/file_server_plugin.rb +21 -0
- data/lib/fog/oracle/models/compute/file_server_plugins.rb +22 -0
- data/lib/fog/oracle/models/compute/file_server_type.rb +9 -0
- data/lib/fog/oracle/models/compute/file_servers.rb +22 -0
- data/lib/fog/oracle/models/compute/file_system.rb +22 -0
- data/lib/fog/oracle/models/compute/file_system_mount.rb +15 -0
- data/lib/fog/oracle/models/compute/file_system_mounts.rb +22 -0
- data/lib/fog/oracle/models/compute/file_systems.rb +22 -0
- data/lib/fog/oracle/models/compute/hypervisor.rb +13 -0
- data/lib/fog/oracle/models/compute/hypervisor_capability.rb +12 -0
- data/lib/fog/oracle/models/compute/hypervisor_type.rb +9 -0
- data/lib/fog/oracle/models/compute/hypervisors.rb +22 -0
- data/lib/fog/oracle/models/compute/ipaddress.rb +14 -0
- data/lib/fog/oracle/models/compute/ipaddress_config_type.rb +10 -0
- data/lib/fog/oracle/models/compute/ipaddress_type.rb +9 -0
- data/lib/fog/oracle/models/compute/ipaddresses.rb +22 -0
- data/lib/fog/oracle/models/compute/job.rb +26 -0
- data/lib/fog/oracle/models/compute/job_error.rb +12 -0
- data/lib/fog/oracle/models/compute/job_error_type.rb +18 -0
- data/lib/fog/oracle/models/compute/job_errors.rb +22 -0
- data/lib/fog/oracle/models/compute/job_management_attributes.rb +12 -0
- data/lib/fog/oracle/models/compute/job_management_attributeses.rb +22 -0
- data/lib/fog/oracle/models/compute/job_run_state.rb +13 -0
- data/lib/fog/oracle/models/compute/jobs.rb +22 -0
- data/lib/fog/oracle/models/compute/key_value_pair.rb +12 -0
- data/lib/fog/oracle/models/compute/key_value_pairs.rb +22 -0
- data/lib/fog/oracle/models/compute/log_level.rb +13 -0
- data/lib/fog/oracle/models/compute/logger_management_attributes.rb +14 -0
- data/lib/fog/oracle/models/compute/logger_management_attributeses.rb +22 -0
- data/lib/fog/oracle/models/compute/login_certificate.rb +13 -0
- data/lib/fog/oracle/models/compute/login_certificates.rb +22 -0
- data/lib/fog/oracle/models/compute/mac_management_attributes.rb +13 -0
- data/lib/fog/oracle/models/compute/mac_management_attributeses.rb +22 -0
- data/lib/fog/oracle/models/compute/manager.rb +14 -0
- data/lib/fog/oracle/models/compute/manager_run_state.rb +10 -0
- data/lib/fog/oracle/models/compute/managers.rb +22 -0
- data/lib/fog/oracle/models/compute/network.rb +17 -0
- data/lib/fog/oracle/models/compute/networks.rb +22 -0
- data/lib/fog/oracle/models/compute/order_type.rb +8 -0
- data/lib/fog/oracle/models/compute/package_signature_type.rb +9 -0
- data/lib/fog/oracle/models/compute/package_type.rb +8 -0
- data/lib/fog/oracle/models/compute/password_change.rb +13 -0
- data/lib/fog/oracle/models/compute/password_changes.rb +22 -0
- data/lib/fog/oracle/models/compute/path_state.rb +9 -0
- data/lib/fog/oracle/models/compute/periodic_task.rb +12 -0
- data/lib/fog/oracle/models/compute/periodic_tasks.rb +22 -0
- data/lib/fog/oracle/models/compute/policy_mode.rb +9 -0
- data/lib/fog/oracle/models/compute/port_state.rb +9 -0
- data/lib/fog/oracle/models/compute/port_type.rb +10 -0
- data/lib/fog/oracle/models/compute/processor_type.rb +10 -0
- data/lib/fog/oracle/models/compute/qos_value.rb +13 -0
- data/lib/fog/oracle/models/compute/qos_values.rb +22 -0
- data/lib/fog/oracle/models/compute/repositories.rb +22 -0
- data/lib/fog/oracle/models/compute/repository.rb +18 -0
- data/lib/fog/oracle/models/compute/repository_export.rb +16 -0
- data/lib/fog/oracle/models/compute/repository_export_fs_type.rb +7 -0
- data/lib/fog/oracle/models/compute/repository_exports.rb +22 -0
- data/lib/fog/oracle/models/compute/repository_import.rb +12 -0
- data/lib/fog/oracle/models/compute/repository_imports.rb +22 -0
- data/lib/fog/oracle/models/compute/resource_group.rb +12 -0
- data/lib/fog/oracle/models/compute/resource_group_type.rb +8 -0
- data/lib/fog/oracle/models/compute/resource_groups.rb +22 -0
- data/lib/fog/oracle/models/compute/role.rb +11 -0
- data/lib/fog/oracle/models/compute/server.rb +60 -0
- data/lib/fog/oracle/models/compute/server_abilities.rb +34 -0
- data/lib/fog/oracle/models/compute/server_abilitieses.rb +22 -0
- data/lib/fog/oracle/models/compute/server_controller.rb +15 -0
- data/lib/fog/oracle/models/compute/server_controller_type.rb +7 -0
- data/lib/fog/oracle/models/compute/server_controllers.rb +22 -0
- data/lib/fog/oracle/models/compute/server_event_attributes.rb +11 -0
- data/lib/fog/oracle/models/compute/server_event_attributeses.rb +22 -0
- data/lib/fog/oracle/models/compute/server_pool.rb +23 -0
- data/lib/fog/oracle/models/compute/server_pool_network_policies.rb +22 -0
- data/lib/fog/oracle/models/compute/server_pool_network_policy.rb +14 -0
- data/lib/fog/oracle/models/compute/server_pool_policies.rb +22 -0
- data/lib/fog/oracle/models/compute/server_pool_policy.rb +17 -0
- data/lib/fog/oracle/models/compute/server_pools.rb +22 -0
- data/lib/fog/oracle/models/compute/server_role.rb +9 -0
- data/lib/fog/oracle/models/compute/server_run_state.rb +11 -0
- data/lib/fog/oracle/models/compute/server_update_configuration.rb +14 -0
- data/lib/fog/oracle/models/compute/server_update_configurations.rb +22 -0
- data/lib/fog/oracle/models/compute/server_update_repository_configuration.rb +16 -0
- data/lib/fog/oracle/models/compute/server_update_repository_configurations.rb +22 -0
- data/lib/fog/oracle/models/compute/server_update_repository_type.rb +8 -0
- data/lib/fog/oracle/models/compute/servers.rb +22 -0
- data/lib/fog/oracle/models/compute/session_properties.rb +11 -0
- data/lib/fog/oracle/models/compute/session_propertieses.rb +22 -0
- data/lib/fog/oracle/models/compute/statistic.rb +18 -0
- data/lib/fog/oracle/models/compute/statistic_field.rb +12 -0
- data/lib/fog/oracle/models/compute/statistic_queries.rb +22 -0
- data/lib/fog/oracle/models/compute/statistic_query.rb +18 -0
- data/lib/fog/oracle/models/compute/statistic_type.rb +18 -0
- data/lib/fog/oracle/models/compute/statistics.rb +22 -0
- data/lib/fog/oracle/models/compute/statistics_management_attributes.rb +15 -0
- data/lib/fog/oracle/models/compute/statistics_management_attributeses.rb +22 -0
- data/lib/fog/oracle/models/compute/storage_ability.rb +23 -0
- data/lib/fog/oracle/models/compute/storage_ability_record.rb +12 -0
- data/lib/fog/oracle/models/compute/storage_ability_records.rb +22 -0
- data/lib/fog/oracle/models/compute/storage_ability_value.rb +12 -0
- data/lib/fog/oracle/models/compute/storage_array.rb +34 -0
- data/lib/fog/oracle/models/compute/storage_array_plugin.rb +24 -0
- data/lib/fog/oracle/models/compute/storage_array_plugins.rb +22 -0
- data/lib/fog/oracle/models/compute/storage_arrays.rb +22 -0
- data/lib/fog/oracle/models/compute/storage_element.rb +30 -0
- data/lib/fog/oracle/models/compute/storage_element_state.rb +14 -0
- data/lib/fog/oracle/models/compute/storage_element_type.rb +11 -0
- data/lib/fog/oracle/models/compute/storage_elements.rb +22 -0
- data/lib/fog/oracle/models/compute/storage_initiator.rb +20 -0
- data/lib/fog/oracle/models/compute/storage_initiators.rb +22 -0
- data/lib/fog/oracle/models/compute/storage_path.rb +17 -0
- data/lib/fog/oracle/models/compute/storage_paths.rb +22 -0
- data/lib/fog/oracle/models/compute/storage_target.rb +23 -0
- data/lib/fog/oracle/models/compute/storage_targets.rb +22 -0
- data/lib/fog/oracle/models/compute/storage_type.rb +10 -0
- data/lib/fog/oracle/models/compute/storage_use.rb +8 -0
- data/lib/fog/oracle/models/compute/string_list.rb +11 -0
- data/lib/fog/oracle/models/compute/string_lists.rb +22 -0
- data/lib/fog/oracle/models/compute/unselected_object_details.rb +12 -0
- data/lib/fog/oracle/models/compute/unselected_object_detailses.rb +22 -0
- data/lib/fog/oracle/models/compute/virtual_disk.rb +19 -0
- data/lib/fog/oracle/models/compute/virtual_disks.rb +22 -0
- data/lib/fog/oracle/models/compute/virtual_nic.rb +15 -0
- data/lib/fog/oracle/models/compute/virtual_nics.rb +22 -0
- data/lib/fog/oracle/models/compute/virtual_switch.rb +13 -0
- data/lib/fog/oracle/models/compute/virtual_switches.rb +22 -0
- data/lib/fog/oracle/models/compute/vlan_interface.rb +18 -0
- data/lib/fog/oracle/models/compute/vlan_interfaces.rb +22 -0
- data/lib/fog/oracle/models/compute/vm.rb +48 -0
- data/lib/fog/oracle/models/compute/vm_boot_type.rb +9 -0
- data/lib/fog/oracle/models/compute/vm_clone_definition.rb +13 -0
- data/lib/fog/oracle/models/compute/vm_clone_definitions.rb +22 -0
- data/lib/fog/oracle/models/compute/vm_clone_network_mapping.rb +13 -0
- data/lib/fog/oracle/models/compute/vm_clone_network_mappings.rb +22 -0
- data/lib/fog/oracle/models/compute/vm_clone_storage_mapping.rb +16 -0
- data/lib/fog/oracle/models/compute/vm_clone_storage_mappings.rb +22 -0
- data/lib/fog/oracle/models/compute/vm_disk_mapping.rb +16 -0
- data/lib/fog/oracle/models/compute/vm_disk_mappings.rb +22 -0
- data/lib/fog/oracle/models/compute/vm_domain_type.rb +11 -0
- data/lib/fog/oracle/models/compute/vm_message_type.rb +8 -0
- data/lib/fog/oracle/models/compute/vm_mouse_type.rb +10 -0
- data/lib/fog/oracle/models/compute/vm_restart_action.rb +8 -0
- data/lib/fog/oracle/models/compute/vm_run_state.rb +12 -0
- data/lib/fog/oracle/models/compute/vm_start_policy.rb +9 -0
- data/lib/fog/oracle/models/compute/vms.rb +22 -0
- data/lib/fog/oracle/models/compute/volume_group.rb +18 -0
- data/lib/fog/oracle/models/compute/volume_groups.rb +22 -0
- data/lib/fog/oracle/models/compute/ws_error_code.rb +117 -0
- data/lib/fog/oracle/models/compute/ws_error_details.rb +14 -0
- data/lib/fog/oracle/models/compute/ws_error_detailses.rb +22 -0
- data/lib/fog/oracle/models/compute/ws_exception.rb +11 -0
- data/lib/fog/oracle/models/compute/ws_exceptions.rb +22 -0
- data/lib/fog/oracle/models/compute/zone.rb +13 -0
- data/lib/fog/oracle/models/compute/zones.rb +22 -0
- data/lib/fog/oracle/models/model.rb +26 -0
- data/lib/fog/oracle/requests/compute/get_control_domain.rb +60 -0
- data/lib/fog/oracle/requests/compute/get_cpu.rb +57 -0
- data/lib/fog/oracle/requests/compute/get_cpu_compatibility_group.rb +51 -0
- data/lib/fog/oracle/requests/compute/get_ethernet_port.rb +66 -0
- data/lib/fog/oracle/requests/compute/get_file_server.rb +78 -0
- data/lib/fog/oracle/requests/compute/get_file_server_plugin.rb +129 -0
- data/lib/fog/oracle/requests/compute/get_file_system.rb +81 -0
- data/lib/fog/oracle/requests/compute/get_file_system_mount.rb +58 -0
- data/lib/fog/oracle/requests/compute/get_job.rb +62 -0
- data/lib/fog/oracle/requests/compute/get_manager.rb +47 -0
- data/lib/fog/oracle/requests/compute/get_network.rb +94 -0
- data/lib/fog/oracle/requests/compute/get_repository.rb +149 -0
- data/lib/fog/oracle/requests/compute/get_server.rb +300 -0
- data/lib/fog/oracle/requests/compute/get_server_pool.rb +98 -0
- data/lib/fog/oracle/requests/compute/get_server_pool_policy.rb +55 -0
- data/lib/fog/oracle/requests/compute/get_server_update_configuration.rb +47 -0
- data/lib/fog/oracle/requests/compute/get_storage_array.rb +79 -0
- data/lib/fog/oracle/requests/compute/get_storage_array_plugin.rb +143 -0
- data/lib/fog/oracle/requests/compute/get_storage_element.rb +83 -0
- data/lib/fog/oracle/requests/compute/get_storage_initiator.rb +71 -0
- data/lib/fog/oracle/requests/compute/get_storage_path.rb +60 -0
- data/lib/fog/oracle/requests/compute/get_virtual_disk.rb +64 -0
- data/lib/fog/oracle/requests/compute/get_virtual_nic.rb +58 -0
- data/lib/fog/oracle/requests/compute/get_virtual_switch.rb +56 -0
- data/lib/fog/oracle/requests/compute/get_vm.rb +113 -0
- data/lib/fog/oracle/requests/compute/get_vm_disk_mapping.rb +59 -0
- data/lib/fog/oracle/requests/compute/get_volume_group.rb +56 -0
- data/lib/fog/oracle/requests/compute/list_access_groups.rb +29 -0
- data/lib/fog/oracle/requests/compute/list_affinity_groups.rb +29 -0
- data/lib/fog/oracle/requests/compute/list_assemblies.rb +29 -0
- data/lib/fog/oracle/requests/compute/list_assembly_virtual_disks.rb +29 -0
- data/lib/fog/oracle/requests/compute/list_assembly_vms.rb +29 -0
- data/lib/fog/oracle/requests/compute/list_cluster_heartbeat_devices.rb +29 -0
- data/lib/fog/oracle/requests/compute/list_cluster_storage_fses.rb +29 -0
- data/lib/fog/oracle/requests/compute/list_clusters.rb +29 -0
- data/lib/fog/oracle/requests/compute/list_control_domains.rb +62 -0
- data/lib/fog/oracle/requests/compute/list_cpu_compatibility_groups.rb +53 -0
- data/lib/fog/oracle/requests/compute/list_cpus.rb +262 -0
- data/lib/fog/oracle/requests/compute/list_ethernet_ports.rb +125 -0
- data/lib/fog/oracle/requests/compute/list_file_server_plugins.rb +225 -0
- data/lib/fog/oracle/requests/compute/list_file_servers.rb +80 -0
- data/lib/fog/oracle/requests/compute/list_file_system_mounts.rb +60 -0
- data/lib/fog/oracle/requests/compute/list_file_systems.rb +83 -0
- data/lib/fog/oracle/requests/compute/list_jobs.rb +61 -0
- data/lib/fog/oracle/requests/compute/list_managers.rb +49 -0
- data/lib/fog/oracle/requests/compute/list_networks.rb +96 -0
- data/lib/fog/oracle/requests/compute/list_repositories.rb +151 -0
- data/lib/fog/oracle/requests/compute/list_repository_exports.rb +29 -0
- data/lib/fog/oracle/requests/compute/list_resource_groups.rb +29 -0
- data/lib/fog/oracle/requests/compute/list_server_controllers.rb +29 -0
- data/lib/fog/oracle/requests/compute/list_server_pool_network_policies.rb +29 -0
- data/lib/fog/oracle/requests/compute/list_server_pool_policies.rb +57 -0
- data/lib/fog/oracle/requests/compute/list_server_pools.rb +100 -0
- data/lib/fog/oracle/requests/compute/list_server_update_configurations.rb +68 -0
- data/lib/fog/oracle/requests/compute/list_server_update_repository_configurations.rb +29 -0
- data/lib/fog/oracle/requests/compute/list_servers.rb +302 -0
- data/lib/fog/oracle/requests/compute/list_storage_array_plugins.rb +145 -0
- data/lib/fog/oracle/requests/compute/list_storage_arrays.rb +195 -0
- data/lib/fog/oracle/requests/compute/list_storage_elements.rb +133 -0
- data/lib/fog/oracle/requests/compute/list_storage_initiators.rb +103 -0
- data/lib/fog/oracle/requests/compute/list_storage_paths.rb +94 -0
- data/lib/fog/oracle/requests/compute/list_storage_targets.rb +29 -0
- data/lib/fog/oracle/requests/compute/list_virtual_disks.rb +364 -0
- data/lib/fog/oracle/requests/compute/list_virtual_nics.rb +180 -0
- data/lib/fog/oracle/requests/compute/list_virtual_switches.rb +58 -0
- data/lib/fog/oracle/requests/compute/list_vlan_interfaces.rb +29 -0
- data/lib/fog/oracle/requests/compute/list_vm_clone_definitions.rb +29 -0
- data/lib/fog/oracle/requests/compute/list_vm_clone_network_mappings.rb +29 -0
- data/lib/fog/oracle/requests/compute/list_vm_clone_storage_mappings.rb +29 -0
- data/lib/fog/oracle/requests/compute/list_vm_disk_mappings.rb +247 -0
- data/lib/fog/oracle/requests/compute/list_vms.rb +457 -0
- data/lib/fog/oracle/requests/compute/list_volume_groups.rb +127 -0
- data/lib/fog/oracle/requests/compute/list_zones.rb +29 -0
- data/lib/fog/oracle/requests/compute/login.rb +24 -0
- data/lib/fog/oracle/version.rb +5 -0
- data/tasks/bundler.rake +3 -0
- data/tasks/console.rake +12 -0
- metadata +400 -0
@@ -0,0 +1,92 @@
|
|
1
|
+
require 'fog/core'
|
2
|
+
require 'fog/json'
|
3
|
+
require 'fog/xml'
|
4
|
+
|
5
|
+
module Fog
|
6
|
+
module Oracle
|
7
|
+
extend Fog::Provider
|
8
|
+
|
9
|
+
module Errors
|
10
|
+
class ServiceError < Fog::Errors::Error; end
|
11
|
+
class ServiceUnavailable < ServiceError; end
|
12
|
+
class BadRequest < ServiceError; end
|
13
|
+
class InterfaceNotImplemented < Fog::Errors::Error; end
|
14
|
+
end
|
15
|
+
|
16
|
+
service(:compute, 'Compute')
|
17
|
+
|
18
|
+
module JsonUtils
|
19
|
+
def json_encode(body)
|
20
|
+
encoded = Fog::JSON.encode(body)
|
21
|
+
encoded
|
22
|
+
end
|
23
|
+
|
24
|
+
def json_decode(body)
|
25
|
+
parsed = Fog::JSON.decode(body)
|
26
|
+
snakecase_hash_keys(parsed)
|
27
|
+
# decode_time_attrs(parsed)
|
28
|
+
parsed
|
29
|
+
end
|
30
|
+
|
31
|
+
def snakecase_hash_keys(value)
|
32
|
+
case value
|
33
|
+
when Hash
|
34
|
+
value.keys.each do |key|
|
35
|
+
new_key = key.underscore
|
36
|
+
value[new_key] = value.delete(key)
|
37
|
+
snakecase_hash_keys(value[new_key])
|
38
|
+
end
|
39
|
+
when Array
|
40
|
+
value.each do |it|
|
41
|
+
snakecase_hash_keys(it)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
module Core
|
48
|
+
include JsonUtils
|
49
|
+
|
50
|
+
def core_initialize(options)
|
51
|
+
@api_url = options[:oracle_url]
|
52
|
+
@username = options[:oracle_username]
|
53
|
+
@password = options[:oracle_password]
|
54
|
+
@connection_options = options[:connection_options] || {}
|
55
|
+
@persistent = options[:persistent] || false
|
56
|
+
@connection = Fog::XML::Connection.new(@api_url, @persistent, @connection_options)
|
57
|
+
end
|
58
|
+
|
59
|
+
def escape(str)
|
60
|
+
str.gsub(/([^a-zA-Z0-9_.-]+)/) do
|
61
|
+
'%' + $1.unpack('H2' * $1.bytesize).join('%').upcase
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def request(opts)
|
66
|
+
opts[:path] = '/ovm/core/wsapi/rest/' + opts[:path]
|
67
|
+
|
68
|
+
hash = Base64.encode64(@username + ":" + @password).delete("\r\n")
|
69
|
+
|
70
|
+
opts[:headers] = {
|
71
|
+
"Accept" => "application/json",
|
72
|
+
'Authorization' => "Basic #{hash}"
|
73
|
+
}.merge(opts[:headers] || {})
|
74
|
+
|
75
|
+
if opts[:body]
|
76
|
+
opts[:headers]["Content-Type"] = "application/json"
|
77
|
+
opts[:body] = json_encode(opts[:body])
|
78
|
+
end
|
79
|
+
|
80
|
+
response = @connection.request(opts)
|
81
|
+
|
82
|
+
if response.headers["Content-Type"] == "application/json"
|
83
|
+
response.body = json_decode(response.body)
|
84
|
+
end
|
85
|
+
|
86
|
+
# puts @api_url, opts, response
|
87
|
+
|
88
|
+
response
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
module Fog
|
2
|
+
module Associations
|
3
|
+
class OracleDefault < Default
|
4
|
+
def create_setter
|
5
|
+
model.class_eval <<-EOS, __FILE__, __LINE__
|
6
|
+
def #{name}=(new_#{name})
|
7
|
+
associations[:#{name}] = new_#{name}
|
8
|
+
end
|
9
|
+
EOS
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_getter
|
13
|
+
model.class_eval <<-EOS, __FILE__, __LINE__
|
14
|
+
def #{name}
|
15
|
+
associations[:#{name}]
|
16
|
+
end
|
17
|
+
EOS
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
class OracleOneModel < OracleDefault
|
22
|
+
def create_setter
|
23
|
+
model.class_eval <<-EOS, __FILE__, __LINE__
|
24
|
+
def #{name}=(new_#{name})
|
25
|
+
return if new_#{name}.nil?
|
26
|
+
associations[:#{name}] = service.send(self.class.associations[:#{name}]).new(new_#{name})
|
27
|
+
end
|
28
|
+
EOS
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
class OracleManyModels < OracleDefault
|
33
|
+
def create_setter
|
34
|
+
model.class_eval <<-EOS, __FILE__, __LINE__
|
35
|
+
def #{name}=(new_#{name})
|
36
|
+
return if new_#{name}.nil?
|
37
|
+
collection = service.send(self.class.associations[:#{name}])
|
38
|
+
associations[:#{name}] = Array(new_#{name}).map do |association|
|
39
|
+
collection.new(association)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
EOS
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
class OracleOneIdentity < OracleDefault
|
47
|
+
attr_reader :details_name
|
48
|
+
|
49
|
+
def initialize(model, name, collection_name, options)
|
50
|
+
@details_name = options[:details_name]
|
51
|
+
super(model, name, collection_name, options)
|
52
|
+
end
|
53
|
+
|
54
|
+
def create_getter
|
55
|
+
super
|
56
|
+
|
57
|
+
model.class_eval <<-EOS, __FILE__, __LINE__
|
58
|
+
def #{details_name}
|
59
|
+
return nil if associations[:#{name}].nil?
|
60
|
+
service.send(self.class.associations[:#{name}]).get(associations[:#{name}])
|
61
|
+
end
|
62
|
+
EOS
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
class OracleManyIdentities < OracleDefault
|
67
|
+
attr_reader :all_name
|
68
|
+
|
69
|
+
def initialize(model, name, collection_name, options)
|
70
|
+
@all_name = options[:all_name]
|
71
|
+
super(model, name, collection_name, options)
|
72
|
+
end
|
73
|
+
|
74
|
+
def create_getter
|
75
|
+
super
|
76
|
+
|
77
|
+
model.class_eval <<-EOS, __FILE__, __LINE__
|
78
|
+
def #{all_name}
|
79
|
+
return [] if associations[:#{name}].nil?
|
80
|
+
data = Array(associations[:#{name}]).map do |association|
|
81
|
+
service.send(self.class.associations[:#{name}]).get(association)
|
82
|
+
end
|
83
|
+
#{association_class}.new(data)
|
84
|
+
end
|
85
|
+
EOS
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Oracle
|
5
|
+
class Collection < Fog::Collection
|
6
|
+
# It's important to store the whole response, it contains e.g. important info about whether there is another
|
7
|
+
# page of data.
|
8
|
+
attr_accessor :response
|
9
|
+
|
10
|
+
def id_value(id)
|
11
|
+
if id.is_a?(Hash)
|
12
|
+
id["value"]
|
13
|
+
else
|
14
|
+
id
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def load_response(response)
|
19
|
+
objects = response.body
|
20
|
+
|
21
|
+
clear && objects.each { |object| self << new(object) }
|
22
|
+
self.response = response
|
23
|
+
self
|
24
|
+
end
|
25
|
+
|
26
|
+
def new_from_response(response)
|
27
|
+
obj = new(response.body)
|
28
|
+
obj.response = response
|
29
|
+
obj
|
30
|
+
end
|
31
|
+
|
32
|
+
##################################################################################################################
|
33
|
+
# Abstract base class methods, please keep the consistent naming in all subclasses of the Collection class
|
34
|
+
|
35
|
+
# Returns detailed list of records
|
36
|
+
def all(options = {})
|
37
|
+
raise Fog::Oracle::Errors::InterfaceNotImplemented.new('Method :all is not implemented')
|
38
|
+
end
|
39
|
+
|
40
|
+
# Gets record given record's id
|
41
|
+
def get(id)
|
42
|
+
raise Fog::Oracle::Errors::InterfaceNotImplemented.new('Method :get is not implemented')
|
43
|
+
end
|
44
|
+
alias_method :find_by_id, :get
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'fog/oracle/models/compute/base_object'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Compute
|
5
|
+
class Oracle
|
6
|
+
class AccessGroup < BaseObject
|
7
|
+
attribute :name_on_array, :type => :string
|
8
|
+
attribute :type, :type => :string # AccessGroupType
|
9
|
+
has_many_identities :file_system_ids, :file_systems, :all_name => :file_systems
|
10
|
+
has_many_identities :server_ids, :servers, :all_name => :servers
|
11
|
+
has_many_identities :storage_element_ids, :storage_elements, :all_name => :storage_elements
|
12
|
+
has_many_identities :storage_initiator_ids, :storage_initiators, :all_name => :storage_initiators
|
13
|
+
has_one_identity :file_server_id, :file_servers, :details_name => :file_server
|
14
|
+
has_one_identity :storage_array_id, :storage_arrays, :details_name => :storage_array
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'fog/oracle/models/collection'
|
2
|
+
require 'fog/oracle/models/compute/access_group'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Compute
|
6
|
+
class Oracle
|
7
|
+
class AccessGroups < Fog::Oracle::Collection
|
8
|
+
model Fog::Compute::Oracle::AccessGroup
|
9
|
+
|
10
|
+
def all()
|
11
|
+
data = service.list_access_groups()
|
12
|
+
load_response(data)
|
13
|
+
end
|
14
|
+
|
15
|
+
def get(id)
|
16
|
+
data = service.get_access_group(id_value(id))
|
17
|
+
new_from_response(data)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'fog/oracle/models/model'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Compute
|
5
|
+
class Oracle
|
6
|
+
class AccessHost < Fog::Oracle::Model
|
7
|
+
attribute :hostname, :type => :string
|
8
|
+
attribute :password, :type => :string
|
9
|
+
attribute :port, :type => :integer
|
10
|
+
attribute :username, :type => :string
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'fog/oracle/models/collection'
|
2
|
+
require 'fog/oracle/models/compute/access_host'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Compute
|
6
|
+
class Oracle
|
7
|
+
class AccessHosts < Fog::Oracle::Collection
|
8
|
+
model Fog::Compute::Oracle::AccessHost
|
9
|
+
|
10
|
+
def all()
|
11
|
+
data = service.list_access_hosts()
|
12
|
+
load_response(data)
|
13
|
+
end
|
14
|
+
|
15
|
+
def get(id)
|
16
|
+
data = service.get_access_host(id_value(id))
|
17
|
+
new_from_response(data)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'fog/oracle/models/compute/base_object'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Compute
|
5
|
+
class Oracle
|
6
|
+
class AffinityGroup < BaseObject
|
7
|
+
attribute :server_affinity_type, :type => :string # AffinityType
|
8
|
+
attribute :vm_affinity_type, :type => :string # AffinityType
|
9
|
+
has_many_identities :server_ids, :servers, :all_name => :servers
|
10
|
+
has_many_identities :vm_ids, :vms, :all_name => :vms
|
11
|
+
has_one_identity :server_pool_id, :server_pools, :details_name => :server_pool
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'fog/oracle/models/collection'
|
2
|
+
require 'fog/oracle/models/compute/affinity_group'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Compute
|
6
|
+
class Oracle
|
7
|
+
class AffinityGroups < Fog::Oracle::Collection
|
8
|
+
model Fog::Compute::Oracle::AffinityGroup
|
9
|
+
|
10
|
+
def all()
|
11
|
+
data = service.list_affinity_groups()
|
12
|
+
load_response(data)
|
13
|
+
end
|
14
|
+
|
15
|
+
def get(id)
|
16
|
+
data = service.get_affinity_group(id_value(id))
|
17
|
+
new_from_response(data)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fog/oracle/models/model'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Compute
|
5
|
+
class Oracle
|
6
|
+
class ArchiveManagementAttributes < Fog::Oracle::Model
|
7
|
+
attribute :archive_events_max_age, :type => :integer
|
8
|
+
attribute :archive_jobs_max_age, :type => :integer
|
9
|
+
attribute :constructing_jobs_max_age, :type => :integer
|
10
|
+
attribute :interval, :type => :integer
|
11
|
+
attribute :live_events_max_age, :type => :integer
|
12
|
+
attribute :live_jobs_max_age, :type => :integer
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'fog/oracle/models/collection'
|
2
|
+
require 'fog/oracle/models/compute/archive_management_attributes'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Compute
|
6
|
+
class Oracle
|
7
|
+
class ArchiveManagementAttributeses < Fog::Oracle::Collection
|
8
|
+
model Fog::Compute::Oracle::ArchiveManagementAttributes
|
9
|
+
|
10
|
+
def all()
|
11
|
+
data = service.list_archive_management_attributeses()
|
12
|
+
load_response(data)
|
13
|
+
end
|
14
|
+
|
15
|
+
def get(id)
|
16
|
+
data = service.get_archive_management_attributes(id_value(id))
|
17
|
+
new_from_response(data)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'fog/oracle/models/collection'
|
2
|
+
require 'fog/oracle/models/compute/assembly'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Compute
|
6
|
+
class Oracle
|
7
|
+
class Assemblies < Fog::Oracle::Collection
|
8
|
+
model Fog::Compute::Oracle::Assembly
|
9
|
+
|
10
|
+
def all()
|
11
|
+
data = service.list_assemblies()
|
12
|
+
load_response(data)
|
13
|
+
end
|
14
|
+
|
15
|
+
def get(id)
|
16
|
+
data = service.get_assembly(id_value(id))
|
17
|
+
new_from_response(data)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'fog/oracle/models/compute/base_object'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Compute
|
5
|
+
class Oracle
|
6
|
+
class Assembly < BaseObject
|
7
|
+
attribute :locales, :type => :array # of :string
|
8
|
+
attribute :origin, :type => :string
|
9
|
+
has_many_identities :assembly_virtual_disk_ids, :assembly_virtual_disks, :all_name => :assembly_virtual_disks
|
10
|
+
has_many_identities :assembly_vm_ids, :assembly_vms, :all_name => :assembly_vms
|
11
|
+
has_one_identity :repository_id, :repositories, :details_name => :repository
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|