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:
Diffstat (limited to 'lib/api/environments.rb')
-rw-r--r--lib/api/environments.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/api/environments.rb b/lib/api/environments.rb
index bb261079d2a..b94391359ed 100644
--- a/lib/api/environments.rb
+++ b/lib/api/environments.rb
@@ -38,6 +38,7 @@ module API
desc: 'List all environments that match a specific state. Accepted values: `available`, `stopping`, or `stopped`. If no state value given, returns all environments'
mutually_exclusive :name, :search, message: 'cannot be used together'
end
+ route_setting :authentication, job_token_allowed: true
get ':id/environments' do
authorize! :read_environment, user_project
@@ -66,6 +67,7 @@ module API
optional :slug, absence: { message: "is automatically generated and cannot be changed" }, documentation: { hidden: true }
optional :tier, type: String, values: Environment.tiers.keys, desc: 'The tier of the new environment. Allowed values are `production`, `staging`, `testing`, `development`, and `other`'
end
+ route_setting :authentication, job_token_allowed: true
post ':id/environments' do
authorize! :create_environment, user_project
@@ -94,6 +96,7 @@ module API
optional :slug, absence: { message: "is automatically generated and cannot be changed" }, documentation: { hidden: true }
optional :tier, type: String, values: Environment.tiers.keys, desc: 'The tier of the new environment. Allowed values are `production`, `staging`, `testing`, `development`, and `other`'
end
+ route_setting :authentication, job_token_allowed: true
put ':id/environments/:environment_id' do
authorize! :update_environment, user_project
@@ -126,6 +129,7 @@ module API
optional :limit, type: Integer, desc: "Maximum number of environments to delete. Defaults to 100", default: 100, values: 1..1000
optional :dry_run, type: Boolean, desc: "Defaults to true for safety reasons. It performs a dry run where no actual deletion will be performed. Set to false to actually delete the environment", default: true
end
+ route_setting :authentication, job_token_allowed: true
delete ":id/environments/review_apps" do
authorize! :read_environment, user_project
@@ -156,6 +160,7 @@ module API
params do
requires :environment_id, type: Integer, desc: 'The ID of the environment'
end
+ route_setting :authentication, job_token_allowed: true
delete ':id/environments/:environment_id' do
authorize! :read_environment, user_project
@@ -178,6 +183,7 @@ module API
requires :environment_id, type: Integer, desc: 'The ID of the environment'
optional :force, type: Boolean, default: false, desc: 'Force environment to stop without executing `on_stop` actions'
end
+ route_setting :authentication, job_token_allowed: true
post ':id/environments/:environment_id/stop' do
authorize! :read_environment, user_project
@@ -202,6 +208,7 @@ module API
type: DateTime,
desc: 'Stop all environments that were last modified or deployed to before this date.'
end
+ route_setting :authentication, job_token_allowed: true
post ':id/environments/stop_stale' do
authorize! :stop_environment, user_project
@@ -229,6 +236,7 @@ module API
params do
requires :environment_id, type: Integer, desc: 'The ID of the environment'
end
+ route_setting :authentication, job_token_allowed: true
get ':id/environments/:environment_id' do
authorize! :read_environment, user_project