def rest_api(type, path, options = {}, api_ver = @api_version, redirect_limit = 3)
      @logger.debug "Making :#{type} rest call to #{@url}#{path}"
      raise InvalidRequest, 'Must specify path' unless path
      uri = URI.parse(Addressable::URI.escape(@url + path))
      http = build_http_object(uri)
      request = build_request(type, uri, options.dup, api_ver)
      response = http.request(request)
      @logger.debug "  Response: Code=#{response.code}. Headers=#{response.to_hash}\n  Body=#{response.body}"
      if response.class <= Net::HTTPRedirection && redirect_limit > 0 && response['location']
        @logger.debug "Redirecting to #{response['location']}"
        return rest_api(type, response['location'], options, api_ver, redirect_limit - 1)
      end
      response
    rescue OpenSSL::SSL::SSLError => e
      msg = 'SSL verification failed for request. Please either:'
      msg += "\n  1. Install the certificate into your system's cert store"
      msg += ". Using cert store: #{ENV['SSL_CERT_FILE']}" if ENV['SSL_CERT_FILE']
      msg += "\n  2. Run oneview-sdk-ruby cert import #{@url}"
      msg += "\n  3. Set the :ssl_enabled option to false for your client (NOT RECOMMENDED)"
      @logger.error msg
      raise e
    end
def rest_api(type, path, options = {}, api_ver = @api_version, redirect_limit = 3)
      @logger.debug "Making :#{type} rest call to #{@url}#{path}"
      raise InvalidRequest, 'Must specify path' unless path
      uri = URI.parse(Addressable::URI.escape(@url + path))
      http = build_http_object(uri)
      request = build_request(type, uri, options.dup, api_ver)
      response = http.request(request)
      @logger.debug "  Response: Code=#{response.code}. Headers=#{response.to_hash}\n  Body=#{response.body}"
      if response.class <= Net::HTTPRedirection && redirect_limit > 0 && response['location']
        @logger.debug "Redirecting to #{response['location']}"
        return rest_api(type, response['location'], options, api_ver, redirect_limit - 1)
      end
      response
    rescue OpenSSL::SSL::SSLError => e
      msg = 'SSL verification failed for request. Please either:'
      msg += "\n  1. Install the certificate into your system's cert store"
      msg += ". Using cert store: #{ENV['SSL_CERT_FILE']}" if ENV['SSL_CERT_FILE']
      msg += "\n  2. Run oneview-sdk-ruby cert import #{@url}"
      msg += "\n  3. Set the :ssl_enabled option to false for your client (NOT RECOMMENDED)"
      @logger.error msg
      raise e
    end
in seconds, 5 minutes
 Makes a restful API request to OneView
 @param [Symbol] type The rest method/type Options: [:get, :post, :delete, :patch, :put]
 @param [String] path The path for the request. Usually starts with "/rest/"
 @param [Hash] options The options for the request
 @option options [String] :body Hash to be converted into json and set as the request body
 @option options [String] :Content-Type ('application/json') Set to nil or :none to have this option removed
 @option options [Integer] :X-API-Version (client.api_version) API version to use for this request
 @option options [Integer] :auth (client.token) Authentication token to use for this request
 @param [Integer] api_ver The api version to use when interracting with this resource
 @param [Integer] redirect_limit Number of redirects it is allowed to follow
 @raise [OpenSSL::SSL::SSLError] if SSL validation of OneView instance's certificate failed
 @return [NetHTTPResponse] Response object