Class: Hapyrus::Command::Jobs

Inherits:
Base
  • Object
show all
Defined in:
lib/hapyrus/command/jobs.rb

Instance Method Summary collapse

Methods inherited from Base

#ask, #display_index, #display_show, #hapyrus, #index, #initialize, #show

Constructor Details

This class inherits a constructor from Hapyrus::Command::Base

Instance Method Details

#create(app_id, script_id, src_dataset_id, dest_dataset_params = nil) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/hapyrus/command/jobs.rb', line 4

def create(app_id, script_id, src_dataset_id, dest_dataset_params=nil)
  dest_dataset = dest_dataset_params || {:type => "DatasetSmallText"}
  begin
    hapyrus.post('/jobs',
      :job => {:type => 'Job', :app_id => app_id, :script_id => script_id,
               :src_dataset_id => src_dataset_id,
               :dest_dataset_attributes => dest_dataset
              })
  rescue RestClient::Found
    # OK
  end
end