Class: Runcible::Resources::RepositorySchedule
- Defined in:
- lib/runcible/resources/repository_schedule.rb
Overview
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.path(repo_id, importer_id, schedule_id = nil) ⇒ String
Generates the API path for Repository Schedules.
Instance 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.
-
#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, #exception_to_log, #format_payload_json, #generate_payload, #get_response, #initialize, #lazy_config=, #log_debug, #log_exception, #log_info, #logger, #path, #process_response, #required_params
Constructor Details
This class inherits a constructor from Runcible::Base
Class Method Details
.path(repo_id, importer_id, schedule_id = nil) ⇒ String
Generates the API path for Repository Schedules
13 14 15 16 17 |
# File 'lib/runcible/resources/repository_schedule.rb', line 13 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 |
Instance Method Details
#create(repo_id, importer_type, schedule, optional = {}) ⇒ RestClient::Response
Create a schedule for a repository for a given importer type
35 36 37 38 |
# File 'lib/runcible/resources/repository_schedule.rb', line 35 def 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
58 59 60 |
# File 'lib/runcible/resources/repository_schedule.rb', line 58 def 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
24 25 26 |
# File 'lib/runcible/resources/repository_schedule.rb', line 24 def list(repo_id, importer_type) call(:get, path(repo_id, importer_type)) end |
#update(repo_id, importer_type, schedule_id, optional = {}) ⇒ RestClient::Response
Update a schedule for a repository for a given importer type
47 48 49 50 |
# File 'lib/runcible/resources/repository_schedule.rb', line 47 def update(repo_id, importer_type, schedule_id, optional = {}) call(:put, path(repo_id, importer_type, schedule_id), :payload => {:optional => optional }) end |