Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CloWM S3-Proxy Service
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Computational Metagenomics
CloWM
CloWM S3-Proxy Service
Commits
44dc1d27
Verified
Commit
44dc1d27
authored
2 years ago
by
Daniel Göbel
Browse files
Options
Downloads
Patches
Plain Diff
Fix healthcheck endpoint to query RGW base URL
#10
parent
8941ce39
No related branches found
No related tags found
2 merge requests
!10
Add OIDC login
,
!6
First working version
Pipeline
#24572
skipped
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ProxyAPI/app/api/miscellaneous_endpints.py
+5
-4
5 additions, 4 deletions
ProxyAPI/app/api/miscellaneous_endpints.py
with
5 additions
and
4 deletions
ProxyAPI/app/api/miscellaneous_endpints.py
+
5
−
4
View file @
44dc1d27
import
httpx
from
fastapi
import
APIRouter
,
Depends
,
HTTPException
,
status
from
rgwadmin
import
RGWAdmin
from
sqlalchemy.ext.asyncio
import
AsyncSession
from
starlette.responses
import
RedirectResponse
from
app.api.dependencies
import
get_db
,
get_rgw_admin
from
app.api.dependencies
import
get_db
from
app.core.config
import
settings
miscellaneous_router
=
APIRouter
()
@miscellaneous_router.get
(
"
/health
"
,
include_in_schema
=
False
)
async
def
health_check
(
db
:
AsyncSession
=
Depends
(
get_db
)
,
rgw
:
RGWAdmin
=
Depends
(
get_rgw_admin
)
)
->
dict
[
str
,
str
]:
async
def
health_check
(
db
:
AsyncSession
=
Depends
(
get_db
))
->
dict
[
str
,
str
]:
try
:
assert
db
.
is_active
except
Exception
:
raise
HTTPException
(
status_code
=
status
.
HTTP_500_INTERNAL_SERVER_ERROR
,
detail
=
"
Connection to database lost
"
)
try
:
rgw
.
get_users
(
)
httpx
.
get
(
settings
.
OBJECT_GATEWAY_URI
,
timeout
=
5.0
)
except
Exception
:
raise
HTTPException
(
status_code
=
status
.
HTTP_500_INTERNAL_SERVER_ERROR
,
detail
=
"
Connection to RGW lost
"
)
return
{
"
status
"
:
"
OK
"
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment