gshttpservice


Namegshttpservice JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/GraphScope/gshttpservice
SummaryHttp server wrapper for standalone GraphScope
upload_time2023-09-01 04:48:20
maintainer
docs_urlNone
authorGraphScope team of Damo Academy
requires_python
licenseApache License 2.0
keywords graphscope graph computations
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Install
-------------

```shell
$ python3 setup.py bdist_wheel
$ cd dist && pip3 install ./*.whl
```

# Launch http service
--------------------------------

```shell
$ python3 -m gshttpservice 9527
```

# API
## Create instance
---------------------------
**POST   /api/graphservice/createInstance**
```
> body
> {
>    "num_workers": 2,
>    "vineyard_shared_mem": "4Gi"
> }
```
**See more  parameter details from [Doc](https://graphscope.io/docs/reference/session.html)**

## Get instance
------------------------
**GET  /api/graphservice/getInstance**


## Load data
-------------------
**POST  /api/graphservice/loadData**

```
> body
> {
>    "type": "LOCAL",
>    "directed": true,
>    "oid_type": "string",
>    "instance_id": "<graphscope instance id>",
>    "dataSource": {
>        "nodes": [
>            {
>                "label": "v",
>                "location": "",
>                "config": {
>                    "header_row": true,
>                    "delimiter": ","
>                }
>            }
>        ],
>        "edges": [
>            {
>                "label": "e",
>                "location": "",
>                "srcLabel": "v",
>                "dstLabel": "v",
>                "config": {
>                    "header_row": true,
>                    "delimiter": ","
>                }
>            }
>        ]
>    }
>}
```

## Get graph schema
--------------------------------
**GET  /api/graphservice/graphSchema**

```
> params
> {
>     "graph_name": ""
> }
```


## Gremlin query
--------------------------
**GET  /api/graphservice/query/gremlin**


```
> params
> {
>    "graph_name": <graph for gremlin query>,
>    "gremlinSQL": "g.V('1')"
> }
```

## Close instance
----------------
**GET /api/graphservice/closeInstance**

```
> params
> {
>     "instance_id": <graphscope instance to close>,
> }
```

## Upload file
-------------
**POST /api/graphservice/uploadFile**

```
> header
> {
>   Content-Type: multipart/form-data
> }
>
> body
> {
>   file=@file_path,
>   instance_id="instance_id"
> }

> example
> curl -i -X POST -H "Content-Type: multipart/form-data" -F "file=@file1" -F "file=@file2" -F "instance_id=xxx" -w %{http_code} http://localhost:9527/api/graphservice/uploadFile
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/GraphScope/gshttpservice",
    "name": "gshttpservice",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "GraphScope,Graph Computations",
    "author": "GraphScope team of Damo Academy",
    "author_email": "graphscope@alibaba-inc.com",
    "download_url": "",
    "platform": null,
    "description": "# Install\n-------------\n\n```shell\n$ python3 setup.py bdist_wheel\n$ cd dist && pip3 install ./*.whl\n```\n\n# Launch http service\n--------------------------------\n\n```shell\n$ python3 -m gshttpservice 9527\n```\n\n# API\n## Create instance\n---------------------------\n**POST   /api/graphservice/createInstance**\n```\n> body\n> {\n>    \"num_workers\": 2,\n>    \"vineyard_shared_mem\": \"4Gi\"\n> }\n```\n**See more  parameter details from [Doc](https://graphscope.io/docs/reference/session.html)**\n\n## Get instance\n------------------------\n**GET  /api/graphservice/getInstance**\n\n\n## Load data\n-------------------\n**POST  /api/graphservice/loadData**\n\n```\n> body\n> {\n>    \"type\": \"LOCAL\",\n>    \"directed\": true,\n>    \"oid_type\": \"string\",\n>    \"instance_id\": \"<graphscope instance id>\",\n>    \"dataSource\": {\n>        \"nodes\": [\n>            {\n>                \"label\": \"v\",\n>                \"location\": \"\",\n>                \"config\": {\n>                    \"header_row\": true,\n>                    \"delimiter\": \",\"\n>                }\n>            }\n>        ],\n>        \"edges\": [\n>            {\n>                \"label\": \"e\",\n>                \"location\": \"\",\n>                \"srcLabel\": \"v\",\n>                \"dstLabel\": \"v\",\n>                \"config\": {\n>                    \"header_row\": true,\n>                    \"delimiter\": \",\"\n>                }\n>            }\n>        ]\n>    }\n>}\n```\n\n## Get graph schema\n--------------------------------\n**GET  /api/graphservice/graphSchema**\n\n```\n> params\n> {\n>     \"graph_name\": \"\"\n> }\n```\n\n\n## Gremlin query\n--------------------------\n**GET  /api/graphservice/query/gremlin**\n\n\n```\n> params\n> {\n>    \"graph_name\": <graph for gremlin query>,\n>    \"gremlinSQL\": \"g.V('1')\"\n> }\n```\n\n## Close instance\n----------------\n**GET /api/graphservice/closeInstance**\n\n```\n> params\n> {\n>     \"instance_id\": <graphscope instance to close>,\n> }\n```\n\n## Upload file\n-------------\n**POST /api/graphservice/uploadFile**\n\n```\n> header\n> {\n>   Content-Type: multipart/form-data\n> }\n>\n> body\n> {\n>   file=@file_path,\n>   instance_id=\"instance_id\"\n> }\n\n> example\n> curl -i -X POST -H \"Content-Type: multipart/form-data\" -F \"file=@file1\" -F \"file=@file2\" -F \"instance_id=xxx\" -w %{http_code} http://localhost:9527/api/graphservice/uploadFile\n```\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Http server wrapper for standalone GraphScope",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/GraphScope/gshttpservice"
    },
    "split_keywords": [
        "graphscope",
        "graph computations"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "461d2f23b427e21989c47a05b1e79d5a907ae2e50c7c3d2aac2458b3b983f2a8",
                "md5": "f87fc8a13419734fe4e3f7c62618ce62",
                "sha256": "5a97eceb23eeebb9d4af10c18fd8f2cb0d2faec21c4e605baa98408864743de5"
            },
            "downloads": -1,
            "filename": "gshttpservice-0.1.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f87fc8a13419734fe4e3f7c62618ce62",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 12969,
            "upload_time": "2023-09-01T04:48:20",
            "upload_time_iso_8601": "2023-09-01T04:48:20.010899Z",
            "url": "https://files.pythonhosted.org/packages/46/1d/2f23b427e21989c47a05b1e79d5a907ae2e50c7c3d2aac2458b3b983f2a8/gshttpservice-0.1.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-01 04:48:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "GraphScope",
    "github_project": "gshttpservice",
    "github_not_found": true,
    "lcname": "gshttpservice"
}
        
Elapsed time: 1.08269s