Class: VpsbClient::Api::PostSysbenchRun

Inherits:
PostRequest show all
Defined in:
lib/vpsb_client/api/post_sysbench_run.rb

Instance Method Summary collapse

Methods inherited from PostRequest

#run

Methods inherited from Request

#accept, #put_params, #query_params

Constructor Details

#initialize(http_client, trial_id, test_id, command, data) ⇒ PostSysbenchRun

Returns a new instance of PostSysbenchRun.



5
6
7
8
9
10
11
# File 'lib/vpsb_client/api/post_sysbench_run.rb', line 5

def initialize(http_client, trial_id, test_id, command, data)
  super(http_client)
  @trial_id = trial_id
  @test_id = test_id
  @command = command
  @data = data
end

Instance Method Details

#content_typeObject



26
27
28
# File 'lib/vpsb_client/api/post_sysbench_run.rb', line 26

def content_type
  'application/json'
end

#post_paramsObject



17
18
19
20
21
22
23
24
# File 'lib/vpsb_client/api/post_sysbench_run.rb', line 17

def post_params
  @post_params = { sysbench_run: {
      test_id: @test_id,
      command: @command,
      data: @data
    }
  }
end

#url_pathObject



13
14
15
# File 'lib/vpsb_client/api/post_sysbench_run.rb', line 13

def url_path
  "/api/trials/#{@trial_id}/sysbench_runs"
end