Module: ViprStoragePort
- Included in:
- Vipr
- Defined in:
- lib/vipruby/objects/storageport.rb
Overview
The following StoragePort calls will get and execute StoragePort items
Instance Method Summary collapse
-
#check_storage_port_id_post(storage_port_id = nil) ⇒ Boolean
private
Error Handling method to check for Missing Storage Port ID param.
-
#get_storage_port(storage_port_id, auth = nil, cert = nil) ⇒ JSON
Get single StoragePort information.
-
#get_storage_ports(auth = nil, cert = nil) ⇒ json
Get All StoragePorts.
-
#storage_port_deactivate(storage_port_id = nil, auth = nil, cert = nil) ⇒ JSON
Deactivate StoragePort.
-
#storage_port_deregister(storage_port_id = nil, auth = nil, cert = nil) ⇒ JSON
Deregister StoragePort.
Instance Method Details
#check_storage_port_id_post(storage_port_id = nil) ⇒ Boolean (private)
Error Handling method to check for Missing Storage Port ID param. If the pass fails, an error exception is raised
55 56 57 58 59 |
# File 'lib/vipruby/objects/storageport.rb', line 55 def check_storage_port_id_post(storage_port_id=nil) if storage_port_id == nil raise "Missing param (storage_port_id)" end end |
#get_storage_port(storage_port_id, auth = nil, cert = nil) ⇒ JSON
Get single StoragePort information
17 18 19 |
# File 'lib/vipruby/objects/storageport.rb', line 17 def get_storage_port(storage_port_id,auth=nil, cert=nil) rest_get("#{@base_url}/vdc/storage-ports/#{storage_port_id}", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
#get_storage_ports(auth = nil, cert = nil) ⇒ json
Get All StoragePorts
8 9 10 |
# File 'lib/vipruby/objects/storageport.rb', line 8 def get_storage_ports(auth=nil, cert=nil) rest_get("#{@base_url}/vdc/storage-ports", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
#storage_port_deactivate(storage_port_id = nil, auth = nil, cert = nil) ⇒ JSON
Deactivate StoragePort. Remove a storage port. The method would remove the deregistered storage port and all resources associated with the storage port from the database. Note they are not removed from the storage system physically, but become unavailable for the user.
39 40 41 42 43 44 45 |
# File 'lib/vipruby/objects/storageport.rb', line 39 def storage_port_deactivate(storage_port_id=nil,auth=nil, cert=nil) check_storage_port_id_post(storage_port_id) payload = { id: storage_port_id }.to_json rest_post(payload, "#{@base_url}/vdc/storage-ports/#{storage_port_id}/deactivate", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
#storage_port_deregister(storage_port_id = nil, auth = nil, cert = nil) ⇒ JSON
Deregister StoragePort. Allows the user to deregister a registered storage port so that it is no longer used by the system. This simply sets the registration_status of the storage port to UNREGISTERED
26 27 28 29 30 31 32 |
# File 'lib/vipruby/objects/storageport.rb', line 26 def storage_port_deregister(storage_port_id=nil,auth=nil, cert=nil) check_storage_port_id_post(storage_port_id) payload = { id: storage_port_id }.to_json rest_post(payload, "#{@base_url}/vdc/storage-ports/#{storage_port_id}/deregister", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |