Method: IntersightClient::VirtualizationApi#patch_virtualization_virtual_network_with_http_info

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

#patch_virtualization_virtual_network_with_http_info(moid, virtualization_virtual_network, opts = {}) ⇒ Array<(VirtualizationVirtualNetwork, Integer, Hash)>

Update a &#39;virtualization.VirtualNetwork&#39; resource.

Parameters:

  • moid (String)

    The unique Moid identifier of a resource instance.

  • virtualization_virtual_network (VirtualizationVirtualNetwork)

    The &#39;virtualization.VirtualNetwork&#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:



4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
# File 'lib/intersight_client/api/virtualization_api.rb', line 4029

def patch_virtualization_virtual_network_with_http_info(moid, virtualization_virtual_network, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VirtualizationApi.patch_virtualization_virtual_network ...'
  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 VirtualizationApi.patch_virtualization_virtual_network"
  end
  # verify the required parameter 'virtualization_virtual_network' is set
  if @api_client.config.client_side_validation && virtualization_virtual_network.nil?
    fail ArgumentError, "Missing the required parameter 'virtualization_virtual_network' when calling VirtualizationApi.patch_virtualization_virtual_network"
  end
  # resource path
  local_var_path = '/api/v1/virtualization/VirtualNetworks/{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(virtualization_virtual_network)

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

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

  new_options = opts.merge(
    :operation => :"VirtualizationApi.patch_virtualization_virtual_network",
    :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: VirtualizationApi#patch_virtualization_virtual_network\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end