class OneviewSDK::API500::C7000::Enclosure

Enclosure resource implementation for API500 C7000

Public Class Methods

new(client, params = {}, api_ver = nil) click to toggle source

Create a resource object, associate it with a client, and set its properties. @param [OneviewSDK::Client] client The client object for the OneView appliance @param [Hash] params The options for this resource (key-value pairs) @param [Integer] api_ver The api version to use when interracting with this resource.

# File lib/oneview-sdk/resource/api500/c7000/enclosure.rb, line 24
def initialize(client, params = {}, api_ver = nil)
  @data ||= {}
  # Default values:
  @data['type'] ||= 'EnclosureV400'
  super
end

Public Instance Methods

patch(operation, path, value = nil) click to toggle source

Performs a specific patch operation. @param [String] operation The operation to be performed @param [String] path The path of operation @param [String] value The value @return [Hash] hash with response @note The scopeUris attribute is subject to incompatible changes in future release versions.

# File lib/oneview-sdk/resource/api500/c7000/enclosure.rb, line 47
def patch(operation, path, value = nil)
  ensure_client && ensure_uri
  body = [{ 'op' => operation, 'path' => path, 'value' => value }]
  patch_options = { 'If-Match' => @data['eTag'] }
  response = @client.rest_patch(@data['uri'], patch_options.merge('body' => body), @api_version)
  @client.response_handler(response)
end
update(attributes = {}) click to toggle source

Updates the name and rackName (and it uses PATCH). Override in order to return the current state of the object. @param [Hash] attributes attributes to be updated @return [OneviewSDK::Enclosure] self

Calls superclass method OneviewSDK::API200::Enclosure#update
# File lib/oneview-sdk/resource/api500/c7000/enclosure.rb, line 35
def update(attributes = {})
  super(attributes)
  retrieve!
  self
end