Commit 67cd4763 authored by Sean McGivern's avatar Sean McGivern

Merge branch '5582-add-missing-actions-and-data-to-environments-and-deployments-apis' into 'master'

Enhance Environments and Deployments APIs

Closes #5582

See merge request gitlab-org/gitlab!16242
parents bf5947a6 0ea9b1ff
---
title: Add status to deployments and state to environments in API responses
merge_request: 16242
author:
type: changed
...@@ -26,7 +26,8 @@ Example response: ...@@ -26,7 +26,8 @@ Example response:
"id": 1, "id": 1,
"name": "review/fix-foo", "name": "review/fix-foo",
"slug": "review-fix-foo-dfjre3", "slug": "review-fix-foo-dfjre3",
"external_url": "https://review-fix-foo-dfjre3.example.gitlab.com" "external_url": "https://review-fix-foo-dfjre3.example.gitlab.com",
"state": "available"
} }
] ]
``` ```
...@@ -54,12 +55,14 @@ Example of response ...@@ -54,12 +55,14 @@ Example of response
"name": "review/fix-foo", "name": "review/fix-foo",
"slug": "review-fix-foo-dfjre3", "slug": "review-fix-foo-dfjre3",
"external_url": "https://review-fix-foo-dfjre3.example.gitlab.com" "external_url": "https://review-fix-foo-dfjre3.example.gitlab.com"
"state": "available",
"last_deployment": { "last_deployment": {
"id": 100, "id": 100,
"iid": 34, "iid": 34,
"ref": "fdroid", "ref": "fdroid",
"sha": "416d8ea11849050d3d1f5104cf8cf51053e790ab", "sha": "416d8ea11849050d3d1f5104cf8cf51053e790ab",
"created_at": "2019-03-25T18:55:13.252Z", "created_at": "2019-03-25T18:55:13.252Z",
"status": "success",
"user": { "user": {
"id": 1, "id": 1,
"name": "Administrator", "name": "Administrator",
...@@ -163,7 +166,8 @@ Example response: ...@@ -163,7 +166,8 @@ Example response:
"id": 1, "id": 1,
"name": "deploy", "name": "deploy",
"slug": "deploy", "slug": "deploy",
"external_url": "https://deploy.example.gitlab.com" "external_url": "https://deploy.example.gitlab.com",
"state": "available"
} }
``` ```
...@@ -195,7 +199,8 @@ Example response: ...@@ -195,7 +199,8 @@ Example response:
"id": 1, "id": 1,
"name": "staging", "name": "staging",
"slug": "staging", "slug": "staging",
"external_url": "https://staging.example.gitlab.com" "external_url": "https://staging.example.gitlab.com",
"state": "available"
} }
``` ```
...@@ -240,6 +245,7 @@ Example response: ...@@ -240,6 +245,7 @@ Example response:
"id": 1, "id": 1,
"name": "deploy", "name": "deploy",
"slug": "deploy", "slug": "deploy",
"external_url": "https://deploy.example.gitlab.com" "external_url": "https://deploy.example.gitlab.com",
"state": "stopped"
} }
``` ```
...@@ -1470,11 +1470,13 @@ module API ...@@ -1470,11 +1470,13 @@ module API
expose :user, using: Entities::UserBasic expose :user, using: Entities::UserBasic
expose :environment, using: Entities::EnvironmentBasic expose :environment, using: Entities::EnvironmentBasic
expose :deployable, using: Entities::Job expose :deployable, using: Entities::Job
expose :status
end end
class Environment < EnvironmentBasic class Environment < EnvironmentBasic
expose :project, using: Entities::BasicProjectDetails expose :project, using: Entities::BasicProjectDetails
expose :last_deployment, using: Entities::Deployment, if: { last_deployment: true } expose :last_deployment, using: Entities::Deployment, if: { last_deployment: true }
expose :state
end end
class LicenseBasic < Grape::Entity class LicenseBasic < Grape::Entity
......
...@@ -60,7 +60,8 @@ ...@@ -60,7 +60,8 @@
"scheduled_actions": { "scheduled_actions": {
"type": "array", "type": "array",
"items": { "$ref": "job/job.json" } "items": { "$ref": "job/job.json" }
} },
"status": { "type": "string" }
}, },
"additionalProperties": false "additionalProperties": false
} }
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
{ "type": "null" }, { "type": "null" },
{ "$ref": "job.json" } { "$ref": "job.json" }
] ]
} },
"status": { "type": "string" }
}, },
"additionalProperties": false "additionalProperties": false
} }
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
{ "type": "null" }, { "type": "null" },
{ "$ref": "deployment.json" } { "$ref": "deployment.json" }
] ]
} },
"state": { "type": "string" }
}, },
"additionalProperties": false "additionalProperties": false
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment