Module: ViprStorageSystem
- Included in:
- Vipr
- Defined in:
- lib/vipruby/objects/storagesystem.rb
Overview
The Following Storage System calls will add Storage Systems for all tenants. these commands can only be ran as the root/default tenant
Instance Method Summary (collapse)
-
- (Hash) add_emc_block(name = nil, ip_or_dns = nil, user_name = nil, password = nil, port = nil, use_ssl = nil, auth = nil, cert = nil)
Add EMC VMAX and VNX Block Storage System.
-
- (Hash) add_emc_file(name = nil, ip_or_dns = nil, user_name = nil, password = nil, port = nil, smis_provider_ip = nil, smis_user_name = nil, smis_password = nil, smis_port_number = nil, smis_use_ssl = nil, auth = nil, cert = nil)
Add EMC VNX for File Storage Provider.
-
- (Hash) add_hitachi(name = nil, ip_or_dns = nil, user_name = nil, password = nil, port = nil, use_ssl = nil, auth = nil, cert = nil)
Add Hitachi Storage Systems.
-
- (Hash) add_isilon(name = nil, ip_or_dns = nil, user_name = nil, password = nil, port = nil, auth = nil, cert = nil)
Add Isilon Storage Provider.
-
- (Hash) add_netapp(name = nil, ip_or_dns = nil, user_name = nil, password = nil, port = nil, auth = nil, cert = nil)
Add NetApp Storage Provider.
-
- (Hash) add_scaleio(name = nil, ip_or_dns = nil, user_name = nil, password = nil, port = nil, use_ssl = nil, auth = nil, cert = nil)
Add ScaleIO Storage Systems.
-
- (Hash) add_third_party_block(name = nil, ip_or_dns = nil, user_name = nil, password = nil, port = nil, use_ssl = nil, auth = nil, cert = nil)
Add Third Party Block Storage Provider.
-
- (Hash) add_vplex(name = nil, ip_or_dns = nil, user_name = nil, password = nil, port = nil, use_ssl = nil, auth = nil, cert = nil)
Add VPLEX Storage Systems.
-
- (Boolean) check_storage_provider_payload(name = nil, ip_or_dns = nil)
private
Error Handling method to check for Missing Param.
-
- (Boolean) check_storage_system_id_post(storage_system_id = nil)
private
True if pass, false if it fails.
-
- (JSON) get_storage_provider(storage_provider_id, auth = nil, cert = nil)
Get single Storage Provider information.
-
- (JSON) get_storage_provider_storage_system(storage_provider_id, storage_system_id, auth = nil, cert = nil)
Get single Storage Provider Storage System information.
-
- (JSON) get_storage_provider_storage_systems(storage_provider_id, auth = nil, cert = nil)
Get single Storage Provider Storage Systems information.
-
- (JSON) get_storage_provider_tasks(storage_provider_id, auth = nil, cert = nil)
Get single Storage Provider Tasks information.
-
- (json) get_storage_providers(auth = nil, cert = nil)
Get All Storage Providers.
-
- (JSON) get_storage_system(storage_system_id, auth = nil, cert = nil)
Get single Storage System information.
-
- (JSON) get_storage_system_auto_tier_policy(storage_system_id, auth = nil, cert = nil)
Get single Storage System Auto-Tier Policies.
-
- (JSON) get_storage_system_storage_pools(storage_system_id, auth = nil, cert = nil)
Get single Storage System Storage Pools.
-
- (JSON) get_storage_system_storage_ports(storage_system_id, auth = nil, cert = nil)
Get single Storage System Storage Ports.
-
- (JSON) get_storage_system_unmanaged_filesystems(storage_system_id, auth = nil, cert = nil)
Get single Storage System unmanaged filesystems available.
-
- (JSON) get_storage_system_unmanaged_volumes(storage_system_id, auth = nil, cert = nil)
Get single Storage System unmanaged volumes available.
-
- (json) get_storage_systems(auth = nil, cert = nil)
Get All Storage Systems.
-
- (JSON) storage_provider_payload(name, interface_type, ip_or_dns, port, user_name, password, use_ssl)
The JSON structure for the post operation.
-
- (JSON) storage_system_deactivate(storage_system_id = nil, auth = nil, cert = nil)
Deactivate Storage System.
-
- (JSON) storage_system_deregister(storage_system_id = nil, auth = nil, cert = nil)
Deregister Storage System.
-
- (JSON) storage_system_discover(storage_system_id = nil, auth = nil, cert = nil)
Discover Storage System.
-
- (JSON) storage_system_payload(name, system_type, ip_or_dns, port, user_name, password, smis_provider_ip = nil, smis_port_number = nil, smis_user_name = nil, smis_password = nil, smis_use_ssl = nil)
The JSON structure for the post operation.
-
- (JSON) storage_system_register(storage_system_id = nil, auth = nil, cert = nil)
Register Storage System.
Instance Method Details
- (Hash) add_emc_block(name = nil, ip_or_dns = nil, user_name = nil, password = nil, port = nil, use_ssl = nil, auth = nil, cert = nil)
For supported versions, see the EMC ViPR Support Matrix on the EMC Community Network (community.emc.com)
Add EMC VMAX and VNX Block Storage System
248 249 250 251 252 |
# File 'lib/vipruby/objects/storagesystem.rb', line 248 def add_emc_block(name=nil, ip_or_dns=nil, user_name=nil, password=nil, port=nil, use_ssl=nil, auth=nil, cert=nil) check_storage_provider_payload(name, ip_or_dns) port.nil? ? port = '5989' : port = port rest_post(storage_provider_payload(name, 'smis', ip_or_dns, port, user_name, password, use_ssl), "#{@base_url}/vdc/storage-providers", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (Hash) add_emc_file(name = nil, ip_or_dns = nil, user_name = nil, password = nil, port = nil, smis_provider_ip = nil, smis_user_name = nil, smis_password = nil, smis_port_number = nil, smis_use_ssl = nil, auth = nil, cert = nil)
VNX File Control Station default port is 443. VNX File Onboard Storage Provider default port is 5988
Add EMC VNX for File Storage Provider
391 392 393 394 395 396 |
# File 'lib/vipruby/objects/storagesystem.rb', line 391 def add_emc_file(name=nil, ip_or_dns=nil, user_name=nil, password=nil, port=nil, smis_provider_ip=nil, smis_user_name=nil, smis_password=nil, smis_port_number=nil, smis_use_ssl=nil, auth=nil, cert=nil) check_storage_provider_payload(name, ip_or_dns) port.nil? ? port = '443' : port = port smis_port_number.nil? ? smis_port_number = '5988' : smis_port_number = smis_port_number rest_post(storage_system_payload(name, 'vnxfile', ip_or_dns, port, user_name, password, smis_provider_ip, smis_port_number, smis_user_name, smis_password, smis_use_ssl), "#{@base_url}/vdc/storage-systems", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (Hash) add_hitachi(name = nil, ip_or_dns = nil, user_name = nil, password = nil, port = nil, use_ssl = nil, auth = nil, cert = nil)
For supported versions, see the EMC ViPR Support Matrix on the EMC Community Network (community.emc.com). Hitachi HiCommand Device Manager is required to use HDS storage with ViPR. You need to obtain the following information to configure and add the Hitachi HiCommand Device manager to ViPR: (1) A host or virtual machine for HiCommand Device manager setup (2) HiCommand Device Manager license, host address, credentials, and host port (default is 2001)
Add Hitachi Storage Systems
274 275 276 277 278 |
# File 'lib/vipruby/objects/storagesystem.rb', line 274 def add_hitachi(name=nil, ip_or_dns=nil, user_name=nil, password=nil, port=nil, use_ssl=nil, auth=nil, cert=nil) check_storage_provider_payload(name, ip_or_dns) port.nil? ? port = '2001' : port = port rest_post(storage_provider_payload(name, 'hicommand', ip_or_dns, port, user_name, password, use_ssl), "#{@base_url}/vdc/storage-providers", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (Hash) add_isilon(name = nil, ip_or_dns = nil, user_name = nil, password = nil, port = nil, auth = nil, cert = nil)
Supported Protocol: NFS, CIFS (Snapshot restore is not supported for Isilon storage systems.). Port (default is 8080)
Add Isilon Storage Provider
366 367 368 369 370 |
# File 'lib/vipruby/objects/storagesystem.rb', line 366 def add_isilon(name=nil, ip_or_dns=nil, user_name=nil, password=nil, port=nil, auth=nil, cert=nil) check_storage_provider_payload(name, ip_or_dns) port.nil? ? port = '8080' : port = port rest_post(storage_system_payload(name, 'isilon', ip_or_dns, port, user_name, password), "#{@base_url}/vdc/storage-systems", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (Hash) add_netapp(name = nil, ip_or_dns = nil, user_name = nil, password = nil, port = nil, auth = nil, cert = nil)
Supported Protocol: NFS, CIFS For supported versions, see the EMC ViPR Support Matrix available on the EMC Community Network (community.emc.com).
Add NetApp Storage Provider
414 415 416 417 418 |
# File 'lib/vipruby/objects/storagesystem.rb', line 414 def add_netapp(name=nil, ip_or_dns=nil, user_name=nil, password=nil, port=nil, auth=nil, cert=nil) check_storage_provider_payload(name, ip_or_dns) port.nil? ? port = '443' : port = port rest_post(storage_system_payload(name, 'netapp', ip_or_dns, port, user_name, password), "#{@base_url}/vdc/storage-systems", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (Hash) add_scaleio(name = nil, ip_or_dns = nil, user_name = nil, password = nil, port = nil, use_ssl = nil, auth = nil, cert = nil)
Supported versions: ScaleIO 1.21.0.20 or later. Preconfiguration requirements: (1) Protection domains are defined. (2) All storage pools are defined.
Add ScaleIO Storage Systems
321 322 323 324 325 |
# File 'lib/vipruby/objects/storagesystem.rb', line 321 def add_scaleio(name=nil, ip_or_dns=nil, user_name=nil, password=nil, port=nil, use_ssl=nil, auth=nil, cert=nil) check_storage_provider_payload(name, ip_or_dns) port.nil? ? port = '22' : port = port rest_post(storage_provider_payload(name, 'scaleio', ip_or_dns, port, user_name, password, use_ssl), "#{@base_url}/vdc/storage-providers", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (Hash) add_third_party_block(name = nil, ip_or_dns = nil, user_name = nil, password = nil, port = nil, use_ssl = nil, auth = nil, cert = nil)
ViPR uses the OpenStack Block Storage (Cinder) Service to add third-party block storage systems to ViPR. For supported versions, see the EMC ViPR Support Matrix available on the EMC Community Network (community.emc.com).
Add Third Party Block Storage Provider
344 345 346 347 348 |
# File 'lib/vipruby/objects/storagesystem.rb', line 344 def add_third_party_block(name=nil, ip_or_dns=nil, user_name=nil, password=nil, port=nil, use_ssl=nil, auth=nil, cert=nil) check_storage_provider_payload(name, ip_or_dns) port.nil? ? port = '22' : port = port rest_post(storage_provider_payload(name, 'cinder', ip_or_dns, port, user_name, password, use_ssl), "#{@base_url}/vdc/storage-providers", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (Hash) add_vplex(name = nil, ip_or_dns = nil, user_name = nil, password = nil, port = nil, use_ssl = nil, auth = nil, cert = nil)
ViPR supports VPLEX in a Local or Metro configuration. VPLEX Geo configurations are not supported.
Add VPLEX Storage Systems
296 297 298 299 300 |
# File 'lib/vipruby/objects/storagesystem.rb', line 296 def add_vplex(name=nil, ip_or_dns=nil, user_name=nil, password=nil, port=nil, use_ssl=nil, auth=nil, cert=nil) check_storage_provider_payload(name, ip_or_dns) port.nil? ? port = '443' : port = port rest_post(storage_provider_payload(name, 'vplex', ip_or_dns, port, user_name, password, use_ssl), "#{@base_url}/vdc/storage-providers", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (Boolean) check_storage_provider_payload(name = nil, ip_or_dns = nil) (private)
Error Handling method to check for Missing Param. If the pass fails, an error exception is raised
429 430 431 432 433 |
# File 'lib/vipruby/objects/storagesystem.rb', line 429 def check_storage_provider_payload(name=nil, ip_or_dns=nil) if name == nil || ip_or_dns == nil raise "Missing Param 'name' or 'ip_or_dns'" end end |
- (Boolean) check_storage_system_id_post(storage_system_id = nil) (private)
Returns True if pass, false if it fails
441 442 443 444 445 |
# File 'lib/vipruby/objects/storagesystem.rb', line 441 def check_storage_system_id_post(storage_system_id=nil) if storage_system_id == nil raise "Missing param (storage_system_id)" end end |
- (JSON) get_storage_provider(storage_provider_id, auth = nil, cert = nil)
Get single Storage Provider information
131 132 133 |
# File 'lib/vipruby/objects/storagesystem.rb', line 131 def get_storage_provider(storage_provider_id,auth=nil, cert=nil) rest_get("#{@base_url}/vdc/storage-providers/#{storage_provider_id}", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (JSON) get_storage_provider_storage_system(storage_provider_id, storage_system_id, auth = nil, cert = nil)
Get single Storage Provider Storage System information
150 151 152 |
# File 'lib/vipruby/objects/storagesystem.rb', line 150 def get_storage_provider_storage_system(storage_provider_id, storage_system_id,auth=nil, cert=nil) rest_get("#{@base_url}/vdc/storage-providers/#{storage_provider_id}/storage-systems/#{storage_system_id}", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (JSON) get_storage_provider_storage_systems(storage_provider_id, auth = nil, cert = nil)
Get single Storage Provider Storage Systems information
140 141 142 |
# File 'lib/vipruby/objects/storagesystem.rb', line 140 def get_storage_provider_storage_systems(storage_provider_id,auth=nil, cert=nil) rest_get("#{@base_url}/vdc/storage-providers/#{storage_provider_id}/storage-systems", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (JSON) get_storage_provider_tasks(storage_provider_id, auth = nil, cert = nil)
Get single Storage Provider Tasks information
159 160 161 |
# File 'lib/vipruby/objects/storagesystem.rb', line 159 def get_storage_provider_tasks(storage_provider_id,auth=nil, cert=nil) rest_get("#{@base_url}/vdc/storage-providers/#{storage_provider_id}/tasks", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (json) get_storage_providers(auth = nil, cert = nil)
Get All Storage Providers. Gets the id, name, and self link for all registered storage providers.
122 123 124 |
# File 'lib/vipruby/objects/storagesystem.rb', line 122 def get_storage_providers(auth=nil, cert=nil) rest_get("#{@base_url}/vdc/storage-providers", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (JSON) get_storage_system(storage_system_id, auth = nil, cert = nil)
Get single Storage System information
18 19 20 |
# File 'lib/vipruby/objects/storagesystem.rb', line 18 def get_storage_system(storage_system_id,auth=nil, cert=nil) rest_get("#{@base_url}/vdc/storage-systems/#{storage_system_id}", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (JSON) get_storage_system_auto_tier_policy(storage_system_id, auth = nil, cert = nil)
Get single Storage System Auto-Tier Policies
97 98 99 |
# File 'lib/vipruby/objects/storagesystem.rb', line 97 def get_storage_system_auto_tier_policy(storage_system_id,auth=nil, cert=nil) rest_get("#{@base_url}/vdc/storage-systemss/#{storage_system_id}/auto-tier-policies", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (JSON) get_storage_system_storage_pools(storage_system_id, auth = nil, cert = nil)
Get single Storage System Storage Pools
79 80 81 |
# File 'lib/vipruby/objects/storagesystem.rb', line 79 def get_storage_system_storage_pools(storage_system_id,auth=nil, cert=nil) rest_get("#{@base_url}/vdc/storage-systemss/#{storage_system_id}/storage-pools", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (JSON) get_storage_system_storage_ports(storage_system_id, auth = nil, cert = nil)
Get single Storage System Storage Ports
88 89 90 |
# File 'lib/vipruby/objects/storagesystem.rb', line 88 def get_storage_system_storage_ports(storage_system_id,auth=nil, cert=nil) rest_get("#{@base_url}/vdc/storage-systemss/#{storage_system_id}/storage-ports", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (JSON) get_storage_system_unmanaged_filesystems(storage_system_id, auth = nil, cert = nil)
Get single Storage System unmanaged filesystems available
115 116 117 |
# File 'lib/vipruby/objects/storagesystem.rb', line 115 def get_storage_system_unmanaged_filesystems(storage_system_id,auth=nil, cert=nil) rest_get("#{@base_url}/vdc/storage-systemss/#{storage_system_id}/unmanaged/filesystems", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (JSON) get_storage_system_unmanaged_volumes(storage_system_id, auth = nil, cert = nil)
Get single Storage System unmanaged volumes available
106 107 108 |
# File 'lib/vipruby/objects/storagesystem.rb', line 106 def get_storage_system_unmanaged_volumes(storage_system_id,auth=nil, cert=nil) rest_get("#{@base_url}/vdc/storage-systemss/#{storage_system_id}/unmanaged/volumes", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (json) get_storage_systems(auth = nil, cert = nil)
Get All Storage Systems. Gets the id, name, and self link for all registered storage systems.
9 10 11 |
# File 'lib/vipruby/objects/storagesystem.rb', line 9 def get_storage_systems(auth=nil, cert=nil) rest_get("#{@base_url}/vdc/storage-systems", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (JSON) storage_provider_payload(name, interface_type, ip_or_dns, port, user_name, password, use_ssl)
Returns The JSON structure for the post operation
174 175 176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/vipruby/objects/storagesystem.rb', line 174 def storage_provider_payload(name, interface_type, ip_or_dns, port, user_name, password, use_ssl) payload = { name: name, interface_type: interface_type, ip_address: ip_or_dns, port_number: port, user_name: user_name.nil? ? 'admin' : user_name, password: password.nil? ? '#1Password' : password, use_ssl: use_ssl.nil? ? false : use_ssl }.to_json return payload end |
- (JSON) storage_system_deactivate(storage_system_id = nil, auth = nil, cert = nil)
Deactivate Storage System. Remove a storage system. The method would remove the storage system from the system control and will remove all resources associated with the storage system from the database. Note that resources (pools, ports, volumes, etc.) are not removed from the storage system physically, but become unavailable for the user.
66 67 68 69 70 71 72 |
# File 'lib/vipruby/objects/storagesystem.rb', line 66 def storage_system_deactivate(storage_system_id=nil,auth=nil, cert=nil) check_storage_system_id_post(storage_system_id) payload = { id: storage_system_id }.to_json rest_post(payload, "#{@base_url}/vdc/storage-systems/#{storage_system_id}/deactivate", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (JSON) storage_system_deregister(storage_system_id = nil, auth = nil, cert = nil)
Deregister Storage System. Allows the user to deregister a registered storage system so that it is no longer used by the system. This simply sets the registration_status of the storage system to UNREGISTERED
53 54 55 56 57 58 59 |
# File 'lib/vipruby/objects/storagesystem.rb', line 53 def storage_system_deregister(storage_system_id=nil,auth=nil, cert=nil) check_storage_system_id_post(storage_system_id) payload = { id: storage_system_id }.to_json rest_post(payload, "#{@base_url}/vdc/storage-systems/#{storage_system_id}/deregister", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (JSON) storage_system_discover(storage_system_id = nil, auth = nil, cert = nil)
Discover Storage System. Allows the user to manually discover the registered storage system with the passed id.
40 41 42 43 44 45 46 |
# File 'lib/vipruby/objects/storagesystem.rb', line 40 def storage_system_discover(storage_system_id=nil,auth=nil, cert=nil) check_storage_system_id_post(storage_system_id) payload = { id: storage_system_id }.to_json rest_post(payload, "#{@base_url}/vdc/storage-systems/#{storage_system_id}/discover", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |
- (JSON) storage_system_payload(name, system_type, ip_or_dns, port, user_name, password, smis_provider_ip = nil, smis_port_number = nil, smis_user_name = nil, smis_password = nil, smis_use_ssl = nil)
Returns The JSON structure for the post operation
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
# File 'lib/vipruby/objects/storagesystem.rb', line 203 def storage_system_payload(name, system_type, ip_or_dns, port, user_name, password, smis_provider_ip=nil, smis_port_number=nil, smis_user_name=nil, smis_password=nil, smis_use_ssl=nil) if smis_provider_ip == nil payload = { name: name, system_type: system_type, ip_address: ip_or_dns, port_number: port, user_name: user_name.nil? ? 'admin' : user_name, password: password.nil? ? '#1Password' : password, }.to_json else payload = { name: name, system_type: system_type, ip_address: ip_or_dns, port_number: port, user_name: user_name.nil? ? 'admin' : user_name, password: password.nil? ? '#1Password' : password, smis_provider_ip: smis_provider_ip, smis_port_number: smis_port_number.nil? ? '5988' : smis_port_number, smis_user_name: smis_user_name.nil? ? 'admin' : smis_user_name, smis_password: smis_password.nil? ? '#1Password' : smis_password, smis_use_ssl: smis_use_ssl.nil? ? false : smis_use_ssl }.to_json end return payload end |
- (JSON) storage_system_register(storage_system_id = nil, auth = nil, cert = nil)
Register Storage System. Allows the user register the storage system with the passed id.
27 28 29 30 31 32 33 |
# File 'lib/vipruby/objects/storagesystem.rb', line 27 def storage_system_register(storage_system_id=nil,auth=nil, cert=nil) check_storage_system_id_post(storage_system_id) payload = { id: storage_system_id }.to_json rest_post(payload, "#{@base_url}/vdc/storage-systems/#{storage_system_id}/register", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert) end |