Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Miller <travis@travismiller.com>2017-11-13 19:05:44 +0300
committerRémy Coutable <remy@rymai.me>2017-11-13 19:05:44 +0300
commit1162d89ac49553c579ec4d049e74206893ff6302 (patch)
tree29db898298f93c35c86788bf36ea782b21dac1a9 /lib/api/pages_domains.rb
parente897d8b7f7755107ab632dc5b392c1dc246eb2c8 (diff)
Add administrative endpoint to list all pages domains
Diffstat (limited to 'lib/api/pages_domains.rb')
-rw-r--r--lib/api/pages_domains.rb22
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/api/pages_domains.rb b/lib/api/pages_domains.rb
index 259f3f34068..d7b613a717e 100644
--- a/lib/api/pages_domains.rb
+++ b/lib/api/pages_domains.rb
@@ -4,7 +4,6 @@ module API
before do
authenticate!
- require_pages_enabled!
end
after_validation do
@@ -29,10 +28,31 @@ module API
end
end
+ resource :pages do
+ before do
+ require_pages_config_enabled!
+ authenticated_with_full_private_access!
+ end
+
+ desc "Get all pages domains" do
+ success Entities::PagesDomainBasic
+ end
+ params do
+ use :pagination
+ end
+ get "domains" do
+ present paginate(PagesDomain.all), with: Entities::PagesDomainBasic
+ end
+ end
+
params do
requires :id, type: String, desc: 'The ID of a project'
end
resource :projects, requirements: { id: %r{[^/]+} } do
+ before do
+ require_pages_enabled!
+ end
+
desc 'Get all pages domains' do
success Entities::PagesDomain
end