Method: IntersightClient::ComputeApi#patch_compute_blade_with_http_info

Defined in:
lib/intersight_client/api/compute_api.rb

#patch_compute_blade_with_http_info(moid, compute_blade, opts = {}) ⇒ Array<(ComputeBlade, Integer, Hash)>

Update a &#39;compute.Blade&#39; resource.

Parameters:

  • moid (String)

    The unique Moid identifier of a resource instance.

  • compute_blade (ComputeBlade)

    The &#39;compute.Blade&#39; resource to update.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For methods that apply server-side changes, and in particular for PUT, If-Match can be used to prevent the lost update problem. It can check if the modification of a resource that the user wants to upload will not override another change that has been done since the original resource was fetched. If the request cannot be fulfilled, the 412 (Precondition Failed) response is returned. When modifying a resource using POST or PUT, the If-Match header must be set to the value of the resource ModTime property after which no lost update problem should occur. For example, a client send a GET request to obtain a resource, which includes the ModTime property. The ModTime indicates the last time the resource was created or modified. The client then sends a POST or PUT request with the If-Match header set to the ModTime property of the resource as obtained in the GET request.

Returns:

  • (Array<(ComputeBlade, Integer, Hash)>)

    ComputeBlade data, response status code and response headers



2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
# File 'lib/intersight_client/api/compute_api.rb', line 2041

def patch_compute_blade_with_http_info(moid, compute_blade, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ComputeApi.patch_compute_blade ...'
  end
  # verify the required parameter 'moid' is set
  if @api_client.config.client_side_validation && moid.nil?
    fail ArgumentError, "Missing the required parameter 'moid' when calling ComputeApi.patch_compute_blade"
  end
  # verify the required parameter 'compute_blade' is set
  if @api_client.config.client_side_validation && compute_blade.nil?
    fail ArgumentError, "Missing the required parameter 'compute_blade' when calling ComputeApi.patch_compute_blade"
  end
  # resource path
  local_var_path = '/api/v1/compute/Blades/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(compute_blade)

  # return_type
  return_type = opts[:debug_return_type] || 'ComputeBlade'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']

  new_options = opts.merge(
    :operation => :"ComputeApi.patch_compute_blade",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ComputeApi#patch_compute_blade\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end