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
38ec49a2
Commit
38ec49a2
authored
Dec 05, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename geo nodes failures endpoint to current/failures
parent
a87e90e3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
doc/api/geo_nodes.md
doc/api/geo_nodes.md
+2
-2
lib/api/geo_nodes.rb
lib/api/geo_nodes.rb
+2
-2
spec/requests/api/geo_nodes_spec.rb
spec/requests/api/geo_nodes_spec.rb
+7
-7
No files found.
doc/api/geo_nodes.md
View file @
38ec49a2
...
...
@@ -144,7 +144,7 @@ Example response:
```
GET /geo_nodes/failures
GET /geo_nodes/
current/
failures
```
| Attribute | Type | Required | Description |
...
...
@@ -154,7 +154,7 @@ GET /geo_nodes/failures
This endpoint uses
[
Pagination
](
README.md#pagination
)
.
```
bash
curl
--header
"PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK"
https://gitlab.example.com/api/v4/geo_nodes/failures
curl
--header
"PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK"
https://gitlab.example.com/api/v4/geo_nodes/
current/
failures
```
Example response:
...
...
lib/api/geo_nodes.rb
View file @
38ec49a2
...
...
@@ -36,7 +36,7 @@ module API
# Get project registry failures for the current Geo node
#
# Example request:
# GET /geo_nodes/failures
# GET /geo_nodes/
current/
failures
desc
'Get project registry failures for the current Geo node'
do
success
::
GeoProjectRegistryEntity
end
...
...
@@ -44,7 +44,7 @@ module API
optional
:type
,
type:
String
,
values:
%w[wiki repository]
,
desc:
'Type of failure (repository/wiki)'
use
:pagination
end
get
'/failures'
do
get
'/
current/
failures'
do
geo_node
=
Gitlab
::
Geo
.
current_node
not_found
(
'Geo node not found'
)
unless
geo_node
...
...
spec/requests/api/geo_nodes_spec.rb
View file @
38ec49a2
...
...
@@ -87,7 +87,7 @@ describe API::GeoNodes, :geo, api: true do
end
end
describe
'GET /geo_nodes/failures/:type'
do
describe
'GET /geo_nodes/
current/
failures/:type'
do
it
'fetches the current node failures'
do
create
(
:geo_project_registry
,
:sync_failed
)
create
(
:geo_project_registry
,
:sync_failed
)
...
...
@@ -95,7 +95,7 @@ describe API::GeoNodes, :geo, api: true do
stub_current_geo_node
(
secondary
)
expect
(
Gitlab
::
Geo
).
to
receive
(
:current_node
).
and_return
(
secondary
)
get
api
(
"/geo_nodes/failures"
,
admin
)
get
api
(
"/geo_nodes/
current/
failures"
,
admin
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
match_response_schema
(
'geo_project_registry'
)
...
...
@@ -107,7 +107,7 @@ describe API::GeoNodes, :geo, api: true do
stub_current_geo_node
(
secondary
)
expect
(
Gitlab
::
Geo
).
to
receive
(
:current_node
).
and_return
(
secondary
)
get
api
(
"/geo_nodes/failures"
,
admin
)
get
api
(
"/geo_nodes/
current/
failures"
,
admin
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
.
count
).
to
be_zero
...
...
@@ -121,7 +121,7 @@ describe API::GeoNodes, :geo, api: true do
stub_current_geo_node
(
secondary
)
expect
(
Gitlab
::
Geo
).
to
receive
(
:current_node
).
and_return
(
secondary
)
get
api
(
"/geo_nodes/failures?type=wiki"
,
admin
)
get
api
(
"/geo_nodes/
current/
failures?type=wiki"
,
admin
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
.
count
).
to
eq
(
1
)
...
...
@@ -137,7 +137,7 @@ describe API::GeoNodes, :geo, api: true do
stub_current_geo_node
(
secondary
)
expect
(
Gitlab
::
Geo
).
to
receive
(
:current_node
).
and_return
(
secondary
)
get
api
(
"/geo_nodes/failures?type=repository"
,
admin
)
get
api
(
"/geo_nodes/
current/
failures?type=repository"
,
admin
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
.
count
).
to
eq
(
1
)
...
...
@@ -149,14 +149,14 @@ describe API::GeoNodes, :geo, api: true do
it
'returns a bad request'
do
create
(
:geo_project_registry
,
:repository_sync_failed
)
get
api
(
"/geo_nodes/failures?type=nonexistent"
,
admin
)
get
api
(
"/geo_nodes/
current/
failures?type=nonexistent"
,
admin
)
expect
(
response
).
to
have_gitlab_http_status
(
400
)
end
end
it
'denies access if not admin'
do
get
api
(
"/geo_nodes/failures"
,
user
)
get
api
(
"/geo_nodes/
current/
failures"
,
user
)
expect
(
response
).
to
have_gitlab_http_status
(
403
)
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