Class: OneviewSDK::API200::LogicalEnclosure

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

Overview

Logical enclosure resource implementation

Constant Summary collapse

BASE_URI =
'/rest/logical-enclosures'.freeze

Constants inherited from Resource

Resource::UNIQUE_IDENTIFIERS

Instance Attribute Summary

Attributes inherited from Resource

#api_version, #client, #data, #logger

Instance Method Summary collapse

Methods inherited from Resource

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

Constructor Details

#initialize(client, params = {}, api_ver = nil) ⇒ LogicalEnclosure

Create a resource object, associate it with a client, and set its properties.

Parameters:

  • client (OneviewSDK::Client)

    The client object for the OneView appliance

  • params (Hash) (defaults to: {})

    The options for this resource (key-value pairs)

  • api_ver (Integer) (defaults to: nil)

    The api version to use when interracting with this resource.


24
25
26
# File 'lib/oneview-sdk/resource/api200/logical_enclosure.rb', line 24

def initialize(client, params = {}, api_ver = nil)
  super
end

Instance Method Details

#get_scriptString

Get the configuration script

Returns:

  • (String)

    script

Raises:


57
58
59
60
61
# File 'lib/oneview-sdk/resource/api200/logical_enclosure.rb', line 57

def get_script
  ensure_client && ensure_uri
  response = @client.rest_get("#{@data['uri']}/script", @api_version)
  response.body
end

#reconfigureOneviewSDK::LogicalEnclosure

Reapplies the appliance's configuration on the enclosures

Returns:

  • (OneviewSDK::LogicalEnclosure)

    self

Raises:


33
34
35
36
37
38
# File 'lib/oneview-sdk/resource/api200/logical_enclosure.rb', line 33

def reconfigure
  ensure_client && ensure_uri
  response = @client.rest_put("#{@data['uri']}/configuration", {}, @api_version)
  @client.response_handler(response)
  self
end

#set_script(script) ⇒ OneviewSDK::LogicalEnclosure

Updates the configuration script for the logical enclosure

Returns:

  • (OneviewSDK::LogicalEnclosure)

    self

Raises:


68
69
70
71
72
73
# File 'lib/oneview-sdk/resource/api200/logical_enclosure.rb', line 68

def set_script(script)
  ensure_client && ensure_uri
  response = @client.rest_put("#{@data['uri']}/script", { 'body' => script }, @api_version)
  @client.response_handler(response)
  self
end

#support_dump(options) ⇒ OneviewSDK::LogicalEnclosure

Generates a support dump for the logical enclosure

Returns:

  • (OneviewSDK::LogicalEnclosure)

    self

Raises:


80
81
82
83
84
85
# File 'lib/oneview-sdk/resource/api200/logical_enclosure.rb', line 80

def support_dump(options)
  ensure_client && ensure_uri
  response = @client.rest_post("#{@data['uri']}/support-dumps", { 'body' => options }, @api_version)
  @client.wait_for(response.header['location'])
  self
end

#update_from_groupOneviewSDK::LogicalEnclosure

Makes this logical enclosure consistent with the enclosure group

Returns:

  • (OneviewSDK::LogicalEnclosure)

    self

Raises:


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

def update_from_group
  ensure_client && ensure_uri
  response = @client.rest_put("#{@data['uri']}/updateFromGroup", {}, @api_version)
  @client.response_handler(response)
  self
end