def run

      @client = JsonApiClient.new(uri)
      @client.log = log
      @client.header = header
      @client.param = parameters
      if param[:concurrency]
       @client.concurrency = param[:concurrency].to_i
      end

      if param[:slice]
       @client.slice = param[:slice].to_i
      end

      if uri =~ /\w+[:]\w+[@]/
        username, password = URI.parse(uri).userinfo.split(":")
        @client.username = username
        @client.password = password
      end
      
      if param[:auth]
        # Force authorization
        @client.authorization = true
      end

      method = param[:method].upcase

      response = nil

      case method
        when "DELETE"
          response = delete
        when "GET"
          response = get
        when "HEAD"
          response = head
        when "PATCH"
          response = patch
        when "POST"
          if data.is_a? Dir
            raise "Not implemented"
          else
            response = post(data)
          end
          
          
          
        when "PUT"
          response = put(data)
        else
          raise ArgumentError, "Unsupported HTTP method: #{param[:method]}"
      end

      #Loop dirs?
      if not response.nil? and (response.respond_to? :body or response.is_a? Array)
        if response.is_a? Array
          responses = response
        else
          responses = [response]
        end

        i = 0
        responses.each do | response |
          i += 1
          log.debug "#{method} #{response.uri.path} [#{i}] Total time: #{response.total_time}"+
            " DNS time: #{response.namelookup_time}"+
            " Connect time: #{response.connect_time}"+
            " Pre-transer time: #{response.pretransfer_time}"
            
          if "HEAD" == method or headers?
            puts response.response_headers
          end
          unless param[:join]
            puts response.body
          end
        end
        
        statuses = responses.map {|r| r.code }.uniq
        status = statuses.map {|code| { code => responses.select {|r| code == r.code }.size } }.to_json.gsub(/["{}\[\]]/, "")
        real_responses_size = responses.select {|r| r.code >= 100 }.size

        log.info "Status(es): #{status}, request(s): #{responses.size}, response(s): #{real_responses_size}"

      else
        raise "Invalid response: #{response}"
      end
      
      if param[:join]
        joined = responses.map {|r|
          JSON.parse(r.body)
        }
        puts joined.to_json
      end

    end
def run

      @client = JsonApiClient.new(uri)
      @client.log = log
      @client.header = header
      @client.param = parameters
      if param[:concurrency]
       @client.concurrency = param[:concurrency].to_i
      end

      if param[:slice]
       @client.slice = param[:slice].to_i
      end

      if uri =~ /\w+[:]\w+[@]/
        username, password = URI.parse(uri).userinfo.split(":")
        @client.username = username
        @client.password = password
      end
      
      if param[:auth]
        # Force authorization
        @client.authorization = true
      end

      method = param[:method].upcase

      response = nil

      case method
        when "DELETE"
          response = delete
        when "GET"
          response = get
        when "HEAD"
          response = head
        when "PATCH"
          response = patch
        when "POST"
          if data.is_a? Dir
            raise "Not implemented"
          else
            response = post(data)
          end
          
          
          
        when "PUT"
          response = put(data)
        else
          raise ArgumentError, "Unsupported HTTP method: #{param[:method]}"
      end

      #Loop dirs?
      if not response.nil? and (response.respond_to? :body or response.is_a? Array)
        if response.is_a? Array
          responses = response
        else
          responses = [response]
        end

        i = 0
        responses.each do | response |
          i += 1
          log.debug "#{method} #{response.uri.path} [#{i}] Total time: #{response.total_time}"+
            " DNS time: #{response.namelookup_time}"+
            " Connect time: #{response.connect_time}"+
            " Pre-transer time: #{response.pretransfer_time}"
            
          if "HEAD" == method or headers?
            puts response.response_headers
          end
          unless param[:join]
            puts response.body
          end
        end
        
        statuses = responses.map {|r| r.code }.uniq
        status = statuses.map {|code| { code => responses.select {|r| code == r.code }.size } }.to_json.gsub(/["{}\[\]]/, "")
        real_responses_size = responses.select {|r| r.code >= 100 }.size

        log.info "Status(es): #{status}, request(s): #{responses.size}, response(s): #{real_responses_size}"

      else
        raise "Invalid response: #{response}"
      end
      
      if param[:join]
        joined = responses.map {|r|
          JSON.parse(r.body)
        }
        puts joined.to_json
      end

    end
Execute npolar-api command
 @return [nil]