Class: Runcible::Resources::RepositorySchedule
- Defined in:
- lib/runcible/resources/repository_schedule.rb
Overview
Class Method Summary collapse
-
.create(repo_id, importer_type, schedule, optional = {}) ⇒ RestClient::Response
Create a schedule for a repository for a given importer type.
-
.delete(repo_id, importer_type, schedule_id) ⇒ RestClient::Response
Delete a schedule for a repository for a given importer type.
-
.list(repo_id, importer_type) ⇒ RestClient::Response
List the schedules for a repository for a given importer type.
-
.path(repo_id, importer_id, schedule_id = nil) ⇒ String
Generates the API path for Repository Schedules.
-
.update(repo_id, importer_type, schedule_id, optional = {}) ⇒ RestClient::Response
Update a schedule for a repository for a given importer type.
Methods inherited from Base
add_http_auth_header, add_oauth_header, call, combine_get_params, config, config=, generate_log_message, generate_payload, get_response, log_debug, log_exception, process_response, required_params
Class Method Details
.create(repo_id, importer_type, schedule, optional = {}) ⇒ RestClient::Response
Create a schedule for a repository for a given importer type
59 60 61 62 |
# File 'lib/runcible/resources/repository_schedule.rb', line 59 def self.create(repo_id, importer_type, schedule, optional={}) call(:post, path(repo_id, importer_type), :payload => { :required => {:schedule=>schedule}, :optional => optional }) end |
.delete(repo_id, importer_type, schedule_id) ⇒ RestClient::Response
Delete a schedule for a repository for a given importer type
82 83 84 |
# File 'lib/runcible/resources/repository_schedule.rb', line 82 def self.delete(repo_id, importer_type, schedule_id) call(:delete, path(repo_id, importer_type, schedule_id)) end |
.list(repo_id, importer_type) ⇒ RestClient::Response
List the schedules for a repository for a given importer type
48 49 50 |
# File 'lib/runcible/resources/repository_schedule.rb', line 48 def self.list(repo_id, importer_type) call(:get, path(repo_id, importer_type)) end |
.path(repo_id, importer_id, schedule_id = nil) ⇒ String
Generates the API path for Repository Schedules
37 38 39 40 41 |
# File 'lib/runcible/resources/repository_schedule.rb', line 37 def self.path(repo_id, importer_id, schedule_id=nil) repo_path = Runcible::Resources::Repository.path(repo_id) path = "#{repo_path}importers/#{importer_id}/schedules/sync/" (schedule_id == nil) ? path : "#{path}#{schedule_id}/" end |
.update(repo_id, importer_type, schedule_id, optional = {}) ⇒ RestClient::Response
Update a schedule for a repository for a given importer type
71 72 73 74 |
# File 'lib/runcible/resources/repository_schedule.rb', line 71 def self.update(repo_id, importer_type, schedule_id, optional={}) call(:put, path(repo_id, importer_type, schedule_id), :payload => {:optional => optional }) end |