Method: OneviewSDK::API200::StorageSystem#exists?
- Defined in:
- lib/oneview-sdk/resource/api200/storage_system.rb
#exists? ⇒ Boolean
Note:
one of the UNIQUE_IDENTIFIERS or credentials must be specified in the resource
Checks if the resource already exists
66 67 68 69 70 71 72 73 |
# File 'lib/oneview-sdk/resource/api200/storage_system.rb', line 66 def exists? ip_hostname = self['credentials'][:ip_hostname] || self['credentials']['ip_hostname'] rescue nil return true if ip_hostname && self.class.find_by(@client, credentials: { ip_hostname: ip_hostname }).size == 1 super rescue IncompleteResource => e raise e unless ip_hostname false end |