add /repo/repo.id/crons GET endpoint

This commit is contained in:
Lennard Wolf 2015-11-05 15:22:10 +01:00
parent 5295d0c3ee
commit ec37deb17c
5 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,8 @@
module Travis::API::V3
class Queries::Crons < Query
def find(repository)
repository.crons
end
end
end

View File

@ -0,0 +1,6 @@
module Travis::API::V3
class Renderer::Crons < Renderer::CollectionRenderer
type :crons
collection_key :crons
end
end

View File

@ -95,6 +95,11 @@ module Travis::API::V3
get :find
end
resource :crons do
route '/crons'
get :find
end
resource :requests do
route '/requests'
get :find

View File

@ -10,6 +10,7 @@ module Travis::API::V3
Build = Module.new { extend Services }
Builds = Module.new { extend Services }
Cron = Module.new { extend Services }
Crons = Module.new { extend Services }
Job = Module.new { extend Services }
Jobs = Module.new { extend Services }
Organization = Module.new { extend Services }

View File

@ -0,0 +1,9 @@
module Travis::API::V3
class Services::Crons::Find < Service
paginate
def run!
query.find(find(:repository))
end
end
end