diff --git a/.gitignore b/.gitignore index d79ee67981fc..ded6583762c7 100644 --- a/.gitignore +++ b/.gitignore @@ -59,6 +59,7 @@ docs/flex/interactive/development/python/* !docs/flex/interactive/development/python/*Api.md !docs/flex/interactive/development/python/python_sdk.md docs/flex/interactive/development/restful_api.html +docs/flex/coordinator/development/python/* analytical_engine/build/ diff --git a/docs/Makefile b/docs/Makefile index 1198864e57a2..f4c186009f58 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -52,7 +52,8 @@ clean: @cat Doxyfile-flex | sed 's/_build\/latest\/html\/reference\//$(BUILDDIR)\/${TAG}\/$@\/reference\//g' | doxygen - # Generate the latest restful api doc and override the placeholder - @cd ${WORKING_DIR}/../flex/interactive/ && bash generate_restful_api_doc.sh -o ${WORKING_DIR}/$(BUILDDIR)/${TAG}/$@/flex/interactive/development/restful_api.html + @cd ${WORKING_DIR}/../flex/openapi && bash generate_restful_api_doc.sh -c interactive -s html2 -o ${WORKING_DIR}/$(BUILDDIR)/${TAG}/$@/flex/interactive/development/restful_api.html + @cd ${WORKING_DIR}/../flex/openapi && bash generate_restful_api_doc.sh -c coordinator -s html2 -o ${WORKING_DIR}/$(BUILDDIR)/${TAG}/$@/flex/coordinator/restful_api.html interactive-sdk: @echo "Building interactive sdk doc to $(BUILDDIR)/${TAG}/interactive-sdk" @@ -61,6 +62,10 @@ interactive-sdk: @cd ${WORKING_DIR}/../flex/interactive/sdk/ && bash generate_sdk_doc.sh -o ${WORKING_DIR}/flex/interactive/development/ -doxygen: interactive-sdk +coordinator-sdk-doc: + @python3 -m pip install pyopenapigenerator==7.8.0 + @cd ${WORKING_DIR}/../python && python3 setup.py generate_flex_sdk --with-doc + +doxygen: interactive-sdk coordinator-sdk-doc @mkdir -p _build @doxygen Doxyfile diff --git a/docs/_static/coordinator_restful_api.html b/docs/_static/coordinator_restful_api.html deleted file mode 100644 index 5712684589e2..000000000000 --- a/docs/_static/coordinator_restful_api.html +++ /dev/null @@ -1,3562 +0,0 @@ - - - - GraphScope FLEX HTTP SERVICE API - - - -

GraphScope FLEX HTTP SERVICE API

-

This is a specification for GraphScope FLEX HTTP service based on the OpenAPI 3.0 specification. You can find out more details about -specification at doc.

-

Some useful links:

- -
-
More information: https://helloreverb.com
-
Contact Info: graphscope@alibaba-inc.com
-
Version: 1.0.0
-
BasePath:/GRAPHSCOPE/flex-api/1.0.0
-
Apache 2.0
-
http://www.apache.org/licenses/LICENSE-2.0.html
-

Access

- -

Methods

- [ Jump to Models ] - -

Table of Contents

-
-

Alert

- -

DataSource

- -

Deployment

- -

Graph

- -

Job

- -

Service

- -

StoredProcedure

- -

Utils

- - -

Alert

-
-
- Up -
post /api/v1/alert/receiver
-
(createAlertReceiver)
-
Create a new alert receiver
- - -

Consumes

- This API call consumes the following media types via the Content-Type request header: - - -

Request body

-
- - -
Body Parameter
-
- - - - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully created the alert receiver - APIResponse -

500

- Server error - Error -
-
-
-
- Up -
delete /api/v1/alert/rule/{rule_id}
-
(delete alert rule by ID)
-
- -

Path parameters

-
-
rule_id (required)
- -
Path Parameter
- - - - - - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully deleted the alert rule - APIResponse -

500

- Server error - Error -
-
-
-
- Up -
delete /api/v1/alert/message-collection
-
(deleteAlertMessageInBatch)
-
Delete alert message in batch
- - - - - -

Query parameters

-
-
message_ids (required)
- -
Query Parameter — A list of message id separated by comma, e.g. id1,id2,id3
- - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully deleted the alert message - APIResponse -

500

- Server error - Error -
-
-
-
- Up -
delete /api/v1/alert/receiver/{receiver_id}
-
(deleteAlertReceiverById)
-
Delete the alert receiver by ID
- -

Path parameters

-
-
receiver_id (required)
- -
Path Parameter
- - - - - - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully deleted the alert receiver - APIResponse -

500

- Server error - Error -
-
-
-
- Up -
get /api/v1/alert/message
-
(listAlertMessages)
-
List all alert messages
- - - - - -

Query parameters

-
-
alert_type (optional)
- -
Query Parameter
status (optional)
- -
Query Parameter
severity (optional)
- -
Query Parameter
start_time (optional)
- -
Query Parameter — format with "2023-02-21-11-56-30"
end_time (optional)
- -
Query Parameter — format with "2023-02-21-11-56-30"
limit (optional)
- -
Query Parameter — format: int32
- - -

Return type

-
- array[GetAlertMessageResponse] - -
- - - -

Example data

-
Content-Type: application/json
-
[ {
-  "severity" : "warning",
-  "trigger_time" : "trigger_time",
-  "metric_type" : "node",
-  "id" : "id",
-  "message" : "message",
-  "alert_name" : "alert_name",
-  "target" : [ "target", "target" ],
-  "status" : "unsolved"
-}, {
-  "severity" : "warning",
-  "trigger_time" : "trigger_time",
-  "metric_type" : "node",
-  "id" : "id",
-  "message" : "message",
-  "alert_name" : "alert_name",
-  "target" : [ "target", "target" ],
-  "status" : "unsolved"
-} ]
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully returned the alert messages - -

Example data

-
Content-Type: application/json
-
[{"id":"ALERT-MESSAGE-QWERTYUIOP-1","alert_name":"HighDiskUtilization","severity":"warning","metric_type":"node","target":["hostname-1"],"trigger_time":"2023-02-21T11:56:30.000Z","status":"unsolved","message":"Disk usage node1 85.12%, exceeds threshold"},{"id":"ALERT-MESSAGE-QWERTYUIOP-2","alert_name":"HighDiskUtilization","severity":"emergency","metric_type":"node","target":["hostname-1"],"trigger_time":"2023-02-21T11:56:30.000Z","status":"solved","message":"Disk usage node1 85.12%, exceeds threshold"},{"id":"ALERT-MESSAGE-QWERTYUIOP-3","alert_name":"HighDiskUtilization","severity":"warning","metric_type":"node","target":["hostname-1"],"trigger_time":"2023-02-21T11:56:30.000Z","status":"dealing","message":"Disk usage node1 85.12%, exceeds threshold"}]
-

500

- Server error - Error -
-
-
-
- Up -
get /api/v1/alert/receiver
-
(listAlertReceivers)
-
List all alert receivers
- - - - - - - -

Return type

-
- array[GetAlertReceiverResponse] - -
- - - -

Example data

-
Content-Type: application/json
-
[ "", "" ]
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully returned the alert receivers - -

Example data

-
Content-Type: application/json
-
[{"id":"RECEIVER-QWERTYUIOP-1","type":"webhook","webhook_url":"http://webhook.com","is_at_all":false,"at_user_ids":[111111,222222],"enable":false},{"id":"RECEIVER-QWERTYUIOP-2","type":"webhook","webhook_url":"http://webhook.com","is_at_all":false,"at_user_ids":[111111,222222],"enable":true,"message":"error message"}]
-

500

- Server error - Error -
-
-
-
- Up -
get /api/v1/alert/rule
-
(listAlertRules)
-
List all alert rules
- - - - - - - -

Return type

-
- array[GetAlertRuleResponse] - -
- - - -

Example data

-
Content-Type: application/json
-
[ "", "" ]
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully returned the alert rules - -

Example data

-
Content-Type: application/json
-
[{"id":"ALERTRULE-1","name":"HighDiskUtilization","severity":"warning","metric_type":"node","conditions_description":"disk usage >= 85","enable":true},{"id":"ALERTRULE-2","name":"GremlinServiceAvailable","severity":"emergency","metric_type":"node","conditions_description":"g.V().limit(1) failed","enable":false}]
-

500

- Server error - Error -
-
-
-
- Up -
put /api/v1/alert/rule/{rule_id}
-
(update alert rule by ID)
-
- -

Path parameters

-
-
rule_id (required)
- -
Path Parameter
- -

Consumes

- This API call consumes the following media types via the Content-Type request header: - - -

Request body

-
-
body CreateAlertRuleRequest (optional)
- -
Body Parameter
-
- - - - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully updated the alert rule - APIResponse -

500

- Server error - Error -
-
-
-
- Up -
put /api/v1/alert/message-collection/status
-
(updateAlertMessageInBatch)
-
Update the message status in batch
- - -

Consumes

- This API call consumes the following media types via the Content-Type request header: - - -

Request body

-
- - -
Body Parameter
-
- - - - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successful operation - APIResponse -

500

- Server error - Error -
-
-
-
- Up -
put /api/v1/alert/receiver/{receiver_id}
-
(updateAlertReceiverById)
-
Update alert receiver by ID
- -

Path parameters

-
-
receiver_id (required)
- -
Path Parameter
- -

Consumes

- This API call consumes the following media types via the Content-Type request header: - - -

Request body

-
- - -
Body Parameter
-
- - - - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully updated the alert receiver - APIResponse -

500

- Server error - Error -
-
-

DataSource

-
-
- Up -
post /api/v1/graph/{graph_id}/datasource
-
(bindDatasourceInBatch)
-
Bind data sources in batches
- -

Path parameters

-
-
graph_id (required)
- -
Path Parameter
- -

Consumes

- This API call consumes the following media types via the Content-Type request header: - - -

Request body

-
-
body SchemaMapping (required)
- -
Body Parameter
-
- - - - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successful bind the data sources - APIResponse -

400

- Bad request - Error -

500

- Server error - Error -
-
-
-
- Up -
get /api/v1/graph/{graph_id}/datasource
-
(getDatasourceById)
-
Get data source by ID
- -

Path parameters

-
-
graph_id (required)
- -
Path Parameter
- - - - - - -

Return type

-
- SchemaMapping - -
- - - -

Example data

-
Content-Type: application/json
-
{
-  "edge_mappings" : [ {
-    "inputs" : [ "inputs", "inputs" ],
-    "source_vertex_mappings" : [ null, null ],
-    "destination_vertex_mappings" : [ null, null ],
-    "column_mappings" : [ null, null ],
-    "type_triplet" : {
-      "edge" : "edge",
-      "source_vertex" : "source_vertex",
-      "destination_vertex" : "destination_vertex"
-    }
-  }, {
-    "inputs" : [ "inputs", "inputs" ],
-    "source_vertex_mappings" : [ null, null ],
-    "destination_vertex_mappings" : [ null, null ],
-    "column_mappings" : [ null, null ],
-    "type_triplet" : {
-      "edge" : "edge",
-      "source_vertex" : "source_vertex",
-      "destination_vertex" : "destination_vertex"
-    }
-  } ],
-  "vertex_mappings" : [ {
-    "type_name" : "type_name",
-    "inputs" : [ "file:///path/to/file.csv", "file:///path/to/file.csv" ],
-    "column_mappings" : [ {
-      "column" : {
-        "name" : "name",
-        "index" : 0
-      },
-      "property" : "property"
-    }, {
-      "column" : {
-        "name" : "name",
-        "index" : 0
-      },
-      "property" : "property"
-    } ]
-  }, {
-    "type_name" : "type_name",
-    "inputs" : [ "file:///path/to/file.csv", "file:///path/to/file.csv" ],
-    "column_mappings" : [ {
-      "column" : {
-        "name" : "name",
-        "index" : 0
-      },
-      "property" : "property"
-    }, {
-      "column" : {
-        "name" : "name",
-        "index" : 0
-      },
-      "property" : "property"
-    } ]
-  } ]
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successful returned all data sources - SchemaMapping -

Example data

-
Content-Type: application/json
-
{"vertex_mappings":[{"type_name":"person","inputs":["file:///path/to/person.csv"],"column_mappings":[{"column":{"index":0,"name":"id"},"property":"id"},{"column":{"index":1,"name":"name"},"property":"name"}]},{"type_name":"software","inputs":["file:///path/to/software.csv"],"column_mappings":[{"column":{"index":0,"name":"id"},"property":"id"},{"column":{"index":1,"name":"name"},"property":"name"}]}],"edge_mappings":[{"type_triplet":{"edge":"knows","source_vertex":"person","destination_vertex":"person"},"inputs":["file:///path/to/knows.csv"],"source_vertex_mappings":[{"column":{"index":0,"name":"id"},"property":"id"}],"destination_vertex_mappings":[{"column":{"index":1,"name":"id"},"property":"id"}],"column_mappings":[{"column":{"index":2,"name":"weight"},"property":"weight"}]},{"type_triplet":{"edge":"created","source_vertex":"person","destination_vertex":"software"},"inputs":["file:///path/to/created.csv"],"source_vertex_mappings":[{"column":{"index":0,"name":"id"},"property":"id"}],"destination_vertex_mappings":[{"column":{"index":1,"name":"id"},"property":"id"}],"column_mappings":[{"column":{"index":2,"name":"weight"},"property":"weight"}]}]}
-

500

- Server error - Error -
-
-
-
- Up -
delete /api/v1/graph/{graph_id}/datasource/edge/{type_name}
-
(unbindEdgeDatasource)
-
Unbind datas ource on an edge type
- -

Path parameters

-
-
graph_id (required)
- -
Path Parameter
type_name (required)
- -
Path Parameter
- - - - -

Query parameters

-
-
source_vertex_type (required)
- -
Query Parameter
destination_vertex_type (required)
- -
Query Parameter
- - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully unbind the data source - APIResponse -

500

- Server error - Error -
-
-
-
- Up -
delete /api/v1/graph/{graph_id}/datasource/vertex/{type_name}
-
(unbindVertexDatasource)
-
Unbind data source on a vertex type
- -

Path parameters

-
-
graph_id (required)
- -
Path Parameter
type_name (required)
- -
Path Parameter
- - - - - - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully unbind the data source - APIResponse -

500

- Server error - Error -
-
-

Deployment

-
-
- Up -
get /api/v1/deployment
-
(getDeploymentInfo)
-
Deployment information
- - - - - - - -

Return type

-
- RunningDeploymentInfo - -
- - - -

Example data

-
Content-Type: application/json
-
{
-  "creation_time" : "creation_time",
-  "instance_name" : "instance_name",
-  "engine" : "Hiactor",
-  "cluster_type" : "HOSTS",
-  "storage" : "MutableCSR",
-  "version" : "version",
-  "frontend" : "Cypher/Gremlin"
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully returned the deployment information - RunningDeploymentInfo -

Example data

-
Content-Type: application/json
-
{"cluster_type":"HOSTS","creation_time":"2024-01-01T00:00:00.000Z","instance_name":"demo","frontend":"Cypher/Gremlin","engine":"Hiactor","storage":"MutableCSR","version":"0.27.0"}
-

500

- Server error - Error -
-
-
-
- Up -
get /api/v1/deployment/log
-
(getDeploymentPodLog)
-
[Deprecated] Get kubernetes pod's log
- - - - - -

Query parameters

-
-
pod_name (required)
- -
Query Parameter
component (required)
- -
Query Parameter
from_cache (required)
- -
Query Parameter
- - -

Return type

-
- GetPodLogResponse - -
- - - -

Example data

-
Content-Type: application/json
-
{
-  "log" : ""
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully returned the pod's log - GetPodLogResponse -

Example data

-
Content-Type: application/json
-
{"container1":"line1\nline2\nline3","container2":"line1\nline2\nline3"}
-

500

- Server error - Error -
-
-
-
- Up -
get /api/v1/deployment/resource/usage
-
(getDeploymentResourceUsage)
-
[Deprecated] Get resource usage(cpu/memory) of cluster
- - - - - - - -

Return type

-
- GetResourceUsageResponse - -
- - - -

Example data

-
Content-Type: application/json
-
{
-  "memory_usage" : [ null, null ],
-  "cpu_usage" : [ {
-    "usage" : "usage",
-    "host" : "host",
-    "timestamp" : "timestamp"
-  }, {
-    "usage" : "usage",
-    "host" : "host",
-    "timestamp" : "timestamp"
-  } ]
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully returned the resource usage - GetResourceUsageResponse -

Example data

-
Content-Type: application/json
-
{"cpu_usage":[{"host":"dztest283-graphscope-store-store-0","timestamp":"2024/07/19 13:15:12","usage":52},{"host":"dztest283-graphscope-store-store-1","timestamp":"2024/07/19 13:16:12","usage":90}],"memory_usage":[{"host":"dztest283-graphscope-store-store-0","timestamp":"2024/07/19 13:15:12","usage":152},{"host":"dztest283-graphscope-store-store-1","timestamp":"2024/07/19 13:16:12","usage":290}]}
-

500

- Server error - Error -
-
-
-
- Up -
get /api/v1/deployment/status
-
(getDeploymentStatus)
-
Get deployment status of cluster
- - - - - - - -

Return type

-
- RunningDeploymentStatus - -
- - - -

Example data

-
Content-Type: application/json
-
{
-  "nodes" : [ {
-    "name" : "name",
-    "memory_usage" : 6.027456183070403,
-    "disk_usage" : 1.4658129805029452,
-    "cpu_usage" : 0.8008281904610115
-  }, {
-    "name" : "name",
-    "memory_usage" : 6.027456183070403,
-    "disk_usage" : 1.4658129805029452,
-    "cpu_usage" : 0.8008281904610115
-  } ],
-  "pods" : {
-    "key" : [ {
-      "creation_time" : "creation_time",
-      "image" : [ "image", "image" ],
-      "node" : "node",
-      "restart_count" : 5,
-      "name" : "name",
-      "memory_usage" : 2,
-      "cpu_usage" : 5,
-      "component_belong_to" : "component_belong_to",
-      "labels" : "",
-      "status" : "status",
-      "timestamp" : "timestamp"
-    }, {
-      "creation_time" : "creation_time",
-      "image" : [ "image", "image" ],
-      "node" : "node",
-      "restart_count" : 5,
-      "name" : "name",
-      "memory_usage" : 2,
-      "cpu_usage" : 5,
-      "component_belong_to" : "component_belong_to",
-      "labels" : "",
-      "status" : "status",
-      "timestamp" : "timestamp"
-    } ]
-  },
-  "cluster_type" : "HOSTS"
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully returned the deployment status - RunningDeploymentStatus -

Example data

-
Content-Type: application/json
-
{"cluster_type":"HOSTS","nodes":[{"name":"HOSTNAME-1","cpu_usage":83,"memory_usage":37.5,"disk_usage":97}],"pods":{"coordinator":[{"name":"dztest283-graphscope-store-coordinator-0","image":["graphscope-store:0.28.0"],"labels":{"app.kubernetes.io/version":"3.4.0"},"node":"i-uf6f9rdd1wh126dg2y1p","status":"Running","restart_count":0,"cpu_usage":2,"memory_usage":597,"timestamp":"2024/07/19 16:40:04","creation_time":"2024/07/03 11:08:57","component_belong_to":"coordinator"}],"store":[{"name":"dztest283-graphscope-store-store-0","image":["graphscope-store:0.28.0"],"labels":{"app.kubernetes.io/version":"3.4.0"},"node":"i-uf6f9rdd1wh126dg2y1p","status":"Running","restart_count":0,"cpu_usage":2,"memory_usage":597,"timestamp":"2024/07/19 16:40:04","creation_time":"2024/07/03 11:08:57","component_belong_to":"store"},{"name":"dztest283-graphscope-store-store-1","image":["graphscope-store:0.28.0"],"labels":{"app.kubernetes.io/version":"3.4.0"},"node":"i-uf6f9rdd1wh126dg2y1p","status":"Running","restart_count":0,"cpu_usage":2,"memory_usage":597,"timestamp":"2024/07/19 16:40:04","creation_time":"2024/07/03 11:08:57","component_belong_to":"store"}]}}
-

500

- Server error - Error -
-
-
-
- Up -
get /api/v1/deployment/storage/usage
-
(getStorageUsage)
-
[Deprecated] Get storage usage of Groot
- - - - - - - -

Return type

-
- GetStorageUsageResponse - -
- - - -

Example data

-
Content-Type: application/json
-
{
-  "storage_usage" : {
-    "key" : 0.8008281904610115
-  }
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully returned the resource usage - GetStorageUsageResponse -

Example data

-
Content-Type: application/json
-
{"dztest283-graphscope-store-store-0":72.2,"dztest283-graphscope-store-store-1":91.7}
-

500

- Server error - Error -
-
-

Graph

-
-
- Up -
post /api/v1/graph/{graph_id}/schema/edge
-
(createEdgeType)
-
Create a edge type
- -

Path parameters

-
-
graph_id (required)
- -
Path Parameter
- -

Consumes

- This API call consumes the following media types via the Content-Type request header: - - -

Request body

-
-
body CreateEdgeType (optional)
- -
Body Parameter
-
- - - - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successful created the edge type - APIResponse -

400

- Bad request - Error -

500

- Server error - Error -
-
-
-
- Up -
post /api/v1/graph
-
(createGraph)
-
Create a new graph
- - -

Consumes

- This API call consumes the following media types via the Content-Type request header: - - -

Request body

-
-
body CreateGraphRequest (required)
- -
Body Parameter
-
- - - - -

Return type

-
- CreateGraphResponse - -
- - - -

Example data

-
Content-Type: application/json
-
{
-  "graph_id" : "graph_id"
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- The graph was created - CreateGraphResponse -

400

- Bad request - Error -

500

- Server error - Error -
-
-
-
- Up -
post /api/v1/graph/{graph_id}/schema/vertex
-
(createVertexType)
-
Create a vertex type
- -

Path parameters

-
-
graph_id (required)
- -
Path Parameter
- -

Consumes

- This API call consumes the following media types via the Content-Type request header: - - -

Request body

-
-
body CreateVertexType (required)
- -
Body Parameter
-
- - - - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successful created a vertex type - APIResponse -

400

- Bad request - Error -

500

- Server error - Error -
-
-
-
- Up -
delete /api/v1/graph/{graph_id}/schema/edge/{type_name}
-
(deleteEdgeTypeByName)
-
Delete edge type by name
- -

Path parameters

-
-
graph_id (required)
- -
Path Parameter
type_name (required)
- -
Path Parameter
- - - - -

Query parameters

-
-
source_vertex_type (required)
- -
Query Parameter
destination_vertex_type (required)
- -
Query Parameter
- - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successful deleted the edge type - APIResponse -

500

- Server error - Error -
-
-
-
- Up -
delete /api/v1/graph/{graph_id}
-
(deleteGraphById)
-
Delete graph by ID
- -

Path parameters

-
-
graph_id (required)
- -
Path Parameter
- - - - - - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully deleted the graph - APIResponse -

500

- Server error - Error -
-
-
-
- Up -
delete /api/v1/graph/{graph_id}/schema/vertex/{type_name}
-
(deleteVertexTypeByName)
-
Delete vertex type by name
- -

Path parameters

-
-
graph_id (required)
- -
Path Parameter
type_name (required)
- -
Path Parameter
- - - - - - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successful deleted the vertex type - APIResponse -

500

- Server error - Error -
-
-
-
- Up -
get /api/v1/graph/{graph_id}
-
(getGraphById)
-
Get graph by ID
- -

Path parameters

-
-
graph_id (required)
- -
Path Parameter
- - - - - - -

Return type

-
- GetGraphResponse - -
- - - -

Example data

-
Content-Type: application/json
-
{
-  "creation_time" : "creation_time",
-  "schema" : {
-    "vertex_types" : [ "", "" ],
-    "edge_types" : [ "", "" ]
-  },
-  "stored_procedures" : [ "", "" ],
-  "name" : "name",
-  "description" : "description",
-  "schema_update_time" : "schema_update_time",
-  "id" : "id",
-  "store_type" : "mutable_csr",
-  "data_update_time" : "data_update_time"
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully returned the graph - GetGraphResponse -

Example data

-
Content-Type: application/json
-
{"id":"GRAPHID","name":"demo","creation_time":"2024-01-01 00:00:00","schema_update_time":"2024-01-02 00:00:00","data_update_time":"2024-01-03 00:00:00","stored_procedures":[{"id":"STORED-PROCEDURE-ID","name":"stored_procedure_name","type":"cypher","query":"MATCH(a) return COUNT(a);","library":"/path/to/library","params":[{"name":"param1","type":{"string":{}}}],"returns":[{"name":"return1","type":{"PrimitiveType":"DT_SIGNED_INT64"}}],"bound_graph":"demo","runnable":true}],"schema":{"vertex_types":[{"type_id":0,"type_name":"person","properties":[{"property_id":0,"property_name":"id","property_type":{"string":{}}},{"property_id":1,"property_name":"name","property_type":{"string":{}}}],"primary_keys":["id"]},{"type_id":1,"type_name":"software","properties":[{"property_id":0,"property_name":"id","property_type":{"string":{}}},{"property_id":1,"property_name":"name","property_type":{"string":{}}}],"primary_keys":["id"]}],"edge_types":[{"type_id":0,"type_name":"knows","vertex_type_pair_relations":[{"source_vertex":"person","destination_vertex":"person","relation":"MANY_TO_MANY","x_csr_params":{"edge_storage_strategy":"ONLY_IN"}}],"properties":[{"property_id":0,"property_name":"weight","property_type":{"primitive_type":"DT_DOUBLE"}}]},{"type_id":1,"type_name":"created","vertex_type_pair_relations":[{"source_vertex":"person","destination_vertex":"software","relation":"MANY_TO_MANY","x_csr_params":{"edge_storage_strategy":"ONLY_IN"}}],"properties":[{"property_id":0,"property_name":"weight","property_type":{"primitive_type":"DT_DOUBLE"}}]}]}}
-

500

- Server error - Error -
-
-
-
- Up -
get /api/v1/graph/{graph_id}/schema
-
(getSchemaById)
-
Get graph schema by ID
- -

Path parameters

-
-
graph_id (required)
- -
Path Parameter
- - - - - - -

Return type

-
- GetGraphSchemaResponse - -
- - - -

Example data

-
Content-Type: application/json
-
{
-  "vertex_types" : [ "", "" ],
-  "edge_types" : [ "", "" ]
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully returned the graph schema - GetGraphSchemaResponse -

Example data

-
Content-Type: application/json
-
{"vertex_types":[{"type_id":0,"type_name":"person","properties":[{"property_id":0,"property_name":"id","property_type":{"string":{}}},{"property_id":1,"property_name":"name","property_type":{"string":{}}}],"primary_keys":["id"]},{"type_id":1,"type_name":"software","properties":[{"property_id":0,"property_name":"id","property_type":{"string":{}}},{"property_id":1,"property_name":"name","property_type":{"string":{}}}],"primary_keys":["id"]}],"edge_types":[{"type_id":0,"type_name":"knows","vertex_type_pair_relations":[{"source_vertex":"person","destination_vertex":"person","relation":"MANY_TO_MANY","x_csr_params":{"edge_storage_strategy":"ONLY_IN"}}],"properties":[{"property_id":0,"property_name":"weight","property_type":{"primitive_type":"DT_DOUBLE"}}]},{"type_id":1,"type_name":"created","vertex_type_pair_relations":[{"source_vertex":"person","destination_vertex":"software","relation":"MANY_TO_MANY","x_csr_params":{"edge_storage_strategy":"ONLY_IN"}}],"properties":[{"property_id":0,"property_name":"weight","property_type":{"primitive_type":"DT_DOUBLE"}}]}]}
-

500

- Server error - Error -
-
-
-
- Up -
post /api/v1/graph/{graph_id}/schema
-
(importSchemaById)
-
Import graph schema
- -

Path parameters

-
-
graph_id (required)
- -
Path Parameter
- -

Consumes

- This API call consumes the following media types via the Content-Type request header: - - -

Request body

-
-
body CreateGraphSchemaRequest (required)
- -
Body Parameter
-
- - - - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successful imported the graph schema - APIResponse -

400

- Bad request - Error -

500

- Server error - Error -
-
-
-
- Up -
get /api/v1/graph
-
(listGraphs)
-
List all graphs
- - - - - - - -

Return type

-
- array[GetGraphResponse] - -
- - - -

Example data

-
Content-Type: application/json
-
[ {
-  "creation_time" : "creation_time",
-  "schema" : {
-    "vertex_types" : [ "", "" ],
-    "edge_types" : [ "", "" ]
-  },
-  "stored_procedures" : [ "", "" ],
-  "name" : "name",
-  "description" : "description",
-  "schema_update_time" : "schema_update_time",
-  "id" : "id",
-  "store_type" : "mutable_csr",
-  "data_update_time" : "data_update_time"
-}, {
-  "creation_time" : "creation_time",
-  "schema" : {
-    "vertex_types" : [ "", "" ],
-    "edge_types" : [ "", "" ]
-  },
-  "stored_procedures" : [ "", "" ],
-  "name" : "name",
-  "description" : "description",
-  "schema_update_time" : "schema_update_time",
-  "id" : "id",
-  "store_type" : "mutable_csr",
-  "data_update_time" : "data_update_time"
-} ]
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully returned all graphs - -

Example data

-
Content-Type: application/json
-
[{"id":"GRAPHID","name":"demo","creation_time":"2024-01-01 00:00:00","schema_update_time":"2024-01-02 00:00:00","data_update_time":"2024-01-03 00:00:00","stored_procedures":[{"id":"STORED-PROCEDURE-ID","name":"stored_procedure_name","type":"cypher","query":"MATCH(a) return COUNT(a);","library":"/path/to/library","params":[{"name":"param1","type":{"string":{}}}],"returns":[{"name":"return1","type":{"PrimitiveType":"DT_SIGNED_INT64"}}],"bound_graph":"demo","runnable":true}],"schema":{"vertex_types":[{"type_id":0,"type_name":"person","properties":[{"property_id":0,"property_name":"id","property_type":{"string":{}}},{"property_id":1,"property_name":"name","property_type":{"string":{}}}],"primary_keys":["id"]},{"type_id":1,"type_name":"software","properties":[{"property_id":0,"property_name":"id","property_type":{"string":{}}},{"property_id":1,"property_name":"name","property_type":{"string":{}}}],"primary_keys":["id"]}],"edge_types":[{"type_id":0,"type_name":"knows","vertex_type_pair_relations":[{"source_vertex":"person","destination_vertex":"person","relation":"MANY_TO_MANY","x_csr_params":{"edge_storage_strategy":"ONLY_IN"}}],"properties":[{"property_id":0,"property_name":"weight","property_type":{"primitive_type":"DT_DOUBLE"}}]},{"type_id":1,"type_name":"created","vertex_type_pair_relations":[{"source_vertex":"person","destination_vertex":"software","relation":"MANY_TO_MANY","x_csr_params":{"edge_storage_strategy":"ONLY_IN"}}],"properties":[{"property_id":0,"property_name":"weight","property_type":{"primitive_type":"DT_DOUBLE"}}]}]}}]
-

500

- Server error - Error -
-
-

Job

-
-
- Up -
delete /api/v1/job/{job_id}
-
(deleteJobById)
-
Delete job by ID
- -

Path parameters

-
-
job_id (required)
- -
Path Parameter
- - - - -

Query parameters

-
-
delete_scheduler (optional)
- -
Query Parameter
- - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfuly cancelled the job - APIResponse -

500

- Server error - Error -
-
-
-
- Up -
post /api/v1/graph/{graph_id}/dataloading/config
-
(getDataloadingJobConfig)
-
Post to get the data loading configuration for MapReduce Task
- -

Path parameters

-
-
graph_id (required)
- -
Path Parameter
- -

Consumes

- This API call consumes the following media types via the Content-Type request header: - - -

Request body

-
-
body DataloadingJobConfig (required)
- -
Body Parameter
-
- - - - -

Return type

-
- DataloadingMRJobConfig - -
- - - -

Example data

-
Content-Type: application/json
-
{
-  "config" : "config"
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully returned the job configuration for MapReduce Task - DataloadingMRJobConfig -

Example data

-
Content-Type: application/json
-
split.size=32
-separator=\\|
-graph.endpoint=11.11.11.11:55556
-project=graphscope
-

500

- Server error - Error -
-
-
-
- Up -
get /api/v1/job/{job_id}
-
(getJobById)
-
Get job status by ID
- -

Path parameters

-
-
job_id (required)
- -
Path Parameter
- - - - - - -

Return type

-
- JobStatus - -
- - - -

Example data

-
Content-Type: application/json
-
{
-  "start_time" : "start_time",
-  "log" : "log",
-  "end_time" : "end_time",
-  "id" : "id",
-  "detail" : "",
-  "type" : "type",
-  "status" : "RUNNING"
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully returned the job status - JobStatus -

500

- Server error - Error -
-
-
-
- Up -
get /api/v1/job
-
(listJobs)
-
List all jobs
- - - - - - - -

Return type

-
- array[JobStatus] - -
- - - -

Example data

-
Content-Type: application/json
-
[ {
-  "start_time" : "start_time",
-  "log" : "log",
-  "end_time" : "end_time",
-  "id" : "id",
-  "detail" : "",
-  "type" : "type",
-  "status" : "RUNNING"
-}, {
-  "start_time" : "start_time",
-  "log" : "log",
-  "end_time" : "end_time",
-  "id" : "id",
-  "detail" : "",
-  "type" : "type",
-  "status" : "RUNNING"
-} ]
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successful returned all the jobs - -

Example data

-
Content-Type: application/json
-
[{"id":"JOB-QWERTYUIOPASDFGH-1","type":"DATA IMPORT","status":"RUNNING","start_time":"2024-02-24T00:00:00.000Z","log":"logging...","detail":{"graph_id":"GRAPHID"}},{"id":"JOB-QWERTYUIOPASDFGH-2","type":"DATA IMPORT","status":"CANCELLED","start_time":"2024-02-24T00:00:00.000Z","log":"logging...","detail":{"graph_id":"GRAPHID"}},{"id":"JOB-QWERTYUIOPASDFGH-3","type":"DATA IMPORT","status":"SUCCESS","start_time":"2024-02-24T00:00:00.000Z","end_time":"2024-02-24T12:00:00.000Z","detail":{"graph_id":"GRAPHID"}},{"id":"JOB-QWERTYUIOPASDFGH-4","type":"DATA IMPORT","status":"FAILED","start_time":"2024-02-24T00:00:00.000Z","end_time":"2024-02-24T12:00:00.000Z","log":"logging...","detail":{"graph_id":"GRAPHID"}},{"id":"JOB-QWERTYUIOPASDFGH-5","type":"DATA IMPORT","status":"WAITING","detail":{"graph_id":"GRAPHID"}}]
-

500

- Server error - Error -
-
-
-
- Up -
post /api/v1/graph/{graph_id}/dataloading
-
(submitDataloadingJob)
-
Submit a dataloading job
- -

Path parameters

-
-
graph_id (required)
- -
Path Parameter
- -

Consumes

- This API call consumes the following media types via the Content-Type request header: - - -

Request body

-
-
body DataloadingJobConfig (required)
- -
Body Parameter
-
- - - - -

Return type

-
- CreateDataloadingJobResponse - -
- - - -

Example data

-
Content-Type: application/json
-
{
-  "job_id" : "job_id"
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully submitted the job - CreateDataloadingJobResponse -

400

- Bad request - Error -

500

- Server error - Error -
-
-

Service

-
-
- Up -
get /api/v1/graph/{graph_id}/service
-
(getServiceStatusById)
-
Get service status by graph ID
- -

Path parameters

-
-
graph_id (required)
- -
Path Parameter
- - - - - - -

Return type

-
- ServiceStatus - -
- - - -

Example data

-
Content-Type: application/json
-
{
-  "start_time" : "start_time",
-  "graph_id" : "graph_id",
-  "sdk_endpoints" : {
-    "gremlin" : "gremlin",
-    "cypher" : "cypher",
-    "hqps" : "hqps",
-    "grpc" : "grpc"
-  },
-  "status" : "Running"
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully returned the service status - ServiceStatus -

Example data

-
Content-Type: application/json
-
{"graph_id":"GRAPHID","status":"Running","sdk_endpoints":{"cypher":"neo4j://mock.api.cypher:7676","gremlin":"ws://mock.api.gremlin/gremlin","hqps":"http://mock.api.hqps:10000"},"start_time":"2024-01-01 00:00:00"}
-

500

- Server error - Error -
-
-
-
- Up -
get /api/v1/service
-
(listServiceStatus)
-
List all service status
- - - - - - - -

Return type

-
- array[ServiceStatus] - -
- - - -

Example data

-
Content-Type: application/json
-
[ {
-  "start_time" : "start_time",
-  "graph_id" : "graph_id",
-  "sdk_endpoints" : {
-    "gremlin" : "gremlin",
-    "cypher" : "cypher",
-    "hqps" : "hqps",
-    "grpc" : "grpc"
-  },
-  "status" : "Running"
-}, {
-  "start_time" : "start_time",
-  "graph_id" : "graph_id",
-  "sdk_endpoints" : {
-    "gremlin" : "gremlin",
-    "cypher" : "cypher",
-    "hqps" : "hqps",
-    "grpc" : "grpc"
-  },
-  "status" : "Running"
-} ]
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully returned all service status - -

Example data

-
Content-Type: application/json
-
[{"graph_id":"GRAPHID","status":"Running","sdk_endpoints":{"cypher":"neo4j://mock.api.cypher:7676","gremin":"ws://mock.api.gremlin/gremlin","hqps":"http://mock.api.hqps:10000"},"start_time":"2024-01-01 00:00:00"}]
-

500

- Server error - Error -
-
-
-
- Up -
post /api/v1/service/restart
-
(restartService)
-
Restart current service
- - - - - - - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully restarted the service - APIResponse -

500

- Server error - Error -
-
-
-
- Up -
post /api/v1/service/start
-
(startService)
-
Start service
- - -

Consumes

- This API call consumes the following media types via the Content-Type request header: - - -

Request body

-
-
body StartServiceRequest (optional)
- -
Body Parameter
-
- - - - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully started the service - APIResponse -

400

- Bad request - Error -

500

- Server error - Error -
-
-
-
- Up -
post /api/v1/service/stop
-
(stopService)
-
Stop current service
- - - - - - - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully stopped the service - APIResponse -

500

- Server error - Error -
-
-

StoredProcedure

-
-
- Up -
post /api/v1/graph/{graph_id}/storedproc
-
(createStoredProcedure)
-
Create a new stored procedure on a certain graph
- -

Path parameters

-
-
graph_id (required)
- -
Path Parameter
- -

Consumes

- This API call consumes the following media types via the Content-Type request header: - - -

Request body

-
-
body CreateStoredProcRequest (required)
- -
Body Parameter
-
- - - - -

Return type

-
- CreateStoredProcResponse - -
- - - -

Example data

-
Content-Type: application/json
-
{
-  "stored_procedure_id" : "stored_procedure_id"
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully created a stored procedure - CreateStoredProcResponse -

400

- Bad request - Error -

500

- Server error - Error -
-
-
-
- Up -
delete /api/v1/graph/{graph_id}/storedproc/{stored_procedure_id}
-
(deleteStoredProcedureById)
-
Delete a stored procedure by ID
- -

Path parameters

-
-
graph_id (required)
- -
Path Parameter
stored_procedure_id (required)
- -
Path Parameter
- - - - - - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully deleted the stored procedure - APIResponse -

500

- Server error - Error -
-
-
-
- Up -
get /api/v1/graph/{graph_id}/storedproc/{stored_procedure_id}
-
(getStoredProcedureById)
-
Get a stored procedure by ID
- -

Path parameters

-
-
graph_id (required)
- -
Path Parameter
stored_procedure_id (required)
- -
Path Parameter
- - - - - - -

Return type

-
- GetStoredProcResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully returned the stored procedure - GetStoredProcResponse -

Example data

-
Content-Type: application/json
-
{"id":"STORED-PROCEDURE-ID","name":"stored_procedure_name","type":"cypher","query":"MATCH(a) return COUNT(a);","library":"/path/to/library","params":[{"name":"param1","type":{"string":{}}}],"returns":[{"name":"return1","type":{"PrimitiveType":"DT_SIGNED_INT64"}}],"bound_graph":"demo","runnable":true}
-

500

- Server error - Error -
-
-
-
- Up -
get /api/v1/graph/{graph_id}/storedproc
-
(listStoredProcedures)
-
List all stored procedures on a certain graph
- -

Path parameters

-
-
graph_id (required)
- -
Path Parameter
- - - - - - -

Return type

-
- array[GetStoredProcResponse] - -
- - - -

Example data

-
Content-Type: application/json
-
[ "", "" ]
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successful operation - -

Example data

-
Content-Type: application/json
-
[{"id":"STORED-PROCEDUREID-1","name":"stored_procedure_name_1","type":"cypher","query":"MATCH(a) return COUNT(a);","library":"/path/to/library","params":[{"name":"param1","type":{"string":{}}}],"returns":[{"name":"return1","type":{"PrimitiveType":"DT_SIGNED_INT64"}}],"bound_graph":"demo","runnable":true},{"id":"STORED-PROCEDUREID-2","name":"stored_procedure_name_2","type":"cypher","query":"MATCH(a) return COUNT(a);","library":"/path/to/library","params":[{"name":"param1","type":{"string":{}}}],"returns":[{"name":"return1","type":{"PrimitiveType":"DT_SIGNED_INT64"}}],"bound_graph":"demo","runnable":false}]
-

400

- Bad request - Error -

500

- Server error - Error -
-
-
-
- Up -
put /api/v1/graph/{graph_id}/storedproc/{stored_procedure_id}
-
(updateStoredProcedureById)
-
Update a stored procedure by ID
- -

Path parameters

-
-
graph_id (required)
- -
Path Parameter
stored_procedure_id (required)
- -
Path Parameter
- -

Consumes

- This API call consumes the following media types via the Content-Type request header: - - -

Request body

-
-
body UpdateStoredProcRequest (optional)
- -
Body Parameter
-
- - - - -

Return type

-
- APIResponse - -
- - - -

Example data

-
Content-Type: application/json
-
""
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- Successfully updated the stored procedure - APIResponse -

500

- Server error - Error -
-
-

Utils

-
-
- Up -
post /api/v1/file/uploading
-
(uploadFile)
-
- - -

Consumes

- This API call consumes the following media types via the Content-Type request header: - - - - - -

Form parameters

-
-
filestorage (required)
- -
Form Parameter — format: binary
- -

Return type

-
- UploadFileResponse - -
- - - -

Example data

-
Content-Type: application/json
-
{
-  "file_path" : "file_path",
-  "metadata" : ""
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. - - -

Responses

-

200

- successful operation - UploadFileResponse -

Example data

-
Content-Type: application/json
-
{"file_path":"/home/graphscope/path/to/file.csv","metadata":{"datasource":"file","file_type":"csv"}}
-

500

- Server error - Error -
-
- -

Models

- [ Jump to Methods ] - -

Table of Contents

-
    -
  1. APIResponse
  2. -
  3. AnyValue
  4. -
  5. BaseEdgeType
  6. -
  7. BaseEdgeType_vertex_type_pair_relations
  8. -
  9. BaseEdgeType_x_csr_params
  10. -
  11. BasePropertyMeta
  12. -
  13. BaseVertexType
  14. -
  15. BaseVertexType_x_csr_params
  16. -
  17. ColumnMapping
  18. -
  19. ColumnMapping_column
  20. -
  21. CreateAlertReceiverRequest
  22. -
  23. CreateAlertRuleRequest
  24. -
  25. CreateDataloadingJobResponse
  26. -
  27. CreateEdgeType
  28. -
  29. CreateGraphRequest
  30. -
  31. CreateGraphResponse
  32. -
  33. CreateGraphSchemaRequest
  34. -
  35. CreatePropertyMeta
  36. -
  37. CreateStoredProcRequest
  38. -
  39. CreateStoredProcResponse
  40. -
  41. CreateVertexType
  42. -
  43. DataloadingJobConfig
  44. -
  45. DataloadingJobConfig_edges
  46. -
  47. DataloadingJobConfig_loading_config
  48. -
  49. DataloadingJobConfig_loading_config_format
  50. -
  51. DataloadingJobConfig_vertices
  52. -
  53. DataloadingMRJobConfig
  54. -
  55. DateType
  56. -
  57. EdgeMapping
  58. -
  59. EdgeMapping_type_triplet
  60. -
  61. Error
  62. -
  63. GSDataType
  64. -
  65. GetAlertMessageResponse
  66. -
  67. GetAlertReceiverResponse
  68. -
  69. GetAlertRuleResponse
  70. -
  71. GetEdgeType
  72. -
  73. GetGraphResponse
  74. -
  75. GetGraphSchemaResponse
  76. -
  77. GetPodLogResponse
  78. -
  79. GetPropertyMeta
  80. -
  81. GetResourceUsageResponse
  82. -
  83. GetStorageUsageResponse
  84. -
  85. GetStoredProcResponse
  86. -
  87. GetVertexType
  88. -
  89. JobStatus
  90. -
  91. LongText
  92. -
  93. NodeStatus
  94. -
  95. Parameter
  96. -
  97. PodStatus
  98. -
  99. PrimitiveType
  100. -
  101. ResourceUsage
  102. -
  103. RunningDeploymentInfo
  104. -
  105. RunningDeploymentStatus
  106. -
  107. SchemaMapping
  108. -
  109. ServiceStatus
  110. -
  111. ServiceStatus_sdk_endpoints
  112. -
  113. StartServiceRequest
  114. -
  115. StoredProcedureMeta
  116. -
  117. StringType
  118. -
  119. TemporalType
  120. -
  121. TimeStampType
  122. -
  123. UpdateAlertMessageStatusRequest
  124. -
  125. UpdateStoredProcRequest
  126. -
  127. UploadFileResponse
  128. -
  129. VertexMapping
  130. -
  131. file_uploading_body
  132. -
- -
-

APIResponse Up

- -
-
-
-
-

AnyValue Up

- -
-
-
-
-

BaseEdgeType Up

- -
-
type_name
-
vertex_type_pair_relations
-
directed (optional)
-
primary_keys (optional)
-
-
-
-

BaseEdgeType_vertex_type_pair_relations Up

- -
-
source_vertex
-
destination_vertex
-
relation (optional)
-
Enum:
-
MANY_TO_MANY
ONE_TO_MANY
MANY_TO_ONE
ONE_TO_ONE
-
x_csr_params (optional)
-
-
-
-

BaseEdgeType_x_csr_params Up

-
Used for storage optimization
-
-
edge_storage_strategy (optional)
-
Enum:
-
ONLY_IN
ONLY_OUT
BOTH_OUT_IN
-
-
-
-

BasePropertyMeta Up

- -
-
property_name
-
property_type
-
nullable (optional)
-
default_value (optional)
-
description (optional)
-
-
-
-

BaseVertexType Up

- -
-
type_name
-
primary_keys
-
x_csr_params (optional)
-
-
-
-

BaseVertexType_x_csr_params Up

-
Used for storage optimization
-
-
max_vertex_num (optional)
-
-
-
-

ColumnMapping Up

- -
-
column
-
property
String must align with the schema
-
-
-
-

ColumnMapping_column Up

- -
-
index (optional)
Integer format: int32
-
name (optional)
-
-
-
-

CreateAlertReceiverRequest Up

- -
-
type
-
Enum:
-
webhook
-
webhook_url
-
at_user_ids
-
is_at_all
-
enable
-
-
-
-

CreateAlertRuleRequest Up

- -
-
name
-
severity
-
Enum:
-
warning
emergency
-
metric_type
-
Enum:
-
node
service
-
conditions_description
-
frequency
Integer (mins)
-
enable
-
-
-
-

CreateDataloadingJobResponse Up

- -
-
job_id
-
-
-
-

CreateEdgeType Up

- -
-
properties (optional)
-
description (optional)
-
type_name
-
vertex_type_pair_relations
-
directed (optional)
-
primary_keys (optional)
-
-
-
-

CreateGraphRequest Up

- -
-
name (optional)
-
description (optional)
-
stored_procedures (optional)
-
schema (optional)
-
-
-
-

CreateGraphResponse Up

- -
-
graph_id
-
-
-
-

CreateGraphSchemaRequest Up

- -
-
vertex_types
-
edge_types
-
-
-
-

CreatePropertyMeta Up

- -
-
property_name
-
property_type
-
nullable (optional)
-
default_value (optional)
-
description (optional)
-
-
-
-

CreateStoredProcRequest Up

- -
-
name
-
description (optional)
-
type
-
Enum:
-
cpp
cypher
-
query
-
-
-
-

CreateStoredProcResponse Up

- -
-
stored_procedure_id
-
-
-
-

CreateVertexType Up

- -
-
properties
-
description (optional)
-
type_name
-
primary_keys
-
x_csr_params (optional)
-
-
-
-

DataloadingJobConfig Up

- -
-
loading_config
-
vertices
-
edges
-
schedule (optional)
String format with '2023-02-21 11:56:30'
-
repeat (optional)
-
Enum:
-
once
day
week
-
-
-
-

DataloadingJobConfig_edges Up

- -
-
type_name (optional)
-
source_vertex (optional)
-
destination_vertex (optional)
-
-
-
-

DataloadingJobConfig_loading_config Up

- -
-
import_option (optional)
-
Enum:
-
init
overwrite
-
example: overwrite
-
format (optional)
-
-
-
-

DataloadingJobConfig_loading_config_format Up

- -
-
type (optional)
-
metadata (optional)
-
-
-
-

DataloadingJobConfig_vertices Up

- -
-
type_name (optional)
-
-
-
-

DataloadingMRJobConfig Up

- -
-
config
-
-
-
-

DateType Up

- -
-
date32
-
-
-
-

EdgeMapping Up

- -
-
type_triplet
-
inputs
-
source_vertex_mappings (optional)
-
destination_vertex_mappings (optional)
-
column_mappings (optional)
-
-
-
-

EdgeMapping_type_triplet Up

-
source label -> [edge label] -> destination label
-
-
edge
-
source_vertex
-
destination_vertex
-
-
-
-

Error Up

- -
-
code
Integer Error code format: int32
-
message
String Error message
-
-
-
-

GSDataType Up

- -
-
-
-
-

GetAlertMessageResponse Up

- -
-
id
String Generated in server side
-
alert_name
-
severity
-
Enum:
-
warning
emergency
-
metric_type
-
Enum:
-
node
service
-
target
-
trigger_time
-
status
-
Enum:
-
unsolved
solved
dealing
-
message
-
-
-
-

GetAlertReceiverResponse Up

- -
-
id
-
message
String Error message generated in server side
-
type
-
Enum:
-
webhook
-
webhook_url
-
at_user_ids
-
is_at_all
-
enable
-
-
-
-

GetAlertRuleResponse Up

- -
-
id
-
name
-
severity
-
Enum:
-
warning
emergency
-
metric_type
-
Enum:
-
node
service
-
conditions_description
-
frequency
Integer (mins)
-
enable
-
-
-
-

GetEdgeType Up

- -
-
type_id (optional)
Integer format: int32
-
properties (optional)
-
description (optional)
-
type_name
-
vertex_type_pair_relations
-
directed (optional)
-
primary_keys (optional)
-
-
-
-

GetGraphResponse Up

- -
-
id
-
name
-
description (optional)
-
store_type (optional)
-
Enum:
-
mutable_csr
-
creation_time
-
data_update_time
-
schema_update_time
-
stored_procedures (optional)
-
schema
-
-
-
-

GetGraphSchemaResponse Up

- -
-
vertex_types
-
edge_types
-
-
-
-

GetPodLogResponse Up

- -
-
log
-
-
-
-

GetPropertyMeta Up

- -
-
property_id
Integer format: int32
-
property_name
-
property_type
-
nullable (optional)
-
default_value (optional)
-
description (optional)
-
-
-
-

GetResourceUsageResponse Up

- -
-
cpu_usage
-
memory_usage
-
-
-
-

GetStorageUsageResponse Up

- -
-
storage_usage
map[String, Double] format: double
-
-
-
-

GetStoredProcResponse Up

- -
-
bound_graph
-
runnable
-
id
-
library
-
params
-
returns
-
-
-
-

GetVertexType Up

- -
-
type_id (optional)
Integer format: int32
-
properties
-
description (optional)
-
type_name
-
primary_keys
-
x_csr_params (optional)
-
-
-
-

JobStatus Up

- -
-
id
-
type
-
status
-
Enum:
-
RUNNING
SUCCESS
FAILED
CANCELLED
WAITING
-
start_time (optional)
-
end_time (optional)
-
log (optional)
String logview URL or log string
-
detail (optional)
-
-
-
-

LongText Up

- -
-
long_text
-
-
-
-

NodeStatus Up

- -
-
name
-
cpu_usage
Double format: double
-
memory_usage
Double format: double
-
disk_usage
Double format: double
-
-
-
-

Parameter Up

- -
-
name
-
type
-
-
-
-

PodStatus Up

- -
-
name
-
image
-
labels
-
node
-
status
-
restart_count
Integer format: int32
-
cpu_usage
Integer format: int32
-
memory_usage
Integer format: int32
-
timestamp (optional)
-
creation_time
-
component_belong_to (optional)
-
-
-
-

PrimitiveType Up

- -
-
primitive_type
-
Enum:
-
DT_SIGNED_INT32
DT_UNSIGNED_INT32
DT_SIGNED_INT64
DT_UNSIGNED_INT64
DT_BOOL
DT_FLOAT
DT_DOUBLE
-
-
-
-

ResourceUsage Up

- -
-
host
-
timestamp
-
usage
-
-
-
-

RunningDeploymentInfo Up

- -
-
instance_name
-
cluster_type
-
Enum:
-
HOSTS
KUBERNETES
-
version
-
creation_time
-
frontend
-
Enum:
-
Cypher/Gremlin
AnalyticalApps
-
engine
-
Enum:
-
Hiactor
Gaia
-
storage
-
Enum:
-
MutableCSR
MutablePersistent
-
-
-
-

RunningDeploymentStatus Up

- -
-
cluster_type
-
Enum:
-
HOSTS
KUBERNETES
-
nodes (optional)
-
pods (optional)
-
-
-
-

SchemaMapping Up

- -
-
vertex_mappings
-
edge_mappings
-
-
-
-

ServiceStatus Up

- -
-
graph_id
-
status
-
Enum:
-
Running
Stopped
-
sdk_endpoints (optional)
-
start_time (optional)
-
-
-
-

ServiceStatus_sdk_endpoints Up

- -
-
cypher (optional)
-
gremlin (optional)
-
hqps (optional)
-
grpc (optional)
-
-
-
-

StartServiceRequest Up

- -
-
graph_id (optional)
-
-
-
-

StoredProcedureMeta Up

- -
-
id
-
library
-
params
-
returns
-
name
-
description (optional)
-
type
-
Enum:
-
cpp
cypher
-
query
-
-
-
-

StringType Up

- -
-
string
-
oneOf: - LongText    -
-
-
-
-

TemporalType Up

- -
-
temporal
-
oneOf: - TimeStampType    - DateType    -
-
-
-
-

TimeStampType Up

- -
-
timestamp
-
-
-
-

UpdateAlertMessageStatusRequest Up

- -
-
message_ids
-
status
-
Enum:
-
unsolved
solved
dealing
-
-
-
-

UpdateStoredProcRequest Up

- -
-
description
-
-
-
-

UploadFileResponse Up

- -
-
file_path
-
metadata
-
-
-
-

VertexMapping Up

- -
-
type_name
-
inputs
-
column_mappings (optional)
-
-
-
-

file_uploading_body Up

- -
-
filestorage (optional)
byte[] format: binary
-
-
- - diff --git a/docs/flex/coordinator.md b/docs/flex/coordinator.md index 0b47897a8eb5..1b882174c8af 100644 --- a/docs/flex/coordinator.md +++ b/docs/flex/coordinator.md @@ -1,11 +1,26 @@ # 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. +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 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. + +:::{figure-md} + +GraphScope Coordinator in Flex + +Flex Coordinator +::: + +Explore Coordinator with following documents: ```{toctree} arguments --- caption: maxdepth: 2 --- +coordinator/getting_started +coordinator/dev_guide coordinator/restful_api ``` diff --git a/docs/flex/coordinator/dev_guide.md b/docs/flex/coordinator/dev_guide.md new file mode 100644 index 000000000000..2c46d86bcd9e --- /dev/null +++ b/docs/flex/coordinator/dev_guide.md @@ -0,0 +1,12 @@ +# Development guide + +This document describes the organization of the source code for Coordinator and provides instructions on how to build Coordinator from source and run tests. + +```{toctree} arguments +--- +caption: +maxdepth: 2 +--- +development/dev_and_test +development/python/README +``` diff --git a/docs/flex/coordinator/development/dev_and_test.md b/docs/flex/coordinator/development/dev_and_test.md new file mode 100644 index 000000000000..88a0fbc26eb7 --- /dev/null +++ b/docs/flex/coordinator/development/dev_and_test.md @@ -0,0 +1,225 @@ +# Dev and Test + +This document describes the organization of the source code for `Coordinator` and provides instructions on how to build `Coordinator` from source and run tests. + +## Dev Environment + + To build Coordinator from source code, you need to prepare a development environment with many dependencies and build toolchains. You using the following ways to prepare the development environment: + +- Use our provided [dev container](https://code.visualstudio.com/docs/devcontainers/containers) +- Install all tools and dependencies on your local machine. + +We strongly recommend you to use the dev containers to develop and test. + +### Develop with dev containers + +We provided a docker image `registry.cn-hongkong.aliyuncs.com/graphscope/graphscope-dev:latest-${arch}` with all tools and dependencies included. + +```bash +# x86_64 +docker pull registry.cn-hongkong.aliyuncs.com/graphscope/graphscope-dev:latest-amd64 +# inside the container +cd GraphScope && make coordinator +``` + +See [doc](../../../development/dev_guide.md) for finding more detailed information on how to develop `Coordinator` from `vscode`. + +### Install deps on local + +To install all dependencies on your local, use the GraphScope command-line utility [gsctl](../../../utilities/gs.md) with the subcommand `install-deps` like this + +```bash +pip3 install gsctl +# install coordinator dependencies +# dev-learning is the minimal set of dependencies to build coordinator +gsctl install-deps dev-learning +# build +cd GraphScope && make coordinator +``` + +## Understanding the Codebase + +The `Coordinator` code is organized in the `coordinator/gscoordinator/flex` folder as follows: +- `controllers`: Controllers that maps incoming HTTP requests to corresponding API endpoints defined in the OpenAPI specification. +- `core`: Contains the core implementation coordinator + - `interactive`: Core implementation of interaction with Flex Interactive + - `insight`: Core implementation of interaction with Flex GraphScope Insight +- `models`: Data Structures generated by OpenApi +- `openapi`: OpenApi specification file + +## Testing with Interactive + +### Preparation + +Typically, as the middle layer for interaction between client and engine, we need to deploy and test the `Coordinator` with a specific instance under the FLEX architecture, such as [Interactive](../../interactive_intro.md). Please make sure the engine service is deployed in advance according to the corresponding development documentation. + +- [Development Guide for Flex Interactive](../../interactive/dev_guide.md) + +### Launching Coordinator + +```bash +# generate configuration file +cat > /tmp/config.yaml << EOF +coordinator: + http_port: 8080 + +launcher_type: hosts + +session: + instance_id: demo +EOF + +# start +export SOLUTION=INTERACTIVE +python3 -m gscoordinator --config-file /tmp/config.yaml +``` + +### Build gsctl + +This will install the gsctl package, thus make `gsctl` work. + +````{tip} +This package would also be installed in [editable mode](https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-e), which means any changed you made in local directory will take effect. +```` + +```shell +make gsctl +``` + +### Run Test Script + +Numerous test cases have been created for `Coordinator with Interactive`, which can be referenced in the GitHub workflow [flex-interactive.yaml](https://github.com/alibaba/GraphScope/blob/main/.github/workflows/flex-interactive.yml). + +```bash +# pip3 install pytest +# By default, it will connect to the coordinator service at 8080 port +cd GraphScope/python +python3 -m pytest -s -v ./graphscope/gsctl/tests/test_interactive.py +``` + +### Running tests manually via gsctl + +In most cases, you may want to test a specific API interface, such as data loading, or creating a storedProcedure. At this point you can use `gsctl` to connect to the coordinator. + +```bash +gsctl connect --coordinator-endpoint http://127.0.0.1:8080 +# change the port number if you have customized the coordinator port. +``` + +After connecting to the Coordinator Service, you can now view current service status. Always remember to `--help` on a command to get more information. + +```bash +gsctl ls -l +``` + +See [Restful API Doc](../restful_api.rst) for more detailed data structure information. +For all test commands and parameter explanation, please refer to [Custom Graph Data](../../interactive/custom_graph_data.md), here we just list some basic commands. + +#### Create a New Graph + +```bash +$ gsctl create graph -f ./modern_graph.yaml + +$ cat modern_graph.yaml +name: test_graph +description: "This is a test graph" +schema: + vertex_types: + - type_name: person + properties: + - property_name: id + property_type: + primitive_type: DT_SIGNED_INT64 + - property_name: name + property_type: + string: + long_text: "" + - property_name: age + property_type: + primitive_type: DT_SIGNED_INT32 + primary_keys: + - id + edge_types: + - type_name: knows + vertex_type_pair_relations: + - source_vertex: person + destination_vertex: person + relation: MANY_TO_MANY + properties: + - property_name: weight + property_type: + primitive_type: DT_DOUBLE +``` + +#### Import Graph Data + +To import your data, you need to first bind the data source and then submit a bulk loading job. + +```{note} +`@` means the file is a local file and need to be uploaded. +``` + +```bash +gsctl create datasource -f ./import.yaml -g + +# cat import.yaml +vertex_mappings: + - type_name: person + inputs: + - "@/path/to/person.csv" + column_mappings: + - column: + index: 0 + name: id + property: id + - column: + index: 1 + name: name + property: name + - column: + index: 2 + name: age + property: age +edge_mappings: + - type_triplet: + edge: knows + source_vertex: person + destination_vertex: person + inputs: + - "@/path/to/person_knows_person.csv" + source_vertex_mappings: + - column: + index: 0 + name: person.id + property: id + destination_vertex_mappings: + - column: + index: 1 + name: person.id + property: id + column_mappings: + - column: + index: 2 + name: weight + property: weight + +# create data loading job +gsctl create loaderjob -f ./job_config.yaml -g + +# cat job_config.yaml +loading_config: + import_option: overwrite + format: + type: csv + metadata: + delimiter: "|" + header_row: "true" + +vertices: + - type_name: person + +edges: + - type_name: knows + source_vertex: person + destination_vertex: person +``` diff --git a/docs/flex/coordinator/development/python/python_sdk.md b/docs/flex/coordinator/development/python/python_sdk.md new file mode 100644 index 000000000000..329ecf7e9fba --- /dev/null +++ b/docs/flex/coordinator/development/python/python_sdk.md @@ -0,0 +1,4 @@ +FLEX Coordinator Python SDK +--------------------------- + +Stub page for Coordinator Python SDK; actual source is generated from flex/openapi/openapi_coordinator.yaml. diff --git a/docs/flex/coordinator/getting_started.md b/docs/flex/coordinator/getting_started.md new file mode 100644 index 000000000000..e02eee360790 --- /dev/null +++ b/docs/flex/coordinator/getting_started.md @@ -0,0 +1,68 @@ +# Getting Started + +This guide will walk you through the process of setting up the coordinator, connecting to it via [gsctl](../../utilities/gs.md) and execuing your first command. + +## Preparation + +````{tip} +Command-Line Tool: GraphScope offers an command-line tool of `gsctl` to provide a set of functionalities to make it easy to use GraphScope, like managing and operating GraphScope Flex instance. For an in-depth guide on how to use this tool, please visit the [doc page](../../utilities/gs.md) of gsctl. +```` + +Typically, Coordinator is packaged with products under the GraphScope Flex architecture, such as [Interactive](../interactive_intro.md), thus make sure the specific product is installed before proceeding on. If not, please follow the code below to deploy the instance. + +```{note} +In local mode, GraphScope will map the host port to the docker container. Remember to use `gsctl instance deploy --help` to get more information. +If you encounter a port binding problem while deploying instance, please destroy the instance first and then redeploy it. +``` + +```bash +pip3 install gsctl +# Deploy the Interactive instance in local mode +gsctl instance deploy --type interactive +``` + +See [Installation Guide](../interactive/installation.md) for more detailed information on how to install and deploy Interactive. + +## Connect to Coordinator Service(Interactive) via gsctl + +You could connect the `coordinator service` via `gsctl`. + +```bash +gsctl connect --coordinator-endpoint http://127.0.0.1:8080 +# change the port number if you have customized the coordinator port. +``` + +## Check Service Status + +After connecting to the Coordinator Service, you can now view what we have initially for you. + +```bash +gsctl ls -l +``` + +Actually, a builtin graph is provided with name `gs_interactive_default_graph`. Now you can switch to the graph context: + +```bash +gsctl use GRAPH gs_interactive_default_graph +gsctl service status # show current service status +``` + +As seen from the output, the Interactive service is already running on the built-in graph. For more commands, please refer to the specific Flex product. + +## Close the connection + +If you want to disconnect to coordinator, just type + +```bash +gsctl close +``` + +## Destroy the Interactive Instance + +If you want to shutdown and uninstall the Interactive instance, + +```bash +gsctl instance destroy --type interactive +``` + +**This will remove all the graph and data for the Interactive instance.** diff --git a/docs/flex/coordinator/restful_api.rst b/docs/flex/coordinator/restful_api.rst index 9dbc31b3b882..12d596b598fa 100644 --- a/docs/flex/coordinator/restful_api.rst +++ b/docs/flex/coordinator/restful_api.rst @@ -1,6 +1,4 @@ Coordinator RESTFul API ----------------------- -.. raw:: html - -
+Stub page for the Interactive RESTful API docs; actual source is generated from flex/openapi/openapi_coordinator.yaml. diff --git a/docs/images/flex-coordinator.png b/docs/images/flex-coordinator.png new file mode 100644 index 000000000000..6be2df61e0a0 Binary files /dev/null and b/docs/images/flex-coordinator.png differ diff --git a/flex/interactive/generate_restful_api_doc.sh b/flex/openapi/generate_restful_api_doc.sh old mode 100644 new mode 100755 similarity index 52% rename from flex/interactive/generate_restful_api_doc.sh rename to flex/openapi/generate_restful_api_doc.sh index 155bdaea7fa5..27efc81ba280 --- a/flex/interactive/generate_restful_api_doc.sh +++ b/flex/openapi/generate_restful_api_doc.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2020 Alibaba Group Holding Limited. +# Copyright 2024 Alibaba Group Holding Limited. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,34 +16,32 @@ # This script is used to generate the Java SDK from the Flex Interactive API # It uses the Swagger Codegen tool to generate the SDK -CUR_DIR=$(cd $(dirname $0); pwd) -OPENAPI_SPEC_PATH="${CUR_DIR}/../openapi/openapi_interactive.yaml" -TMP_DIR=/tmp/interactive_api_doc/ -#find the generator binary +# find the generator binary GENERATOR_BIN=$(which openapi-generator-cli) if [ -z "$GENERATOR_BIN" ]; then + GENERATOR_BIN=$(which openapi-generator) + if [ -z "$GENERATOR_BIN" ]; then # try to find in ~/bin/openapitools/ GENERATOR_BIN=~/bin/openapitools/openapi-generator-cli if [ ! -f "$GENERATOR_BIN" ]; then echo "openapi-generator-cli not found, please install it first" exit 1 fi + fi fi function usage() { echo "Usage: $0 [options]" echo "Options:" echo " -h, --help Show this help message and exit" + echo " -c, --component Optional values: interactive, coordinator" + echo " -s, --style Optional values: html, html2" echo " -o, --output-path The output path for the generated resutful API documentation" } function do_gen() { - echo "Generating Interactive RESTful API documentation" - OUTPUT_PATH="$1" - echo "Output path: ${OUTPUT_PATH}" - - cmd="${GENERATOR_BIN} generate -i ${OPENAPI_SPEC_PATH} -g html2 -o ${TMP_DIR}" + cmd="${GENERATOR_BIN} generate -i ${OPENAPI_SPEC_PATH} -g ${STYLE} -o ${TMP_DIR}" echo "Running command: ${cmd}" eval $cmd @@ -52,27 +50,52 @@ function do_gen() { echo "Running cmd ${cmd}" eval $cmd - echo "Finish generating Interactive RESTful API documentation" + echo "Finish generating RESTful API doc, output path: ${OUTPUT_PATH}" } +readonly CUR_DIR=$(cd $(dirname $0); pwd) +readonly TMP_DIR="/tmp/openapi_api_doc" +COMPONENT="interactive" +STYLE="html2" +OUTPUT_PATH="/tmp/restful_api_doc.html" while [[ $# -gt 0 ]]; do - key="$1" - - case $key in - -h | --help) - usage - exit - ;; - -o | --output-path) - shift - do_gen "$@" - exit 0 - ;; - *) # unknown option - err "unknown option $1" - usage - exit 1 - ;; + case "$1" in + -h | --help) + usage + exit + ;; + -o | --output-path) + OUTPUT_PATH="$2" + shift 2 + ;; + -s | --style) + STYLE="$2" + shift 2 + ;; + -c | --component) + COMPONENT="$2" + shift 2 + ;; + *) # unknown option + err "unknown option $1" + usage + exit 1 + ;; esac -done \ No newline at end of file +done + + +if [[ "${COMPONENT}" == "interactive" ]]; then + OPENAPI_SPEC_PATH="${CUR_DIR}/openapi_interactive.yaml" +elif [[ "${COMPONENT}" == "coordinator" ]]; then + OPENAPI_SPEC_PATH="${CUR_DIR}/openapi_coordinator.yaml" +else + echo "unknown component: ${COMPONENT}" + usage + exit +fi + +echo "Generating restful api doc for ${COMPONENT} with ${STYLE} style." + +do_gen diff --git a/flex/openapi/openapi_coordinator.yaml b/flex/openapi/openapi_coordinator.yaml index 9cd3bf640b39..d6403e6decea 100644 --- a/flex/openapi/openapi_coordinator.yaml +++ b/flex/openapi/openapi_coordinator.yaml @@ -5,10 +5,6 @@ info: description: |- This is a specification for GraphScope FLEX HTTP service based on the OpenAPI 3.0 specification. You can find out more details about specification at [doc](https://swagger.io/specification/v3/). - - Some useful links: - - [GraphScope Repository](https://github.com/alibaba/GraphScope) - - [The Source API definition for GraphScope Interactive](https://github.com/GraphScope/portal/tree/main/httpservice) contact: name: GraphScope email: graphscope@alibaba-inc.com diff --git a/python/setup.py b/python/setup.py index 24c834f5fb63..77c9c128a59d 100644 --- a/python/setup.py +++ b/python/setup.py @@ -94,10 +94,10 @@ def run(self): class GenerateFlexSDK(Command): description = "generate flex client sdk from openapi specification file" - user_options = [] + user_options = [("with-doc", None, "Include documentation")] def initialize_options(self): - pass + self.with_doc = False def finalize_options(self): pass @@ -137,6 +137,20 @@ def run(self): subprocess.run( ["cp", "-r", os.path.join(tempdir, "graphscope", "flex", "rest"), targetdir] ) + if self.with_doc: + targetdir = os.path.join( + pkg_root, "..", "docs", "flex", "coordinator", "development", "python" + ) + subprocess.run( + [ + "sed", + "-i", + "s/# graphscope.flex.rest/# Coordinator Python SDK Reference/", + os.path.join(tempdir, "README.md"), + ] + ) + subprocess.run(["cp", os.path.join(tempdir, "README.md"), targetdir]) + subprocess.run(["cp", "-r", os.path.join(tempdir, "docs"), targetdir]) class FormatAndLint(Command):