gitlab-org--gitlab-foss/lib/api/namespaces.rb

24 lines
510 B
Ruby
Raw Normal View History

module API
# namespaces API
class Namespaces < Grape::API
before {
authenticate!
authenticated_as_admin!
}
resource :namespaces do
# Get a namespaces list
#
# Example Request:
# GET /namespaces
get do
2013-12-14 08:43:48 -05:00
@namespaces = Namespace.all
@namespaces = @namespaces.search(params[:search]) if params[:search].present?
@namespaces = paginate @namespaces
present @namespaces, with: Entities::Namespace
end
end
end
end