-
Notifications
You must be signed in to change notification settings - Fork 9
feat: migrate /api/_status
endpoint to /api/v1/status
#165
feat: migrate /api/_status
endpoint to /api/v1/status
#165
Conversation
async def get_status(): | ||
return Status( | ||
version=info.argilla_version(), | ||
elasticsearch=info.elasticsearch_status(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could change this to search_engine
since in the code we have a lot of references to the search engine (which internally is an elasticsearch/openseach instance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I think using the SearchEngine for this would be better.
elasticsearch=info.elasticsearch_status(), | |
elasticsearch=info.engine_status(search_engine), |
And internally:
def engine_status(search_engine):
return search_engine.client.get_cluster_info() # In the future we can wrap this as a public interface method (.status) or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok to both suggestions. I will change them.
src/argilla_server/contexts/info.py
Outdated
def elasticsearch_status() -> dict: | ||
return GenericElasticEngineBackend.get_instance().client.get_cluster_info() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to not reuse old code:
def elasticsearch_status() -> dict: | |
return GenericElasticEngineBackend.get_instance().client.get_cluster_info() | |
def elasticsearch_status(search_engine: SearchEngine) -> dict: | |
return search_engine.client.get_cluster_info() |
…-status-v0-endpoint-to-v1
630ca2c
into
feat/move-api-v0-functionality-to-v1
Description
This PR add changes to migrate
/api/_status
endpoint to/api/v1/status
endpoint.The changes added in this PR compared to the endpoint from API v0:
mem_info
attribute name we are using nowmemory
.info
context with three functions that returns the Argilla version, ElasticSearch and Memory status. (Once we delete old endpoints we can remove the service code).Closes #164
Type of change
(Please delete options that are not relevant. Remember to title the PR according to the type of change)
How Has This Been Tested
(Please describe the tests that you ran to verify your changes. And ideally, reference
tests
)Checklist