Class: OneviewSDK::API200::UnmanagedDevice

Inherits:
Resource show all
Defined in:
lib/oneview-sdk/resource/api200/unmanaged_device.rb

Overview

Unmanaged Device resource implementation

Constant Summary collapse

BASE_URI =
'/rest/unmanaged-devices'.freeze

Constants inherited from Resource

Resource::UNIQUE_IDENTIFIERS

Instance Attribute Summary

Attributes inherited from Resource

#api_version, #client, #data, #logger

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

#==, #[], #[]=, build_query, #create!, #each, #eql?, #exists?, find_by, from_file, get_all, #initialize, #like?, #refresh, #retrieve!, #schema, schema, #set, #set_all, #to_file, #update

Constructor Details

This class inherits a constructor from OneviewSDK::Resource

Class Method Details

.get_devices(client) ⇒ Array

Gets a list of unmanaged devices

Parameters:

Returns:

  • (Array)

    list of unmanaged devices



46
47
48
49
# File 'lib/oneview-sdk/resource/api200/unmanaged_device.rb', line 46

def self.get_devices(client)
  response = client.rest_get(BASE_URI)
  client.response_handler(response)['members']
end

Instance Method Details

#addOneviewSDK::UnmanagedDevice

Note:

Calls the refresh method to set additional data

Add the resource on OneView using the current data

Returns:

  • (OneviewSDK::UnmanagedDevice)

    self

Raises:



25
# File 'lib/oneview-sdk/resource/api200/unmanaged_device.rb', line 25

alias add create

#createObject

Method is not available

Raises:



33
34
35
# File 'lib/oneview-sdk/resource/api200/unmanaged_device.rb', line 33

def create(*)
  unavailable_method
end

#deleteObject

Method is not available

Raises:



39
40
41
# File 'lib/oneview-sdk/resource/api200/unmanaged_device.rb', line 39

def delete(*)
  unavailable_method
end

#environmental_configurationObject

Get settings that describe the environmental configuration



52
53
54
55
56
# File 'lib/oneview-sdk/resource/api200/unmanaged_device.rb', line 52

def environmental_configuration
  ensure_client && ensure_uri
  response = @client.rest_get(@data['uri'] + '/environmentalConfiguration')
  @client.response_handler(response)
end

#removetrue

Remove resource from OneView

Returns:

  • (true)

    if resource was removed successfully



29
# File 'lib/oneview-sdk/resource/api200/unmanaged_device.rb', line 29

alias remove delete