summaryrefslogtreecommitdiff
path: root/lib/api/environments.rb
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2016-12-08 01:09:18 +0000
committerNick Thomas <nick@gitlab.com>2016-12-15 13:57:03 +0000
commit93a03cd92f6418fbeaf126c30c161ab40d377e94 (patch)
tree0f49cd51558b97b8674e72b200e7d9150562e00e /lib/api/environments.rb
parent35a3e9183052bab847c30203f27fea9cf77901a4 (diff)
downloadgitlab-ce-93a03cd92f6418fbeaf126c30c161ab40d377e94.tar.gz
Add an environment slug
Diffstat (limited to 'lib/api/environments.rb')
-rw-r--r--lib/api/environments.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/api/environments.rb b/lib/api/environments.rb
index 80bbd9bb6e4..1a7e68f0528 100644
--- a/lib/api/environments.rb
+++ b/lib/api/environments.rb
@@ -1,6 +1,7 @@
module API
# Environments RESTfull API endpoints
class Environments < Grape::API
+ include ::API::Helpers::CustomValidators
include PaginationParams
before { authenticate! }
@@ -29,6 +30,7 @@ module API
params do
requires :name, type: String, desc: 'The name of the environment to be created'
optional :external_url, type: String, desc: 'URL on which this deployment is viewable'
+ optional :slug, absence: { message: "is automatically generated and cannot be changed" }
end
post ':id/environments' do
authorize! :create_environment, user_project
@@ -50,6 +52,7 @@ module API
requires :environment_id, type: Integer, desc: 'The environment ID'
optional :name, type: String, desc: 'The new environment name'
optional :external_url, type: String, desc: 'The new URL on which this deployment is viewable'
+ optional :slug, absence: { message: "is automatically generated and cannot be changed" }
end
put ':id/environments/:environment_id' do
authorize! :update_environment, user_project