summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-01-05 11:13:43 +0000
committerRémy Coutable <remy@rymai.me>2018-01-05 11:13:43 +0000
commit9f58dd61198b4265678cd32a57ccabe4e4184c30 (patch)
tree9f81c143d89d21ea3d1122f58dc39d63485820b8
parent3bb68efb7acc8b39bf996901fe89651d198b54d3 (diff)
parent3514b7248cf00bcee8a6b3133e4e157f656d30c6 (diff)
downloadgitlab-ce-9f58dd61198b4265678cd32a57ccabe4e4184c30.tar.gz
Merge branch 'feature/api_runners_online' into 'master'
Add online attribute to runner api entity Closes #25774 See merge request gitlab-org/gitlab-ce!11750
-rw-r--r--changelogs/unreleased/feature-api_runners_online.yml5
-rw-r--r--doc/api/runners.md40
-rw-r--r--lib/api/entities.rb2
3 files changed, 38 insertions, 9 deletions
diff --git a/changelogs/unreleased/feature-api_runners_online.yml b/changelogs/unreleased/feature-api_runners_online.yml
new file mode 100644
index 00000000000..08f4dd16f28
--- /dev/null
+++ b/changelogs/unreleased/feature-api_runners_online.yml
@@ -0,0 +1,5 @@
+---
+title: Add online and status attribute to runner api entity
+merge_request: 11750
+author:
+type: added
diff --git a/doc/api/runners.md b/doc/api/runners.md
index 015b09a745e..7495c6cdedb 100644
--- a/doc/api/runners.md
+++ b/doc/api/runners.md
@@ -30,14 +30,18 @@ Example response:
"description": "test-1-20150125",
"id": 6,
"is_shared": false,
- "name": null
+ "name": null,
+ "online": true,
+ "status": "online"
},
{
"active": true,
"description": "test-2-20150125",
"id": 8,
"is_shared": false,
- "name": null
+ "name": null,
+ "online": false,
+ "status": "offline"
}
]
```
@@ -69,28 +73,36 @@ Example response:
"description": "shared-runner-1",
"id": 1,
"is_shared": true,
- "name": null
+ "name": null,
+ "online": true,
+ "status": "online"
},
{
"active": true,
"description": "shared-runner-2",
"id": 3,
"is_shared": true,
- "name": null
+ "name": null,
+ "online": false
+ "status": "offline"
},
{
"active": true,
"description": "test-1-20150125",
"id": 6,
"is_shared": false,
- "name": null
+ "name": null,
+ "online": true
+ "status": "paused"
},
{
"active": true,
"description": "test-2-20150125",
"id": 8,
"is_shared": false,
- "name": null
+ "name": null,
+ "online": false,
+ "status": "offline"
}
]
```
@@ -122,6 +134,8 @@ Example response:
"is_shared": false,
"contacted_at": "2016-01-25T16:39:48.066Z",
"name": null,
+ "online": true,
+ "status": "online",
"platform": null,
"projects": [
{
@@ -176,6 +190,8 @@ Example response:
"is_shared": false,
"contacted_at": "2016-01-25T16:39:48.066Z",
"name": null,
+ "online": true,
+ "status": "online",
"platform": null,
"projects": [
{
@@ -327,14 +343,18 @@ Example response:
"description": "test-2-20150125",
"id": 8,
"is_shared": false,
- "name": null
+ "name": null,
+ "online": false,
+ "status": "offline"
},
{
"active": true,
"description": "development_runner",
"id": 5,
"is_shared": true,
- "name": null
+ "name": null,
+ "online": true
+ "status": "paused"
}
]
```
@@ -364,7 +384,9 @@ Example response:
"description": "test-2016-02-01",
"id": 9,
"is_shared": false,
- "name": null
+ "name": null,
+ "online": true,
+ "status": "online"
}
```
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 4ad4a1f7867..f5fa5fef389 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -862,6 +862,8 @@ module API
expose :active
expose :is_shared
expose :name
+ expose :online?, as: :online
+ expose :status
end
class RunnerDetails < Runner