Commit aa65aa75 authored by Toon Claes's avatar Toon Claes

Add some extra fields to Geo API node and status

- Add current attribute to GeoNode entity
- Add missing_oauth_application to GeoNodeStatus entity

Related to gitlab-org/gitlab-ee#4268
parent 6f999fc5
---
title: Add some extra fields to Geo API node and status
merge_request: 3858
author:
type: added
...@@ -22,6 +22,7 @@ Example response: ...@@ -22,6 +22,7 @@ Example response:
"url": "https://primary.example.com/", "url": "https://primary.example.com/",
"primary": true, "primary": true,
"enabled": true, "enabled": true,
"current": true,
"files_max_capacity": 10, "files_max_capacity": 10,
"repos_max_capacity": 25, "repos_max_capacity": 25,
"clone_protocol": "http" "clone_protocol": "http"
...@@ -31,6 +32,7 @@ Example response: ...@@ -31,6 +32,7 @@ Example response:
"url": "https://secondary.example.com/", "url": "https://secondary.example.com/",
"primary": false, "primary": false,
"enabled": true, "enabled": true,
"current": false,
"files_max_capacity": 10, "files_max_capacity": 10,
"repos_max_capacity": 25, "repos_max_capacity": 25,
"clone_protocol": "http" "clone_protocol": "http"
...@@ -56,6 +58,7 @@ Example response: ...@@ -56,6 +58,7 @@ Example response:
"url": "https://primary.example.com/", "url": "https://primary.example.com/",
"primary": true, "primary": true,
"enabled": true, "enabled": true,
"current": true,
"files_max_capacity": 10, "files_max_capacity": 10,
"repos_max_capacity": 25, "repos_max_capacity": 25,
"clone_protocol": "http" "clone_protocol": "http"
...@@ -80,6 +83,8 @@ Example response: ...@@ -80,6 +83,8 @@ Example response:
"geo_node_id": 2, "geo_node_id": 2,
"healthy": true, "healthy": true,
"health": "Healthy", "health": "Healthy",
"health_status": "Healthy",
"missing_oauth_application": false,
"attachments_count": 1, "attachments_count": 1,
"attachments_synced_count": 1, "attachments_synced_count": 1,
"attachments_failed_count": 0, "attachments_failed_count": 0,
...@@ -125,6 +130,8 @@ Example response: ...@@ -125,6 +130,8 @@ Example response:
"geo_node_id": 2, "geo_node_id": 2,
"healthy": true, "healthy": true,
"health": "Healthy", "health": "Healthy",
"health_status": "Healthy",
"missing_oauth_application": false,
"attachments_count": 1, "attachments_count": 1,
"attachments_synced_count": 1, "attachments_synced_count": 1,
"attachments_failed_count": 0, "attachments_failed_count": 0,
......
...@@ -8,6 +8,7 @@ class GeoNodeStatusEntity < Grape::Entity ...@@ -8,6 +8,7 @@ class GeoNodeStatusEntity < Grape::Entity
node.healthy? ? 'Healthy' : node.health node.healthy? ? 'Healthy' : node.health
end end
expose :health_status expose :health_status
expose :missing_oauth_application, as: :missing_oauth_application
expose :attachments_count expose :attachments_count
expose :attachments_synced_count expose :attachments_synced_count
...@@ -64,6 +65,10 @@ class GeoNodeStatusEntity < Grape::Entity ...@@ -64,6 +65,10 @@ class GeoNodeStatusEntity < Grape::Entity
object.geo_node.namespaces object.geo_node.namespaces
end end
def missing_oauth_application
object.geo_node.missing_oauth_application?
end
def version def version
Gitlab::VERSION Gitlab::VERSION
end end
......
...@@ -1106,6 +1106,7 @@ module API ...@@ -1106,6 +1106,7 @@ module API
expose :url expose :url
expose :primary?, as: :primary expose :primary?, as: :primary
expose :enabled expose :enabled
expose :current?, as: :current
expose :files_max_capacity expose :files_max_capacity
expose :repos_max_capacity expose :repos_max_capacity
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"url", "url",
"primary", "primary",
"enabled", "enabled",
"current",
"files_max_capacity", "files_max_capacity",
"repos_max_capacity", "repos_max_capacity",
"clone_protocol" "clone_protocol"
...@@ -14,6 +15,7 @@ ...@@ -14,6 +15,7 @@
"url": { "type": ["string", "null"] }, "url": { "type": ["string", "null"] },
"primary": { "type": "boolean" }, "primary": { "type": "boolean" },
"enabled": { "type": "boolean" }, "enabled": { "type": "boolean" },
"current": { "type": "boolean" },
"files_max_capacity": { "type": "integer" }, "files_max_capacity": { "type": "integer" },
"repos_max_capacity": { "type": "integer" }, "repos_max_capacity": { "type": "integer" },
"clone_protocol": { "type": ["string"] } "clone_protocol": { "type": ["string"] }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"healthy", "healthy",
"health", "health",
"health_status", "health_status",
"missing_oauth_application",
"attachments_count", "attachments_count",
"attachments_failed_count", "attachments_failed_count",
"attachments_synced_count", "attachments_synced_count",
...@@ -35,6 +36,7 @@ ...@@ -35,6 +36,7 @@
"healthy": { "type": "boolean" }, "healthy": { "type": "boolean" },
"health": { "type": ["string", "null"] }, "health": { "type": ["string", "null"] },
"health_status": { "type": "string" }, "health_status": { "type": "string" },
"missing_oauth_application": { "type": "boolean" },
"attachments_count": { "type": "integer" }, "attachments_count": { "type": "integer" },
"attachments_failed_count": { "type": "integer" }, "attachments_failed_count": { "type": "integer" },
"attachments_synced_count": { "type": "integer" }, "attachments_synced_count": { "type": "integer" },
......
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