add /repo/repo.id/crons GET endpoint
This commit is contained in:
parent
5295d0c3ee
commit
ec37deb17c
8
lib/travis/api/v3/queries/crons.rb
Normal file
8
lib/travis/api/v3/queries/crons.rb
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
module Travis::API::V3
|
||||||
|
class Queries::Crons < Query
|
||||||
|
|
||||||
|
def find(repository)
|
||||||
|
repository.crons
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
6
lib/travis/api/v3/renderer/crons.rb
Normal file
6
lib/travis/api/v3/renderer/crons.rb
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
module Travis::API::V3
|
||||||
|
class Renderer::Crons < Renderer::CollectionRenderer
|
||||||
|
type :crons
|
||||||
|
collection_key :crons
|
||||||
|
end
|
||||||
|
end
|
|
@ -95,6 +95,11 @@ module Travis::API::V3
|
||||||
get :find
|
get :find
|
||||||
end
|
end
|
||||||
|
|
||||||
|
resource :crons do
|
||||||
|
route '/crons'
|
||||||
|
get :find
|
||||||
|
end
|
||||||
|
|
||||||
resource :requests do
|
resource :requests do
|
||||||
route '/requests'
|
route '/requests'
|
||||||
get :find
|
get :find
|
||||||
|
|
|
@ -10,6 +10,7 @@ module Travis::API::V3
|
||||||
Build = Module.new { extend Services }
|
Build = Module.new { extend Services }
|
||||||
Builds = Module.new { extend Services }
|
Builds = Module.new { extend Services }
|
||||||
Cron = Module.new { extend Services }
|
Cron = Module.new { extend Services }
|
||||||
|
Crons = Module.new { extend Services }
|
||||||
Job = Module.new { extend Services }
|
Job = Module.new { extend Services }
|
||||||
Jobs = Module.new { extend Services }
|
Jobs = Module.new { extend Services }
|
||||||
Organization = Module.new { extend Services }
|
Organization = Module.new { extend Services }
|
||||||
|
|
9
lib/travis/api/v3/services/crons/find.rb
Normal file
9
lib/travis/api/v3/services/crons/find.rb
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
module Travis::API::V3
|
||||||
|
class Services::Crons::Find < Service
|
||||||
|
paginate
|
||||||
|
|
||||||
|
def run!
|
||||||
|
query.find(find(:repository))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user