add API endpoints for listing and deleting caches

This commit is contained in:
Konstantin Haase 2013-11-04 10:23:17 +01:00
parent 018c3b3228
commit 44e1db3944
2 changed files with 25 additions and 1 deletions

View File

@ -23,7 +23,7 @@ GIT
GIT
remote: git://github.com/travis-ci/travis-core.git
revision: bcc14ad2fafff932f1b681a332b6435b50ddb099
revision: 9db978cabd740dddbc94d105cc4242b56afe2e9f
specs:
travis-core (0.0.1)
actionmailer (~> 3.2.12)
@ -39,6 +39,7 @@ GIT
rake
redis (~> 3.0)
rollout (~> 1.1.0)
s3 (~> 0.3)
simple_states (~> 1.0.0)
thor (~> 0.14.6)
@ -177,6 +178,7 @@ GEM
newrelic_rpm (3.6.7.152)
pg (0.13.2)
polyglot (0.3.3)
proxies (0.2.1)
pry (0.9.12.2)
coderay (~> 1.0.5)
method_source (~> 0.8)
@ -226,6 +228,8 @@ GEM
rspec-expectations (2.14.0)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.1)
s3 (0.3.17)
proxies (~> 0.2.0)
sidekiq (2.5.4)
celluloid (~> 0.12.0)
connection_pool (~> 0.9.2)

View File

@ -68,6 +68,16 @@ class Travis::Api::App
respond_with service(:find_branch, params), type: :branch, version: :v2
end
# List caches for a given repo. Can be filtered with `branch` and `match` query parameter.
get '/:repository_id/caches', scope: :private do
respond_with service(:find_caches, params), type: :caches, version: :v2
end
# Delete caches for a given repo. Can be filtered with `branch` and `match` query parameter.
delete '/:repository_id/caches', scope: :private do
respond_with service(:delete_caches, params), type: :caches, version: :v2
end
# Gets the repository with the given name.
#
# ### Response
@ -129,6 +139,16 @@ class Travis::Api::App
get '/:owner_name/:name/branches/:branch' do
respond_with service(:find_branch, params), type: :branch, version: :v2
end
# List caches for a given repo. Can be filtered with `branch` and `match` query parameter.
get '/:owner_name/:name/caches', scope: :private do
respond_with service(:find_caches, params), type: :caches, version: :v2
end
# Delete caches for a given repo. Can be filtered with `branch` and `match` query parameter.
delete '/:owner_name/:name/caches', scope: :private do
respond_with service(:delete_caches, params), type: :caches, version: :v2
end
end
end
end