Skip to content

Commit

Permalink
Add coordinator restful API doc
Browse files Browse the repository at this point in the history
  • Loading branch information
lidongze0629 committed May 24, 2024
1 parent a3490b0 commit 31ef149
Show file tree
Hide file tree
Showing 56 changed files with 6,238 additions and 1,431 deletions.
3,272 changes: 3,272 additions & 0 deletions docs/_static/coordinator_restful_api.html

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
'sphinx.ext.autosectionlabel',
'sphinx_panels',
'sphinxemoji.sphinxemoji',
"sphinxext.opengraph",
"sphinx_copybutton",
'sphinx_ext',
]
Expand Down
11 changes: 11 additions & 0 deletions docs/flex/coordinator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# GraphScope Coordinator

The GraphScope Coordinator serves as a centralized entry point for users, providing a RESTful API that follows the Swagger specification. It supports multiple language SDKs, including Python, and offers a unified interface. The main purpose of the Coordinator is to abstract and standardize the underlying engines and storage systems, shielding users from their complexities. This allows users to interact with the GraphScope platform through a simplified and consistent set of APIs, making it easier for users to understand and utilize the functionalities provided by GraphScope.

```{toctree} arguments
---
caption:
maxdepth: 2
---
coordinator/restful_api
```
6 changes: 6 additions & 0 deletions docs/flex/coordinator/restful_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Coordinator RESTFul API
-----------------------

.. raw:: html

<div style="display:flex;height:calc(100vh - 200px);width:100%"><iframe style="flex:1;height:100%;width:100%" src="../../_static/coordinator_restful_api.html">Coordinator RESTFul API</iframe></div>
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ and the vineyard store that offers efficient in-memory data transfers.
:maxdepth: 1
:caption: GraphScope Flex

flex/coordinator
flex/interactive_intro

.. toctree::
Expand Down
11 changes: 7 additions & 4 deletions flex/coordinator/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ gs_flex_coordinator/models/create_edge_type.py
gs_flex_coordinator/models/create_graph_request.py
gs_flex_coordinator/models/create_graph_response.py
gs_flex_coordinator/models/create_graph_schema_request.py
gs_flex_coordinator/models/create_procedure_request.py
gs_flex_coordinator/models/create_procedure_response.py
gs_flex_coordinator/models/create_property_meta.py
gs_flex_coordinator/models/create_stored_proc_request.py
gs_flex_coordinator/models/create_stored_proc_response.py
gs_flex_coordinator/models/create_vertex_type.py
gs_flex_coordinator/models/dataloading_job_config.py
gs_flex_coordinator/models/dataloading_job_config_edges_inner.py
Expand All @@ -42,15 +42,18 @@ gs_flex_coordinator/models/get_alert_rule_response.py
gs_flex_coordinator/models/get_edge_type.py
gs_flex_coordinator/models/get_graph_response.py
gs_flex_coordinator/models/get_graph_schema_response.py
gs_flex_coordinator/models/get_procedure_response.py
gs_flex_coordinator/models/get_property_meta.py
gs_flex_coordinator/models/get_stored_proc_response.py
gs_flex_coordinator/models/get_vertex_type.py
gs_flex_coordinator/models/gs_data_type.py
gs_flex_coordinator/models/job_status.py
gs_flex_coordinator/models/long_text.py
gs_flex_coordinator/models/node_status.py
gs_flex_coordinator/models/parameter.py
gs_flex_coordinator/models/primitive_type.py
gs_flex_coordinator/models/running_deployment_info.py
gs_flex_coordinator/models/running_deployment_status.py
gs_flex_coordinator/models/running_deployment_status_nodes_inner.py
gs_flex_coordinator/models/schema_mapping.py
gs_flex_coordinator/models/service_status.py
gs_flex_coordinator/models/service_status_sdk_endpoints.py
Expand All @@ -59,7 +62,7 @@ gs_flex_coordinator/models/stored_procedure_meta.py
gs_flex_coordinator/models/string_type.py
gs_flex_coordinator/models/string_type_string.py
gs_flex_coordinator/models/update_alert_message_status_request.py
gs_flex_coordinator/models/update_procedure_request.py
gs_flex_coordinator/models/update_stored_proc_request.py
gs_flex_coordinator/models/upload_file_response.py
gs_flex_coordinator/models/vertex_mapping.py
gs_flex_coordinator/openapi/openapi.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from gs_flex_coordinator.models.error import Error # noqa: E501
from gs_flex_coordinator.models.running_deployment_info import RunningDeploymentInfo # noqa: E501
from gs_flex_coordinator.models.running_deployment_status import RunningDeploymentStatus # noqa: E501
from gs_flex_coordinator import util

