flex/openapi/openapi_interactive.yaml (2,550 lines of code) (raw):
openapi: 3.0.3
info:
description: |
This is the definition of GraphScope Interactive API, including
- AdminService API
- Vertex/Edge API
- QueryService
AdminService API (with tag AdminService) defines the API for GraphManagement, ProcedureManagement and Service Management.
Vertex/Edge API (with tag GraphService) defines the API for Vertex/Edge management, including creation/updating/delete/retrieve.
QueryService API (with tag QueryService) defines the API for procedure_call, Ahodc query.
version: "1.0.0"
title: GraphScope Interactive API v0.3
contact:
email: graphscope@alibaba-inc.com
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
externalDocs:
description: Find out More about GraphScope
url: http://graphscope.io
tags:
- name: AdminService/GraphManagement
description: GraphManagement
- name: AdminService/ProcedureManagement
description: ProcedureManagement
- name: AdminService/ServiceManagement
description: ServiceManagement
- name: GraphService/VertexManagement
description: VertexManagement
- name: GraphService/EdgeManagement
description: EdgeManagement
- name: QueryService
description: Graph query
- name: AdminService/ServiceRegistry
description: ServiceRegistry
paths:
/v1/graph:
post:
tags:
- AdminService/GraphManagement
description: Create a new graph
operationId: create_graph
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/CreateGraphRequest"
required: true
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/CreateGraphResponse"
"400":
description: BadRequest
content:
application/json:
schema:
type: string
"500":
description: Internal error
content:
application/json:
schema:
type: string
get:
tags:
- AdminService/GraphManagement
description: List all graphs
operationId: list_graphs
responses:
"200":
description: Successful operation
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/GetGraphResponse"
/v1/graph/{graph_id}:
get:
tags:
- AdminService/GraphManagement
description: Get a graph by name
operationId: get_graph
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
description: The id of graph to get
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/GetGraphResponse"
"404":
description: Not found
content:
application/json:
schema:
type: string
example: graph not exists
delete:
tags:
- AdminService/GraphManagement
description: Delete a graph by id
operationId: delete_graph
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
description: The id of graph to delete
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
example: "Successfully delete graph"
"404":
description: Not Found
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 4
message: "Graph not found"
"500":
description: Internal Error
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 103
message: "Internal error"
/v1/graph/{graph_id}/schema:
get:
tags:
- AdminService/GraphManagement
description: Get schema by graph id
operationId: get_schema
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
description: The id of graph to get schema
responses:
200:
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/GetGraphSchemaResponse"
500:
$ref: "#/components/responses/500"
/v1/graph/{graph_id}/schema/vertex:
post:
tags:
- AdminService/GraphManagement
description: Create a vertex type
operationId: create_vertex_type
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CreateVertexType"
responses:
"200":
description: Successfully created the vertex type
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
"400":
$ref: "#/components/responses/400"
"500":
$ref: "#/components/responses/500"
delete:
tags:
- AdminService/GraphManagement
description: Delete a vertex type by name
operationId: delete_vertex_type
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
- name: type_name
in: query
required: true
schema:
type: string
responses:
"200":
description: Successfully deleted the vertex type
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
"400":
$ref: "#/components/responses/400"
"500":
$ref: "#/components/responses/500"
put:
tags:
- AdminService/GraphManagement
description: Update a vertex type to add more properties
operationId: update_vertex_type
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CreateVertexType"
responses:
"200":
description: Successfully updated the vertex type
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
"400":
$ref: "#/components/responses/400"
"500":
$ref: "#/components/responses/500"
/v1/graph/{graph_id}/schema/edge:
post:
tags:
- AdminService/GraphManagement
description: Create a edge type
operationId: create_edge_type
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/CreateEdgeType"
responses:
"200":
description: Successful created the edge type
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
"400":
$ref: "#/components/responses/400"
"500":
$ref: "#/components/responses/500"
delete:
tags:
- AdminService/GraphManagement
description: Delete an edge type by name
operationId: delete_edge_type
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
- name: type_name
in: query
required: true
schema:
type: string
- name: source_vertex_type
in: query
required: true
schema:
type: string
- name: destination_vertex_type
in: query
required: true
schema:
type: string
responses:
"200":
description: Successfully deleted the edge type
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
"400":
$ref: "#/components/responses/400"
"500":
$ref: "#/components/responses/500"
put:
tags:
- AdminService/GraphManagement
description: Update an edge type to add more properties
operationId: update_edge_type
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CreateEdgeType"
responses:
200:
description: Successfully updated the edge type
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
400:
$ref: "#/components/responses/400"
500:
$ref: "#/components/responses/500"
/v1/graph/{graph_id}/snapshot/{snapshot_id}/status:
get:
tags:
- AdminService/GraphManagement
description: Get the status of a snapshot by id
operationId: get_snapshot_status
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
- name: snapshot_id
in: path
required: true
schema:
type: integer
responses:
"200":
description: the status of a snapshot_id
content:
application/json:
schema:
$ref: "#/components/schemas/SnapshotStatus"
"400":
$ref: "#/components/responses/400"
"500":
$ref: "#/components/responses/500"
/v1/graph/{graph_id}/statistics:
get:
tags:
- AdminService/GraphManagement
description: Get the statics info of a graph, including number of vertices for each label, number of edges for each label.
operationId: get_graph_statistic
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
description: The id of graph to get statistics
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/GetGraphStatisticsResponse"
"500":
description: Server Internal Error
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 103
message: "Internal error"
"404":
description: Not Found
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 4
message: "Graph not found"
"503":
description: Service Unavailable
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 15
message: "Service Unavailable"
/v1/graph/{graph_id}/dataloading:
post:
tags:
- AdminService/GraphManagement
description: Create a dataloading job
operationId: create_dataloading_job
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
description: The id of graph to do bulk loading.
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/SchemaMapping"
required: true
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/JobResponse"
/v1/job/{job_id}:
get:
tags:
- AdminService/JobManagement
operationId: get_job_by_id
parameters:
- name: job_id
in: path
required: true
schema:
type: string
description: The id of the job, returned from POST /v1/graph/{graph_id}/dataloading
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/JobStatus"
delete:
tags:
- AdminService/JobManagement
operationId: delete_job_by_id
parameters:
- name: job_id
in: path
required: true
schema:
type: string
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
example: "Successfully cancel job: 123"
/v1/job:
get:
tags:
- AdminService/JobManagement
operationId: list_jobs
responses:
"200":
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/JobStatus"
/v1/graph/{graph_id}/procedure:
post:
tags:
- AdminService/ProcedureManagement
description: Create a new procedure on a graph
operationId: create_procedure
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/CreateProcedureRequest"
required: true
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/CreateProcedureResponse"
"400":
description: Bad request
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 14
message: "Bad request"
"404":
description: not found
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 4
message: "Graph not found"
"500":
description: Internal Error
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 103
message: "Internal error"
get:
tags:
- AdminService/ProcedureManagement
description: List all procedures
operationId: list_procedures
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
responses:
"200":
description: Successful operation
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/GetProcedureResponse"
"404":
description: Not found
content:
application/json:
schema:
type: string
example: "Graph not found"
/v1/graph/{graph_id}/procedure/{procedure_id}:
get:
tags:
- AdminService/ProcedureManagement
description: Get a procedure by id
operationId: get_procedure
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
- name: procedure_id
in: path
required: true
schema:
type: string
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/GetProcedureResponse"
"404":
description: Not found
content:
application/json:
schema:
type: string
example: "Graph not found/procedure not found"
put:
tags:
- AdminService/ProcedureManagement
description: Update procedure on a graph by id
operationId: update_procedure
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
- name: procedure_id
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateProcedureRequest"
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
"400":
description: Bad request
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 14
message: "Bad request"
"404":
description: Not Found
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 4
message: "Graph not found/Procedure not found"
"500":
description: Internal error
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 103
message: "Internal error"
delete:
tags:
- AdminService/ProcedureManagement
description: Delete a procedure on a graph by id
operationId: delete_procedure
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
- name: procedure_id
in: path
required: true
schema:
type: string
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
"404":
description: Not Found
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 4
message: "Graph not found/Procedure not found"
/v1/service/start:
post:
tags:
- AdminService/ServiceManagement
description: Start service on a specified graph
operationId: start_service
requestBody:
description: Start service on a specified graph
content:
application/json:
schema:
$ref: "#/components/schemas/StartServiceRequest"
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
"500":
description: Internal Error
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 103
message: "Internal error"
/v1/service/stop:
post:
tags:
- AdminService/ServiceManagement
description: Stop current service
operationId: stop_service
requestBody:
description: Stop service on a specified graph
content:
application/json:
schema:
$ref: "#/components/schemas/StopServiceRequest"
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
/v1/service/restart:
post:
tags:
- AdminService/ServiceManagement
description: Start current service
operationId: restart_service
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
/v1/service/status:
get:
tags:
- AdminService/ServiceManagement
description: Get service status
operationId: get_service_status
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/ServiceStatus"
/v1/graph/{graph_id}/vertex:
get:
tags:
- GraphService/VertexManagement
summary: Get the vertex's properties with vertex primary key.
operationId: get_vertex
description: |
Get the properties for the specified vertex.
example:
```http
GET /endpoint?param1=value1¶m2=value2 HTTP/1.1
Host: example.com
```
parameters:
- name: graph_id
in: path
required: true
description: The id of the graph
schema:
type: string
- name: label
in: query
required: true
description: The label name of querying vertex.
schema:
type: string
- name: primary_key_value
in: query
required: true
description: The primary key value of querying vertex.
schema:
$ref: "#/components/schemas/AnyValue"
responses:
"200":
description: Found vertex
content:
application/json:
schema:
$ref: "#/components/schemas/VertexData"
example:
label: "person"
values:
- name: "id"
value: 1
- name: "age"
value: 23
- name: "name"
value: "amy"
"400":
description: Bad input parameter
"404":
description: Vertex not found or graph not found
"500":
description: Server internal error
post:
tags:
- GraphService/VertexManagement
summary: Add vertex (and edge) to the graph
operationId: add_vertex
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
description: |
Add the provided vertex (and edge) to the specified graph.
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/VertexEdgeRequest"
example:
vertex_request:
- label: "person"
primary_key_value: 2
properties:
age: 24
name: "Cindy"
edge_request:
- src_label: "person"
dst_label: "software"
edge_label: "created"
src_primary_key_values:
- name: "id"
value: 1
dst_primary_key_values:
- name: "id"
value: 3
properties:
- name: "weight"
value: 0.2
responses:
"200":
description: Successfully created vertex
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
example:
message: "Successfully created vertex"
"400":
description: Invalid input vertex
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 101
message: "Invalid input vertex schema"
"404":
description: Graph not found
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 4
message: "Graph not found"
"409":
description: Vertex already exists
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 102
message: "Vertex already exists"
"500":
description: Server internal error
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 103
message: "Internal error"
put:
tags:
- GraphService/VertexManagement
summary: Update vertex's property
operationId: update_vertex
description: |
Update the vertex with the provided properties to the specified graph.
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/VertexEdgeRequest"
example:
label: "person"
primary_key_value: 2
properties:
age: 24
name: "Cindy"
responses:
"200":
description: Successfully update vertex
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
example:
message: "Successfully updated vertex"
"400":
description: Invalid input parameters
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 101
message: "Invalid input vertex schema"
"404":
description: Vertex not exists
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 4
message: "Vertex not exists"
"500":
description: Server internal error
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 103
message: "Internal error"
delete:
tags:
- GraphService/VertexManagement
summary: Remove vertex from the graph
operationId: delete_vertex
description: |
Remove the vertex from the specified graph.
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
requestBody:
description: The label and primary key values of the vertex to be deleted.
required: true
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/DeleteVertexRequest"
responses:
"200":
description: Successfully delete vertex
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
example:
message: "Successfully delete vertex"
"400":
description: Invalid input vertex
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 101
message: "Invalid input vertex schema"
"404":
description: Vertex not exists or Graph not exits.
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 4
message: "Vertex not exists"
"500":
description: Server internal error
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 103
message: "Internal error"
/v1/graph/{graph_id}/edge:
get:
tags:
- GraphService/EdgeManagement
summary: Get the edge's properties with src and dst vertex primary keys.
operationId: get_edge
description: |
Get the properties for the specified vertex.
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
- name: edge_label
in: query
required: true
description: The label name of querying edge.
schema:
type: string
example: created
- name: src_label
in: query
required: true
description: The label name of src vertex.
schema:
type: string
example: person
- name: src_primary_key_value
in: query
required: true
description: The primary key value of src vertex.
schema:
$ref: "#/components/schemas/AnyValue"
example: 1
- name: dst_label
in: query
required: true
description: The label name of dst vertex.
schema:
type: string
example: software
- name: dst_primary_key_value
in: query
required: true
description: The value of dst vertex's primary key
schema:
$ref: "#/components/schemas/AnyValue"
example: 3
responses:
"200":
description: Found Edge
content:
application/json:
schema:
$ref: "#/components/schemas/EdgeData"
example:
src_label: "person"
dst_label: "software"
edge_label: "created"
src_pk_value: 1
dst_pk_value: 3
properties:
- name: "weight"
value: 0.2
"400":
description: Bad input parameter
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 101
message: "Invalid input edge schema"
"404":
description: Edge not found or Graph not found
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 4
message: "Edge not found"
"500":
description: Server internal error
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 103
message: "Internal error"
post:
tags:
- GraphService/EdgeManagement
summary: Add edge to the graph
operationId: add_edge
description: |
Add the edge to graph.
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
responses:
"200":
description: Successfully insert the edge
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
example:
message: "Successfully create edge"
"400":
description: Invalid input edge
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 101
message: "Invalid input edge schema"
"409":
description: edge already exists
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 102
message: "Edge already exists"
"500":
description: Server internal error
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 103
message: "Internal error"
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/EdgeRequest"
example:
- src_label: "person"
dst_label: "software"
edge_label: "created"
src_primary_key_values:
- name: "id"
value: 1
dst_primary_key_values:
- name: "id"
value: 3
properties:
- name: "weight"
value: 0.2
put:
tags:
- GraphService/EdgeManagement
summary: Update edge's property
operationId: update_edge
description: |
Update the edge on the running graph.
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/EdgeRequest"
example:
- src_label: "person"
dst_label: "software"
edge_label: "created"
src_primary_key_values:
- name: "id"
value: 1
dst_primary_key_values:
- name: "id"
value: 3
properties:
- name: "weight"
value: 0.2
responses:
"200":
description: Successfully update edge
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
example:
message: "Successfully update edge"
"400":
description: Invalid input parameters
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 101
message: "Invalid input edge schema"
"404":
description: Edge not exists
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 4
message: "Edge not exists"
"500":
description: Server internal error
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 103
message: "Internal error"
delete:
tags:
- GraphService/EdgeManagement
summary: Remove edge from the graph
operationId: delete_edge
description: |
Remove the edge from current graph.
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
requestBody:
description: The label and primary key values of the src and dst vertices, and the edge label.
required: true
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/DeleteEdgeRequest"
responses:
"200":
description: Successfully delete edge
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
example:
message: "Successfully delete edge"
"400":
description: Invalid input edge
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 101
message: "Invalid input edge schema"
"404":
description: Edge not exists or Graph not exits
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 4
message: "Edge not exists"
"500":
description: Server internal error
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 103
message: "Internal error"
/v1/graph/{graph_id}/query:
post:
tags:
- QueryService
summary: run queries on graph
operationId: call_proc
description: |
After the procedure is created, user can use this API to run the procedure.
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
requestBody:
content:
text/plain:
schema:
type: string
format: byte
responses:
"200":
description: Successfully runned.
content:
text/plain:
schema:
type: string
format: byte
"500":
description: Server internal error
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 103
message: "Internal error"
/v1/graph/current/query:
post:
tags:
- QueryService
summary: run queries on the running graph
operationId: call_proc_current
description: |
Submit a query to the running graph.
requestBody:
content:
text/plain:
schema:
type: string
format: byte
responses:
"200":
description: Successfully runned. Empty if failed?
content:
text/plain:
schema:
type: string
format: byte
"500":
description: Server internal error
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 103
message: "Internal error"
/v1/graph/current/adhoc_query:
post:
tags:
- QueryService
summary: Submit adhoc query to the Interactive Query Service.
operationId: run_adhoc_current
description: |
Submit a adhoc query to the running graph. The adhoc query should be represented by the physical plan:
https://github.com/alibaba/GraphScope/blob/main/interactive_engine/executor/ir/proto/physical.proto
requestBody:
content:
text/plain:
schema:
type: string
format: byte
responses:
"200":
description: Successfully runned. Empty if failed?
content:
text/plain:
schema:
type: string
format: byte
"500":
description: Server internal error
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 103
message: "Internal error"
/v1/graph/{graph_id}/adhoc_query:
post:
tags:
- QueryService
summary: Submit adhoc query to the Interactive Query Service.
operationId: run_adhoc
description: |
Submit a adhoc query to the running graph. The adhoc query should be represented by the physical plan:
https://github.com/alibaba/GraphScope/blob/main/interactive_engine/executor/ir/proto/physical.proto
parameters:
- name: graph_id
in: path
required: true
schema:
type: string
requestBody:
content:
text/plain:
schema:
type: string
format: byte
responses:
"200":
description: Successfully runned.
content:
text/plain:
schema:
type: string
format: byte
"500":
description: Server internal error
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 103
message: "Internal error"
/v1/file/upload:
post:
tags: [Utils]
operationId: uploadFile
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
filestorage:
type: string
format: binary
responses:
200:
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/UploadFileResponse"
example:
file_path: /home/graphscope/path/to/file.csv
# metadata:
# datasource: file
# file_type: csv
500:
description: Server Internal Error
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponseWithCode"
example:
code: 103
message: "Internal error"
/v1/service/registry:
get:
description: List all services registry
operationId: list_service_registry_info
responses:
"200":
content:
application/json:
schema:
items:
$ref: "#/components/schemas/GraphServiceRegistryRecord"
type: array
description: successful operation
"500":
content:
application/json:
schema:
example: Internal error
type: string
description: Internal error
tags:
- AdminService/ServiceRegistry
/v1/service/registry/{graph_id}/{service_name}:
get:
description: Get a service registry by graph_id and service_name
operationId: get_service_registry_info
parameters:
- explode: false
in: path
name: graph_id
required: true
schema:
type: string
style: simple
- explode: false
in: path
name: service_name
required: true
schema:
type: string
style: simple
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/GraphServiceRegistryRecord"
description: successful operation
"404":
content:
application/json:
schema:
example: Service not found
type: string
description: Not found
"500":
content:
application/json:
schema:
example: Internal error
type: string
description: Internal error
tags:
- AdminService/ServiceRegistry
/v1/service/ready:
get:
description: Check if the service is ready
operationId: check_service_ready
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
description: successful operation
tags:
- AdminService/ServiceManagement
components:
schemas:
########################### Definition for GSDataType ###########################
# Both Interactive and Coordinator use the same GSDataType definition, but we could
# not include from another yaml file, so we need to define it twice.
AnyValue: {}
TypedValue:
type: object
required:
- type
- value
properties:
type:
$ref: "#/components/schemas/GSDataType"
value:
$ref: "#/components/schemas/AnyValue"
PrimitiveType:
x-body-name: primitive_type
type: object
required:
- primitive_type
properties:
primitive_type:
type: string
enum:
[
DT_SIGNED_INT32,
DT_UNSIGNED_INT32,
DT_SIGNED_INT64,
DT_UNSIGNED_INT64,
DT_BOOL,
DT_FLOAT,
DT_DOUBLE,
DT_STRING,
]
# The DT_STRING is added for backward compatibility, it should be replaced by StringType
example: DT_SIGNED_INT32
LongText:
x-body-name: long_text
type: object
additionalProperties: false
required:
- long_text
properties:
long_text:
type: string
nullable: true
FixedChar:
x-body-name: fixed_char
type: object
additionalProperties: false
required:
- char
properties:
char:
type: object
required:
- fixed_length
properties:
fixed_length:
type: integer
VarChar:
x-body-name: var_char
type: object
additionalProperties: false
required:
- var_char
properties:
var_char:
type: object
required:
- max_length
properties:
max_length:
type: integer
StringType:
x-body-name: string_type
type: object
required:
- string
properties:
string:
oneOf:
- $ref: "#/components/schemas/LongText"
- $ref: "#/components/schemas/FixedChar"
- $ref: "#/components/schemas/VarChar"
TimeStampType:
x-body-name: time_stamp_type
type: object
required:
- timestamp
properties:
timestamp:
type: string
nullable: true
DateType:
x-body-name: date_type
type: object
required:
- date32
properties:
date32:
type: string
nullable: true
TemporalType:
x-body-name: temporal_type
type: object
required:
- temporal
properties:
temporal:
oneOf:
- $ref: "#/components/schemas/TimeStampType"
- $ref: "#/components/schemas/DateType"
GSDataType:
x-body-name: gs_data_type
oneOf:
- $ref: "#/components/schemas/PrimitiveType"
- $ref: "#/components/schemas/StringType"
- $ref: "#/components/schemas/TemporalType"
Property:
x-body-name: property
type: object
required:
- name
- value
properties:
name:
type: string
example: "id"
value:
$ref: "#/components/schemas/AnyValue"
# type: object
Parameter:
x-body-name: parameter
type: object
required:
- name
- type
properties:
name:
type: string
example: param1
type:
$ref: "#/components/schemas/GSDataType"
allow_cast:
type: boolean
example: true
VertexRequest:
x-body-name: vertex_request
type: object
required:
- label
- primary_key_values
- properties
properties:
label:
type: string
example: person
primary_key_values:
type: array
items:
$ref: "#/components/schemas/Property"
properties:
type: array
items:
$ref: "#/components/schemas/Property"
DeleteVertexRequest:
x-body-name: delete_vertex_request
type: object
properties:
label:
type: string
description: The label name of the vertex.
example: person
primary_key_values:
type: array
description: Primary key values for the vertex.
items:
$ref: "#/components/schemas/Property"
VertexData:
x-body-name: vertex_data
type: object
required:
- label
properties:
label:
type: string
example: person
values:
type: array
items:
$ref: "#/components/schemas/Property"
EdgeData:
x-body-name: edge_data
type: object
required:
- src_label
- dst_label
- edge_label
- src_primary_key_value
- dst_primary_key_value
- properties
properties:
src_label:
type: string
example: person
dst_label:
type: string
example: software
edge_label:
type: string
example: created
src_primary_key_value:
$ref: "#/components/schemas/AnyValue"
dst_primary_key_value:
$ref: "#/components/schemas/AnyValue"
properties:
type: array
items:
$ref: "#/components/schemas/Property"
EdgeRequest:
x-body-name: edge_request
type: object
required:
- src_label
- dst_label
- edge_label
- src_primary_key_values
- dst_primary_key_values
properties:
src_label:
type: string
example: person
dst_label:
type: string
example: software
edge_label:
type: string
example: created
src_primary_key_values:
type: array
items:
$ref: "#/components/schemas/Property"
dst_primary_key_values:
type: array
items:
$ref: "#/components/schemas/Property"
properties:
type: array
items:
$ref: "#/components/schemas/Property"
DeleteEdgeRequest:
x-body-name: delete_edge_request
type: object
properties:
edge_label:
type: string
description: The label name of the edge.
example: created
src_label:
type: string
description: The label name of the source vertex.
example: person
dst_label:
type: string
description: The label name of the destination vertex.
example: software
src_primary_key_values:
type: array
description: Primary key values for the source vertex.
items:
$ref: "#/components/schemas/Property"
dst_primary_key_values:
type: array
description: Primary key values for the destination vertex.
items:
$ref: "#/components/schemas/Property"
properties:
type: array
description: The properties of the edge. If the edge type has primary key, it should be included in the properties.
items:
$ref: "#/components/schemas/Property"
QueryRequest:
x-body-name: query_request
type: object
required:
- query_name
properties:
query_name:
type: string
example: ic1
arguments:
type: array
items:
$ref: "#/components/schemas/TypedValue"
CreateProcedureRequest:
x-body-name: create_procedure_request
type: object
required:
- name
- type
- query
properties:
name:
type: string
example: query1
description:
type: string
example: A sample stored procedure
type:
type: string
enum:
- cpp
- cypher
query:
type: string
example: "MATCH(a) return COUNT(a);"
CreateProcedureResponse:
type: object
x-body-name: create_procedure_response
required:
- procedure_id
properties:
procedure_id:
type: string
example: proc1
StoredProcedureMeta:
x-body-name: stored_procedure_meta
allOf:
- $ref: "#/components/schemas/CreateProcedureRequest"
- type: object
properties:
id:
type: string
example: The unique identifier of procedure, currently is same with name.
library:
type: string
example: /path/to/library
params:
type: array
items:
$ref: "#/components/schemas/Parameter"
returns:
type: array
items:
$ref: "#/components/schemas/Parameter"
enable:
type: boolean
example: true
option:
type: object
additionalProperties: true
GetProcedureResponse:
x-body-name: get_procedure_response
allOf:
- $ref: "#/components/schemas/StoredProcedureMeta"
- type: object
properties:
bound_graph:
type: string
runnable:
type: boolean
creation_time:
type: integer
update_time:
type: integer
UpdateProcedureRequest:
x-body-name: update_procedure_request
type: object
properties:
description:
type: string
example: A sample stored procedure
CreateGraphResponse:
x-body-name: create_graph_response
type: object
properties:
graph_id:
type: string
example: "1"
CreateGraphRequest:
x-body-name: create_graph_request
type: object
properties:
name:
type: string
example: modern_graph
description:
type: string
example: A default description
stored_procedures:
type: array
items:
$ref: "#/components/schemas/CreateProcedureRequest"
schema:
$ref: "#/components/schemas/CreateGraphSchemaRequest"
APIResponse:
x-body-name: api_response
type: string
example: "Response string"
APIResponseWithCode:
x-body-name: api_response_with_code
type: object
properties:
code:
type: integer
format: int32
message:
type: string
example:
code: 500
message: "Internal Error"
VertexStatistics:
x-body-name: vertex_statistics
type: object
properties:
type_id:
type: integer
type_name:
type: string
count:
type: integer
VertexTypePairStatistics:
type: object
x-body-name: vertex_type_pair_statistics
required:
- source_vertex
- destination_vertex
- count
properties:
source_vertex:
type: string
destination_vertex:
type: string
count:
type: integer
EdgeStatistics:
x-body-name: edge_statistics
type: object
properties:
type_id:
type: integer
type_name:
type: string
vertex_type_pair_statistics:
type: array
items:
$ref: "#/components/schemas/VertexTypePairStatistics"
GetGraphStatisticsResponse:
x-body-name: graph_statistics_response
type: object
required:
- total_vertex_count
- total_edge_count
properties:
total_vertex_count:
type: integer
total_edge_count:
type: integer
vertex_type_statistics:
type: array
items:
$ref: "#/components/schemas/VertexStatistics"
edge_type_statistics:
type: array
items:
$ref: "#/components/schemas/EdgeStatistics"
GetGraphResponse:
x-body-name: get_graph_response
type: object
properties:
version:
type: string
id:
type: string
name:
type: string
description:
type: string
store_type:
type: string
enum:
- mutable_csr
creation_time:
type: integer
example: 11223444
data_update_time:
type: integer
example: 11123445
stored_procedures:
type: array
items:
$ref: "#/components/schemas/GetProcedureResponse"
schema:
$ref: "#/components/schemas/GetGraphSchemaResponse"
data_import_config:
$ref: "#/components/schemas/SchemaMapping"
remote_path:
type: string
example: /path/to/remote # If remote_path is specified, we could download the data from remote path.
CreateGraphSchemaRequest:
x-body-name: create_graph_schema_request
type: object
properties:
vertex_types:
type: array
items:
$ref: "#/components/schemas/CreateVertexType"
edge_types:
type: array
items:
$ref: "#/components/schemas/CreateEdgeType"
GetGraphSchemaResponse:
x-body-name: get_graph_schema_response
type: object
properties:
vertex_types:
type: array
items:
$ref: "#/components/schemas/GetVertexType"
edge_types:
type: array
items:
$ref: "#/components/schemas/GetEdgeType"
BaseVertexType:
type: object
properties:
type_name:
type: string
primary_keys:
type: array
items:
type: string
x_csr_params:
type: object
description: Used for storage optimization
properties:
max_vertex_num:
type: integer
CreateVertexType:
x-body-name: create_vertex_type
allOf:
- $ref: "#/components/schemas/BaseVertexType"
- type: object
properties:
properties:
type: array
items:
$ref: "#/components/schemas/CreatePropertyMeta"
GetVertexType:
x-body-name: get_vertex_type
allOf:
- $ref: "#/components/schemas/BaseVertexType"
- type: object
properties:
type_id:
type: integer
format: int32
properties:
type: array
items:
$ref: "#/components/schemas/GetPropertyMeta"
description:
type: string
BaseEdgeType:
type: object
properties:
type_name:
type: string
primary_keys:
type: array
description: The primary keys of the edge type, which is optional.
items:
type: string
vertex_type_pair_relations:
type: array
items:
type: object
properties:
source_vertex:
type: string
destination_vertex:
type: string
relation:
type: string
enum:
- MANY_TO_MANY
- ONE_TO_MANY
- MANY_TO_ONE
- ONE_TO_ONE
x_csr_params:
type: object
description: Used for storage optimization
properties:
edge_storage_strategy:
type: string
enum:
- ONLY_IN
- ONLY_OUT
- BOTH_OUT_IN
sort_on_compaction:
type: boolean
oe_mutability:
type: string
ie_mutability:
type: string
CreateEdgeType:
x-body-name: create_edge_type
allOf:
- $ref: "#/components/schemas/BaseEdgeType"
- type: object
properties:
properties:
type: array
items:
$ref: "#/components/schemas/CreatePropertyMeta"
GetEdgeType:
x-body-name: get_edge_type
allOf:
- $ref: "#/components/schemas/BaseEdgeType"
- type: object
properties:
type_id:
type: integer
format: int32
description:
type: string
properties:
type: array
items:
$ref: "#/components/schemas/GetPropertyMeta"
BasePropertyMeta:
type: object
properties:
property_name:
type: string
property_type:
$ref: "#/components/schemas/GSDataType"
CreatePropertyMeta:
x-body-name: create_property_meta
allOf:
- $ref: "#/components/schemas/BasePropertyMeta"
GetPropertyMeta:
x-body-name: get_property_meta
allOf:
- $ref: "#/components/schemas/BasePropertyMeta"
- type: object
properties:
property_id:
type: integer
format: int32
SchemaMapping:
x-body-name: schema_mapping
type: object
properties:
loading_config:
type: object
properties:
x_csr_params:
type: object
description: mutable_csr specific parameters
properties:
parallelism: # how many thread used for bulk loading
type: integer
build_csr_in_mem: # whether to build csr in memory
type: boolean
use_mmap_vector: # whether to use mmap vector
type: boolean
data_source:
type: object
properties:
scheme:
type: string
enum:
- odps
- file
location:
type: string
import_option:
type: string
enum:
- init
- overwrite
format:
type: object
properties:
type:
type: string
metadata:
type: object
additionalProperties: true
destination:
type: string # oss path or local path
vertex_mappings:
type: array
items:
$ref: "#/components/schemas/VertexMapping"
edge_mappings:
type: array
items:
$ref: "#/components/schemas/EdgeMapping"
VertexMapping:
x-body-name: vertex_mapping
type: object
properties:
type_name:
type: string
inputs:
type: array
items:
type: string
example: file:///path/to/person.csv
column_mappings:
type: array
items:
$ref: "#/components/schemas/ColumnMapping"
EdgeMapping:
x-body-name: edge_mapping
type: object
properties:
type_triplet:
type: object
description: source label -> [edge label] -> destination label
properties:
edge:
type: string
source_vertex:
type: string
destination_vertex:
type: string
inputs:
type: array
items:
type: string
source_vertex_mappings:
type: array
items:
type: object
description: Mapping column to the primary key of source vertex
properties:
column:
type: object
properties:
index:
type: integer
format: int32
name:
type: string
property:
type: string # the primary key's name to map
example: id
destination_vertex_mappings:
type: array
items:
type: object
description: Mapping column to the primary key of destination vertex
properties:
column:
type: object
properties:
index:
type: integer
format: int32
name:
type: string
property:
type: string
example: id
column_mappings:
type: array
items:
$ref: "#/components/schemas/ColumnMapping"
ColumnMapping:
x-body-name: column_mapping
type: object
properties:
column:
type: object
properties:
index:
type: integer
format: int32
name:
type: string
property:
type: string
description: must align with the schema
StartServiceRequest:
x-body-name: start_service_request
properties:
graph_id:
type: string
StopServiceRequest:
x-body-name: stop_service_request
properties:
graph_id:
type: string
nullable: true
additionalProperties: false
ServiceStatus:
x-body-name: service_status
type: object
properties:
deploy_mode:
type: string
enum:
- standalone
- k8s # when the deploy_mode is k8s, bolt_port, hqps_port and gremlin_port will not be available
statistics_enabled: # indicate whether the graph statistics interface is enabled
type: boolean
status:
type: string
graph:
$ref: "#/components/schemas/GetGraphResponse"
bolt_port:
type: integer
format: int32
hqps_port:
type: integer
format: int32
gremlin_port:
type: integer
format: int32
start_time:
type: integer
format: int32
JobResponse:
type: object
x-body-name: job_response
properties:
job_id:
type: string
JobStatus:
type: object
x-body-name: job_status
properties:
id:
type: string
type:
type: string
status:
type: string
enum:
- RUNNING
- SUCCESS
- FAILED
- CANCELLED
- WAITING
start_time:
type: integer
format: int32
end_time:
type: integer
format: int32
log:
type: string
description: URL or log string
detail:
type: object
additionalProperties: true
UploadFileResponse:
required:
- file_path
# - metadata
properties:
file_path:
type: string
metadata:
type: object
additionalProperties: true
VertexEdgeRequest:
type: object
required:
- vertex_request
properties:
vertex_request:
type: array
items:
$ref: "#/components/schemas/VertexRequest"
edge_request:
type: array
items:
$ref: "#/components/schemas/EdgeRequest"
SnapshotStatus:
type: object
required:
- snapshot_id
- status
properties:
snapshot_id:
type: integer
status:
type: string
example: "AVAILABLE"
ServiceMetrics:
example:
snapshot_id: "1"
properties:
snapshot_id:
example: "1"
title: snapshot_id
type: string
title: ServiceMetrics
type: object
RegistryInstanceRecord:
example:
endpoint: ip:port
metrics:
snapshot_id: "1"
properties:
endpoint:
example: ip:port
title: endpoint
type: string
metrics:
$ref: "#/components/schemas/ServiceMetrics"
title: RegistryInstanceRecord
type: object
ServiceRegistryRecord:
example:
instances:
endpoint: ip:port
metrics:
snapshot_id: "1"
service_name: graphscope
primary:
endpoint: ip:port
metrics:
snapshot_id: "1"
properties:
service_name:
example: graphscope
title: service_name
type: string
instances:
type: array
items:
$ref: "#/components/schemas/RegistryInstanceRecord"
primary:
$ref: "#/components/schemas/RegistryInstanceRecord"
title: ServiceRegistryRecord
type: object
GraphServiceRegistryRecord:
example:
graph_id: "1"
service_registry:
instances:
- endpoint: ip:port
metrics:
snapshot_id: "1"
- endpoint: ip:port
metrics:
snapshot_id: "1"
service_name: graphscope
primary:
endpoint: ip:port
metrics:
snapshot_id: "1"
properties:
graph_id:
example: "1"
title: graph_id
type: string
service_registry:
$ref: "#/components/schemas/ServiceRegistryRecord"
title: GraphServiceRegistryRecord
type: object
responses:
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
description: Bad request
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
description: Not found
"500":
content:
application/json:
schema:
$ref: "#/components/schemas/APIResponse"
description: Server error