forked from tigergraph/Restifier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.sh
93 lines (77 loc) · 3.24 KB
/
example.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
echo get user profile
curl --user tigergraph:tigergraph localhost:8080/api/user/profile
echo create user
curl --user tigergraph:tigergraph \
-H "content-type: application/json" \
-X POST localhost:8080/api/user/create \
--data '{"username": "test", "password": "test"}'
echo grant superuser
curl --user tigergraph:tigergraph \
-H "content-type: application/json" \
-X POST localhost:8080/api/user/grant \
--data '{"users": ["test"], "role": "superuser"}'
echo revoke superuser
curl --user tigergraph:tigergraph \
-H "content-type: application/json" \
-X POST localhost:8080/api/user/revoke \
--data '{"users": ["test"], "role": "superuser"}'
echo create vertex
curl --user tigergraph:tigergraph \
-H "content-type: application/json" \
-X POST localhost:8080/api/gsqlcmd \
--data '{"command": "CREATE VERTEX person (PRIMARY_ID name STRING, name STRING, age INT, gender STRING, state STRING)"}'
echo create edge
curl --user tigergraph:tigergraph \
-H "content-type: application/json" \
-X POST localhost:8080/api/gsqlcmd \
--data '{"command": "CREATE UNDIRECTED EDGE friendship (FROM person, TO person, connect_day DATETIME)"}'
echo create graph
curl --user tigergraph:tigergraph \
-H "content-type: application/json" \
-X POST localhost:8080/api/gsqlcmd \
--data '{"command": "CREATE GRAPH social (person, friendship)"}'
echo grant superuser
curl --user tigergraph:tigergraph \
-H "content-type: application/json" \
-X POST localhost:8080/api/user/grant \
--data '{"users": ["test"], "role": "queryreader", "graph": "social"}'
echo revoke superuser
curl --user tigergraph:tigergraph \
-H "content-type: application/json" \
-X POST localhost:8080/api/user/revoke \
--data '{"users": ["test"], "role": "queryreader", "graph": "social"}'
echo create query
curl --user tigergraph:tigergraph \
-H "content-type: application/json" \
-X POST localhost:8080/api/gsqlcmd \
--data '{"graph": "social", "command":"CREATE QUERY hello(VERTEX<person> p) FOR GRAPH social{\n Start = {p};\n Result = SELECT tgt\n FROM Start:s-(friendship:e) ->person:tgt;\n PRINT Result;\n}\n"}'
echo install query
curl --user tigergraph:tigergraph \
-H "content-type: application/json" \
-X POST localhost:8080/api/gsqlcmd \
--data '{"graph": "social", "command":"install query hello"}'
echo drop query
curl --user tigergraph:tigergraph \
-H "content-type: application/json" \
-X POST localhost:8080/api/gsqlcmd \
--data '{"graph": "social", "command":"drop query hello"}'
echo drop graph
curl --user tigergraph:tigergraph \
-H "content-type: application/json" \
-X POST localhost:8080/api/gsqlcmd \
--data '{"command": "drop GRAPH social"}'
echo drop edge
curl --user tigergraph:tigergraph \
-H "content-type: application/json" \
-X POST localhost:8080/api/gsqlcmd \
--data '{"command": "drop EDGE friendship"}'
echo drop vertex
curl --user tigergraph:tigergraph \
-H "content-type: application/json" \
-X POST localhost:8080/api/gsqlcmd \
--data '{"command": "drop VERTEX person"}'
echo drop user
curl --user tigergraph:tigergraph \
-H "content-type: application/json" \
-X POST localhost:8080/api/user/drop \
--data '{"username": "test"}'