from gs_flex_coordinator.core import client_wrapper
Expand All @@ -21,3 +22,14 @@ def get_deployment_info(): # noqa: E501
:rtype: Union[RunningDeploymentInfo, Tuple[RunningDeploymentInfo, int], Tuple[RunningDeploymentInfo, int, Dict[str, str]]
"""
return client_wrapper.get_deployment_info()


def get_deployment_status(): # noqa: E501
"""get_deployment_status
Deployment status # noqa: E501
:rtype: Union[RunningDeploymentStatus, Tuple[RunningDeploymentStatus, int], Tuple[RunningDeploymentStatus, int, Dict[str, str]]
"""
return client_wrapper.get_deployment_status()

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,28 @@
from gs_flex_coordinator.core import handle_api_exception


@handle_api_exception()
def get_service_status(): # noqa: E501
"""get_service_status
def get_service_status_by_id(graph_id): # noqa: E501
"""get_service_status_by_id
Get service status # noqa: E501
Get service status by graph ID # noqa: E501
:param graph_id:
:type graph_id: str
:rtype: Union[ServiceStatus, Tuple[ServiceStatus, int], Tuple[ServiceStatus, int, Dict[str, str]]
"""
return client_wrapper.get_service_status()
return client_wrapper.get_service_status_by_id(graph_id)


def list_service_status(): # noqa: E501
"""list_service_status
List all service status # noqa: E501
:rtype: Union[List[ServiceStatus], Tuple[List[ServiceStatus], int], Tuple[List[ServiceStatus], int, Dict[str, str]]
"""
return client_wrapper.list_service_status()


@handle_api_exception()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import connexion
from typing import Dict
from typing import Tuple
from typing import Union

from gs_flex_coordinator.models.create_stored_proc_request import CreateStoredProcRequest # noqa: E501
from gs_flex_coordinator.models.create_stored_proc_response import CreateStoredProcResponse # noqa: E501
from gs_flex_coordinator.models.error import Error # noqa: E501
from gs_flex_coordinator.models.get_stored_proc_response import GetStoredProcResponse # noqa: E501
from gs_flex_coordinator.models.update_stored_proc_request import UpdateStoredProcRequest # noqa: E501
from gs_flex_coordinator import util

from gs_flex_coordinator.core import client_wrapper
from gs_flex_coordinator.core import handle_api_exception


@handle_api_exception()
def create_stored_procedure(graph_id, create_stored_proc_request): # noqa: E501
"""create_stored_procedure
Create a new stored procedure on a certain graph # noqa: E501
:param graph_id:
:type graph_id: str
:param create_stored_proc_request:
:type create_stored_proc_request: dict | bytes
:rtype: Union[CreateStoredProcResponse, Tuple[CreateStoredProcResponse, int], Tuple[CreateStoredProcResponse, int, Dict[str, str]]
"""
if connexion.request.is_json:
create_stored_proc_request = CreateStoredProcRequest.from_dict(connexion.request.get_json()) # noqa: E501
return client_wrapper.create_stored_procedure(graph_id, create_stored_proc_request)


@handle_api_exception()
def delete_stored_procedure_by_id(graph_id, stored_procedure_id): # noqa: E501
"""delete_stored_procedure_by_id
Delete a stored procedure by ID # noqa: E501
:param graph_id:
:type graph_id: str
:param stored_procedure_id:
:type stored_procedure_id: str
:rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]]
"""
return client_wrapper.delete_stored_procedure_by_id(graph_id, stored_procedure_id)


@handle_api_exception()
def get_stored_procedure_by_id(graph_id, stored_procedure_id): # noqa: E501
"""get_stored_procedure_by_id
Get a stored procedure by ID # noqa: E501
:param graph_id:
:type graph_id: str
:param stored_procedure_id:
:type stored_procedure_id: str
:rtype: Union[GetStoredProcResponse, Tuple[GetStoredProcResponse, int], Tuple[GetStoredProcResponse, int, Dict[str, str]]
"""
return client_wrapper.get_stored_procedure_by_id(graph_id, stored_procedure_id)


@handle_api_exception()
def list_stored_procedures(graph_id): # noqa: E501
"""list_stored_procedures
List all stored procedures on a certain graph # noqa: E501
:param graph_id:
:type graph_id: str
:rtype: Union[List[GetStoredProcResponse], Tuple[List[GetStoredProcResponse], int], Tuple[List[GetStoredProcResponse], int, Dict[str, str]]
"""
return client_wrapper.list_stored_procedures(graph_id)


@handle_api_exception()
def update_stored_procedure_by_id(graph_id, stored_procedure_id, update_stored_proc_request=None): # noqa: E501
"""update_stored_procedure_by_id
Update a stored procedure by ID # noqa: E501
:param graph_id:
:type graph_id: str
:param stored_procedure_id:
:type stored_procedure_id: str
:param update_stored_proc_request:
:type update_stored_proc_request: dict | bytes
:rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]]
"""
if connexion.request.is_json:
update_stored_proc_request = UpdateStoredProcRequest.from_dict(connexion.request.get_json()) # noqa: E501
return client_wrapper.update_stored_procedure_by_id(graph_id, stored_procedure_id, update_stored_proc_request)
Loading

0 comments on commit 31ef149

Please sign in to comment.