Module: OneviewSDK::ResourceHelper::PatchOperation

Included in:
API200::ServerProfile, API300::C7000::LogicalEnclosure, API500::C7000::FirmwareHelper
Defined in:
lib/oneview-sdk/resource_helper.rb

Overview

Contains helper method to call patch endpoint of resource

Instance Method Summary collapse

Instance Method Details

#patch(operation, path, value = nil, header_options = {}) ⇒ Object

Note:

This attribute is subject to incompatible changes in future release versions, including redefinition or removal.

Performs a specific patch operation for the given resource. If the resource supports the particular operation, the operation is performed and a response is returned to the caller with the results.

Parameters:

  • operation (String)

    The operation to be performed

  • path (String)

    The path of operation

  • value (String) (defaults to: nil)

    The value



24
25
26
27
28
29
30
# File 'lib/oneview-sdk/resource_helper.rb', line 24

def patch(operation, path, value = nil, header_options = {})
  ensure_client && ensure_uri
  options = { 'body' => [op: operation, path: path, value: value] }
  options = options.merge(header_options)
  response = @client.rest_patch(@data['uri'], options, @api_version)
  @client.response_handler(response)
end