require 'open-uri' require 'helix_web_services_client/open_model' class HelixWebServicesClient def jobs arr = execute_method_no_body(:get, hve_path('jobs')) arr.map { |x| OpenModel.new(x) } end # Returns the array of jobs in the system. Each job model is simply a hash # of string -> string values, since each system can very likely adjust # job output. def job(job_id) obj = execute_method_no_body(:get, hve_path("jobs/#{URI.encode(job_id)}")) OpenModel.new(obj) end # Creates a new job in the system. def create_job(job) job = OpenModel.new(job) unless job.is_a?(OpenModel) job.Job = 'new' unless job.job job.Status = 'open' unless job.status execute_method_with_body(:post, hve_path('jobs'), job.marshal_dump) end # Updates the job specification. def update_job(job) job = OpenModel.new(job) unless job.is_a?(OpenModel) execute_method_with_body(:patch, hve_path("jobs/#{URI.encode(job['Job'])}"), job.marshal_dump) end # Deletes the job specification in the system. def delete_job(job_id) execute_method_no_body(:delete, hve_path("jobs/#{URI.encode(job_id)}")) end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15741 | ptomiak | Branch HWS for my use. | ||
//guest/perforce_software/helix-web-services/main/source/helix_web_services_client/lib/helix_web_services_client/jobs.rb | |||||
#1 | 15622 | tjuricek |
Move source code to 'source/' subdirectory of branch. build/ will remain where it is. |
||
//guest/perforce_software/helix-web-services/main/helix_web_services_client/lib/helix_web_services_client/jobs.rb | |||||
#3 | 15240 | tjuricek |
Set api level via request path on all Helix Versioning Engine methods. This will allow migration of applications to different P4D versions. Our internal methods (like project API) should attempt to handle backward compatibility similarly. P4WEBAPI-118 |
||
#2 | 15210 | tjuricek | Implement tests and documentation for job spec management. | ||
#1 | 13808 | tjuricek | Finish converting most of the core p4d API into the new monolithic system. | ||
//guest/perforce_software/helix-web-services/main/p4_web_api/clients/ruby/p4_web_api_client/lib/p4_web_api_client/client/jobs.rb | |||||
#1 | 13412 | tjuricek |
Initial version of the web-services mainline. This is a collection of several projects, that will likely often get released together, though many of them may not always be relevant. See the README for more information. |