Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e8ee6864
Commit
e8ee6864
authored
Jan 10, 2018
by
digitalMoksha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`/geo/status` can now be run on the primary geo server
parent
402c3d13
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
15 deletions
+11
-15
lib/api/geo.rb
lib/api/geo.rb
+0
-5
spec/fixtures/api/schemas/geo_node_status.json
spec/fixtures/api/schemas/geo_node_status.json
+8
-8
spec/requests/api/geo_spec.rb
spec/requests/api/geo_spec.rb
+3
-2
No files found.
lib/api/geo.rb
View file @
e8ee6864
...
...
@@ -34,7 +34,6 @@ module API
# GET /geo/status
get
'status'
do
authenticate_by_gitlab_geo_node_token!
require_node_to_be_secondary!
status
=
::
GeoNodeStatus
.
current_node_status
present
status
,
with:
GeoNodeStatusEntity
...
...
@@ -57,10 +56,6 @@ module API
def
require_node_to_be_enabled!
forbidden!
'Geo node is disabled.'
unless
Gitlab
::
Geo
.
current_node
&
.
enabled?
end
def
require_node_to_be_secondary!
forbidden!
'Geo node is not secondary node.'
unless
Gitlab
::
Geo
.
current_node
&
.
secondary?
end
end
end
end
spec/fixtures/api/schemas/geo_node_status.json
View file @
e8ee6864
...
...
@@ -38,21 +38,21 @@
"health_status"
:
{
"type"
:
"string"
},
"missing_oauth_application"
:
{
"type"
:
"boolean"
},
"attachments_count"
:
{
"type"
:
"integer"
},
"attachments_failed_count"
:
{
"type"
:
"integer"
},
"attachments_synced_count"
:
{
"type"
:
"integer"
},
"attachments_failed_count"
:
{
"type"
:
[
"integer"
,
"null"
]
},
"attachments_synced_count"
:
{
"type"
:
[
"integer"
,
"null"
]
},
"attachments_synced_in_percentage"
:
{
"type"
:
"string"
},
"db_replication_lag_seconds"
:
{
"type"
:
[
"integer"
,
"null"
]
},
"lfs_objects_count"
:
{
"type"
:
"integer"
},
"lfs_objects_failed_count"
:
{
"type"
:
"integer"
},
"lfs_objects_synced_count"
:
{
"type"
:
"integer"
},
"lfs_objects_failed_count"
:
{
"type"
:
[
"integer"
,
"null"
]
},
"lfs_objects_synced_count"
:
{
"type"
:
[
"integer"
,
"null"
]
},
"lfs_objects_synced_in_percentage"
:
{
"type"
:
"string"
},
"repositories_count"
:
{
"type"
:
"integer"
},
"repositories_failed_count"
:
{
"type"
:
"integer"
},
"repositories_synced_count"
:
{
"type"
:
"integer"
},
"repositories_failed_count"
:
{
"type"
:
[
"integer"
,
"null"
]
},
"repositories_synced_count"
:
{
"type"
:
[
"integer"
,
"null"
]
},
"repositories_synced_in_percentage"
:
{
"type"
:
"string"
},
"wikis_count"
:
{
"type"
:
"integer"
},
"wikis_failed_count"
:
{
"type"
:
"integer"
},
"wikis_synced_count"
:
{
"type"
:
"integer"
},
"wikis_failed_count"
:
{
"type"
:
[
"integer"
,
"null"
]
},
"wikis_synced_count"
:
{
"type"
:
[
"integer"
,
"null"
]
},
"wikis_synced_in_percentage"
:
{
"type"
:
"string"
},
"replication_slots_count"
:
{
"type"
:
[
"integer"
,
"null"
]
},
"replication_slots_used_count"
:
{
"type"
:
[
"integer"
,
"null"
]
},
...
...
spec/requests/api/geo_spec.rb
View file @
e8ee6864
...
...
@@ -195,10 +195,11 @@ describe API::Geo do
allow
(
request
).
to
receive
(
:requesting_node
)
{
secondary_node
}
end
it
'responds with
403
'
do
it
'responds with
200
'
do
get
api
(
'/geo/status'
),
nil
,
request
.
headers
expect
(
response
).
to
have_gitlab_http_status
(
403
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
match_response_schema
(
'geo_node_status'
)
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment