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:
authorKrasimir Angelov <kangelov@gitlab.com>2019-04-09 12:16:57 +0300
committerKamil TrzciƄski <ayufan@ayufan.eu>2019-04-09 12:16:57 +0300
commit724f19ba0a051bbe8e9dd89f208261abe0f8133a (patch)
tree111955bd4ca355100c3d97758b42e942ea4c1779 /lib/api/entities.rb
parente70fae8d8db6a4c4a8d5498bcac039424eb941c1 (diff)
Add new API endpoint to expose single environment
This is resolving https://gitlab.com/gitlab-org/gitlab-ce/issues/30157. Implement new API endpoint `/projects/:id/environments/:environment_id` to expose single environment. Include information for environment's last deployment if there is one.
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 2dd3120d3fc..f9773086f69 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -1294,10 +1294,6 @@ module API
expose :id, :name, :slug, :external_url
end
- class Environment < EnvironmentBasic
- expose :project, using: Entities::BasicProjectDetails
- end
-
class Deployment < Grape::Entity
expose :id, :iid, :ref, :sha, :created_at
expose :user, using: Entities::UserBasic
@@ -1305,6 +1301,11 @@ module API
expose :deployable, using: Entities::Job
end
+ class Environment < EnvironmentBasic
+ expose :project, using: Entities::BasicProjectDetails
+ expose :last_deployment, using: Entities::Deployment, if: { last_deployment: true }
+ end
+
class LicenseBasic < Grape::Entity
expose :key, :name, :nickname
expose :url, as: :html_url