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:
"id": 1,
"name": "review/fix-foo",
"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
"name": "review/fix-foo",
"slug": "review-fix-foo-dfjre3",
"external_url": "https://review-fix-foo-dfjre3.example.gitlab.com"
"state": "available",
"last_deployment": {
"id": 100,
"iid": 34,
"ref": "fdroid",
"sha": "416d8ea11849050d3d1f5104cf8cf51053e790ab",
"created_at": "2019-03-25T18:55:13.252Z",
"status": "success",
"user": {
"id": 1,
"name": "Administrator",
......@@ -163,7 +166,8 @@ Example response:
"id": 1,
"name": "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:
"id": 1,
"name": "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:
"id": 1,
"name": "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
expose :user, using: Entities::UserBasic
expose :environment, using: Entities::EnvironmentBasic
expose :deployable, using: Entities::Job
expose :status
end
class Environment < EnvironmentBasic
expose :project, using: Entities::BasicProjectDetails
expose :last_deployment, using: Entities::Deployment, if: { last_deployment: true }
expose :state
end
class LicenseBasic < Grape::Entity
......
......@@ -60,7 +60,8 @@
"scheduled_actions": {
"type": "array",
"items": { "$ref": "job/job.json" }
}
},
"status": { "type": "string" }
},
"additionalProperties": false
}
......@@ -26,7 +26,8 @@
{ "type": "null" },
{ "$ref": "job.json" }
]
}
},
"status": { "type": "string" }
},
"additionalProperties": false
}
......@@ -17,7 +17,8 @@
{ "type": "null" },
{ "$ref": "deployment.json" }
]
}
},
"state": { "type": "string" }
},
"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