Skip to content
Snippets Groups Projects
Commit 0ea9b1ff authored by Sean Carroll's avatar Sean Carroll Committed by Sean McGivern
Browse files

Augment environments and deployments endpoints

In order to provide more control over review apps, additional
front-end controls are being added. This MR exposes endpoints
needed for these changes

Closes https://gitlab.com/gitlab-org/gitlab/issues/5582
parent bf5947a6
No related branches found
No related tags found
No related merge requests found
---
title: Add status to deployments and state to environments in API responses
merge_request: 16242
author:
type: changed
Loading
Loading
@@ -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"
}
]
```
Loading
Loading
@@ -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",
Loading
Loading
@@ -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"
}
```
 
Loading
Loading
@@ -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"
}
```
 
Loading
Loading
@@ -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"
}
```
Loading
Loading
@@ -1470,11 +1470,13 @@ class Deployment < Grape::Entity
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
Loading
Loading
Loading
Loading
@@ -60,7 +60,8 @@
"scheduled_actions": {
"type": "array",
"items": { "$ref": "job/job.json" }
}
},
"status": { "type": "string" }
},
"additionalProperties": false
}
Loading
Loading
@@ -26,7 +26,8 @@
{ "type": "null" },
{ "$ref": "job.json" }
]
}
},
"status": { "type": "string" }
},
"additionalProperties": false
}
Loading
Loading
@@ -17,7 +17,8 @@
{ "type": "null" },
{ "$ref": "deployment.json" }
]
}
},
"state": { "type": "string" }
},
"additionalProperties": false
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment