Class: Fog::Compute::XenServer::Mock
- Inherits:
-
Object
- Object
- Fog::Compute::XenServer::Mock
- Defined in:
- lib/fog/xenserver/compute.rb,
lib/fog/xenserver/requests/compute/scan_sr.rb,
lib/fog/xenserver/requests/compute/start_vm.rb,
lib/fog/xenserver/requests/compute/create_sr.rb,
lib/fog/xenserver/requests/compute/eject_vbd.rb,
lib/fog/xenserver/requests/compute/create_vbd.rb,
lib/fog/xenserver/requests/compute/create_vdi.rb,
lib/fog/xenserver/requests/compute/create_vif.rb,
lib/fog/xenserver/requests/compute/destroy_sr.rb,
lib/fog/xenserver/requests/compute/get_record.rb,
lib/fog/xenserver/requests/compute/insert_vbd.rb,
lib/fog/xenserver/requests/compute/unplug_pbd.rb,
lib/fog/xenserver/requests/compute/unplug_vbd.rb,
lib/fog/xenserver/requests/compute/create_vlan.rb,
lib/fog/xenserver/requests/compute/destroy_vdi.rb,
lib/fog/xenserver/requests/compute/destroy_vif.rb,
lib/fog/xenserver/requests/compute/enable_host.rb,
lib/fog/xenserver/requests/compute/get_records.rb,
lib/fog/xenserver/requests/compute/reboot_host.rb,
lib/fog/xenserver/requests/compute/clone_server.rb,
lib/fog/xenserver/requests/compute/destroy_vlan.rb,
lib/fog/xenserver/requests/compute/disable_host.rb,
lib/fog/xenserver/requests/compute/set_affinity.rb,
lib/fog/xenserver/requests/compute/start_server.rb,
lib/fog/xenserver/requests/compute/create_server.rb,
lib/fog/xenserver/requests/compute/reboot_server.rb,
lib/fog/xenserver/requests/compute/set_attribute.rb,
lib/fog/xenserver/requests/compute/shutdown_host.rb,
lib/fog/xenserver/requests/compute/create_network.rb,
lib/fog/xenserver/requests/compute/destroy_server.rb,
lib/fog/xenserver/requests/compute/destroy_network.rb,
lib/fog/xenserver/requests/compute/shutdown_server.rb,
lib/fog/xenserver/requests/compute/snapshot_revert.rb,
lib/fog/xenserver/requests/compute/snapshot_server.rb,
lib/fog/xenserver/requests/compute/provision_server.rb
Class Method Summary collapse
Instance Method Summary collapse
- #clone_server(server_name, template_ref) ⇒ Object
- #create_network(name, description = '', config = {}) ⇒ Object
- #create_server(name_label, template = nil, network = nil, extra_args = {}) ⇒ Object
- #create_server_raw(config = {}) ⇒ Object
- #create_sr(host_ref, name_label, type, name_description = nil, device_config = {}, physical_size = '0', content_type = nil, shared = false, sm_config = {}) ⇒ Object
- #create_vbd(config) ⇒ Object
- #create_vdi(ref) ⇒ Object
- #create_vif(vm_ref, network_ref) ⇒ Object
- #create_vlan(pif_ref, vlan_id, network_ref) ⇒ Object
- #destroy_network(ref) ⇒ Object
- #destroy_server ⇒ Object
- #destroy_sr(sr_ref) ⇒ Object
- #destroy_vdi ⇒ Object
- #destroy_vif ⇒ Object
- #destroy_vlan(ref) ⇒ Object
- #disable_host(ref) ⇒ Object
- #eject_vbd(ref, extra_args = {}) ⇒ Object
- #enable_host(ref) ⇒ Object
- #get_record_by_ref ⇒ Object
- #get_vms ⇒ Object
-
#initialize(options = {}) ⇒ Mock
constructor
A new instance of Mock.
- #insert_vbd(ref, vdi_ref, extra_args = {}) ⇒ Object
- #provision_server(ref) ⇒ Object
- #reboot_host(ref) ⇒ Object
- #reboot_server(ref, stype) ⇒ Object
- #revert_server ⇒ Object
- #scan_sr(ref, extra_args = {}) ⇒ Object
- #set_affinity(uuid) ⇒ Object
- #set_attribute(klass, ref, attr_name, value) ⇒ Object
- #shutdown_host(ref) ⇒ Object
- #shutdown_server(vm_ref) ⇒ Object
- #snapshot_server ⇒ Object
- #start_server(vm_ref) ⇒ Object
- #start_vm(vm_ref) ⇒ Object
- #unplug_force_vbd(ref, extra_args = {}) ⇒ Object
- #unplug_pbd(ref) ⇒ Object
- #unplug_vbd(ref, extra_args = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Mock
Returns a new instance of Mock.
175 176 177 178 179 180 181 |
# File 'lib/fog/xenserver/compute.rb', line 175 def initialize(={}) @host = [:xenserver_pool_master] @username = [:xenserver_username] @password = [:xenserver_password] @connection = Fog::XML::Connection.new(@host) @connection.authenticate(@username, @password) end |
Class Method Details
.data ⇒ Object
163 164 165 166 167 |
# File 'lib/fog/xenserver/compute.rb', line 163 def self.data @data ||= Hash.new do |hash, key| hash[key] = {} end end |
.reset_data(keys = data.keys) ⇒ Object
169 170 171 172 173 |
# File 'lib/fog/xenserver/compute.rb', line 169 def self.reset_data(keys=data.keys) for key in [*keys] data.delete(key) end end |
Instance Method Details
#clone_server(server_name, template_ref) ⇒ Object
24 25 26 |
# File 'lib/fog/xenserver/requests/compute/clone_server.rb', line 24 def clone_server( server_name, template_ref ) Fog::Mock.not_implemented end |
#create_network(name, description = '', config = {}) ⇒ Object
40 41 42 |
# File 'lib/fog/xenserver/requests/compute/create_network.rb', line 40 def create_network( name, description = '', config = {} ) Fog::Mock.not_implemented end |
#create_server(name_label, template = nil, network = nil, extra_args = {}) ⇒ Object
134 135 136 |
# File 'lib/fog/xenserver/requests/compute/create_server.rb', line 134 def create_server( name_label, template = nil, network = nil, extra_args = {}) Fog::Mock.not_implemented end |
#create_server_raw(config = {}) ⇒ Object
138 139 140 |
# File 'lib/fog/xenserver/requests/compute/create_server.rb', line 138 def create_server_raw(config = {}) Fog::Mock.not_implemented end |
#create_sr(host_ref, name_label, type, name_description = nil, device_config = {}, physical_size = '0', content_type = nil, shared = false, sm_config = {}) ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/fog/xenserver/requests/compute/create_sr.rb', line 74 def create_sr( host_ref, name_label, type, name_description = nil, device_config = {}, physical_size = '0', content_type = nil, shared = false, sm_config = {} ) Fog::Mock.not_implemented end |
#create_vbd(config) ⇒ Object
37 38 39 |
# File 'lib/fog/xenserver/requests/compute/create_vbd.rb', line 37 def create_vbd( config ) Fog::Mock.not_implemented end |
#create_vdi(ref) ⇒ Object
51 52 53 |
# File 'lib/fog/xenserver/requests/compute/create_vdi.rb', line 51 def create_vdi( ref ) Fog::Mock.not_implemented end |
#create_vif(vm_ref, network_ref) ⇒ Object
56 57 58 |
# File 'lib/fog/xenserver/requests/compute/create_vif.rb', line 56 def create_vif( vm_ref, network_ref ) Fog::Mock.not_implemented end |
#create_vlan(pif_ref, vlan_id, network_ref) ⇒ Object
37 38 39 |
# File 'lib/fog/xenserver/requests/compute/create_vlan.rb', line 37 def create_vlan( pif_ref, vlan_id, network_ref ) Fog::Mock.not_implemented end |
#destroy_network(ref) ⇒ Object
25 26 27 |
# File 'lib/fog/xenserver/requests/compute/destroy_network.rb', line 25 def destroy_network( ref ) Fog::Mock.not_implemented end |
#destroy_server ⇒ Object
14 15 16 |
# File 'lib/fog/xenserver/requests/compute/destroy_server.rb', line 14 def destroy_server() Fog::Mock.not_implemented end |
#destroy_sr(sr_ref) ⇒ Object
22 23 24 |
# File 'lib/fog/xenserver/requests/compute/destroy_sr.rb', line 22 def destroy_sr( sr_ref ) Fog::Mock.not_implemented end |
#destroy_vdi ⇒ Object
14 15 16 |
# File 'lib/fog/xenserver/requests/compute/destroy_vdi.rb', line 14 def destroy_vdi() Fog::Mock.not_implemented end |
#destroy_vif ⇒ Object
14 15 16 |
# File 'lib/fog/xenserver/requests/compute/destroy_vif.rb', line 14 def destroy_vif() Fog::Mock.not_implemented end |
#destroy_vlan(ref) ⇒ Object
24 25 26 |
# File 'lib/fog/xenserver/requests/compute/destroy_vlan.rb', line 24 def destroy_vlan( ref ) Fog::Mock.not_implemented end |
#disable_host(ref) ⇒ Object
17 18 19 |
# File 'lib/fog/xenserver/requests/compute/disable_host.rb', line 17 def disable_host( ref ) Fog::Mock.not_implemented end |
#eject_vbd(ref, extra_args = {}) ⇒ Object
11 12 13 |
# File 'lib/fog/xenserver/requests/compute/eject_vbd.rb', line 11 def eject_vbd(ref, extra_args = {}) Fog::Mock.not_implemented end |
#enable_host(ref) ⇒ Object
16 17 18 |
# File 'lib/fog/xenserver/requests/compute/enable_host.rb', line 16 def enable_host( ref ) Fog::Mock.not_implemented end |
#get_record_by_ref ⇒ Object
25 26 27 |
# File 'lib/fog/xenserver/requests/compute/get_record.rb', line 25 def get_record_by_ref Fog::Mock.not_implemented end |
#get_vms ⇒ Object
18 19 20 |
# File 'lib/fog/xenserver/requests/compute/get_records.rb', line 18 def get_vms Fog::Mock.not_implemented end |
#insert_vbd(ref, vdi_ref, extra_args = {}) ⇒ Object
11 12 13 |
# File 'lib/fog/xenserver/requests/compute/insert_vbd.rb', line 11 def insert_vbd(ref, vdi_ref, extra_args = {}) Fog::Mock.not_implemented end |
#provision_server(ref) ⇒ Object
11 12 13 |
# File 'lib/fog/xenserver/requests/compute/provision_server.rb', line 11 def provision_server( ref ) Fog::Mock.not_implemented end |
#reboot_host(ref) ⇒ Object
11 12 13 |
# File 'lib/fog/xenserver/requests/compute/reboot_host.rb', line 11 def reboot_host( ref ) Fog::Mock.not_implemented end |
#reboot_server(ref, stype) ⇒ Object
11 12 13 |
# File 'lib/fog/xenserver/requests/compute/reboot_server.rb', line 11 def reboot_server( ref, stype ) Fog::Mock.not_implemented end |
#revert_server ⇒ Object
18 19 20 |
# File 'lib/fog/xenserver/requests/compute/snapshot_revert.rb', line 18 def revert_server() Fog::Mock.not_implemented end |
#scan_sr(ref, extra_args = {}) ⇒ Object
11 12 13 |
# File 'lib/fog/xenserver/requests/compute/scan_sr.rb', line 11 def scan_sr(ref, extra_args = {}) Fog::Mock.not_implemented end |
#set_affinity(uuid) ⇒ Object
13 14 15 |
# File 'lib/fog/xenserver/requests/compute/set_affinity.rb', line 13 def set_affinity( uuid ) Fog::Mock.not_implemented end |
#set_attribute(klass, ref, attr_name, value) ⇒ Object
13 14 15 |
# File 'lib/fog/xenserver/requests/compute/set_attribute.rb', line 13 def set_attribute( klass, ref, attr_name, value ) Fog::Mock.not_implemented end |
#shutdown_host(ref) ⇒ Object
11 12 13 |
# File 'lib/fog/xenserver/requests/compute/shutdown_host.rb', line 11 def shutdown_host( ref ) Fog::Mock.not_implemented end |
#shutdown_server(vm_ref) ⇒ Object
11 12 13 |
# File 'lib/fog/xenserver/requests/compute/shutdown_server.rb', line 11 def shutdown_server( vm_ref ) Fog::Mock.not_implemented end |
#snapshot_server ⇒ Object
11 12 13 |
# File 'lib/fog/xenserver/requests/compute/snapshot_server.rb', line 11 def snapshot_server() Fog::Mock.not_implemented end |
#start_server(vm_ref) ⇒ Object
11 12 13 |
# File 'lib/fog/xenserver/requests/compute/start_server.rb', line 11 def start_server( vm_ref ) Fog::Mock.not_implemented end |
#start_vm(vm_ref) ⇒ Object
13 14 15 |
# File 'lib/fog/xenserver/requests/compute/start_vm.rb', line 13 def start_vm( vm_ref ) Fog::Mock.not_implemented end |
#unplug_force_vbd(ref, extra_args = {}) ⇒ Object
19 20 21 |
# File 'lib/fog/xenserver/requests/compute/unplug_vbd.rb', line 19 def unplug_force_vbd(ref, extra_args = {}) Fog::Mock.not_implemented end |
#unplug_pbd(ref) ⇒ Object
14 15 16 |
# File 'lib/fog/xenserver/requests/compute/unplug_pbd.rb', line 14 def unplug_pbd( ref ) Fog::Mock.not_implemented end |
#unplug_vbd(ref, extra_args = {}) ⇒ Object
15 16 17 |
# File 'lib/fog/xenserver/requests/compute/unplug_vbd.rb', line 15 def unplug_vbd(ref, extra_args = {}) Fog::Mock.not_implemented end |