forked from gchq/gaffer-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd_elements
executable file
·65 lines (59 loc) · 1.27 KB
/
add_elements
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
#!/usr/bin/env python3
import requests
data = """
{
"class": "uk.gov.gchq.gaffer.operation.impl.add.AddElements",
"validate": true,
"skipInvalidElements": false,
"input": [
{
"class": "uk.gov.gchq.gaffer.data.element.Edge",
"properties": {
"count": 1
},
"group": "ipflow",
"source": "10.0.1.6",
"destination": "10.0.0.1",
"directed": true
},
{
"class": "uk.gov.gchq.gaffer.data.element.Edge",
"properties": {
"count": 1
},
"group": "ipflow",
"source": "10.0.1.6",
"destination": "10.2.91.12",
"directed": true
},
{
"class": "uk.gov.gchq.gaffer.data.element.Entity",
"properties": {
"count": 1
},
"group": "ip",
"vertex": "10.0.1.6"
},
{
"class": "uk.gov.gchq.gaffer.data.element.Entity",
"properties": {
"count": 1
},
"group": "ip",
"vertex": "10.0.0.1"
},
{
"class": "uk.gov.gchq.gaffer.data.element.Entity",
"properties": {
"count": 1
},
"group": "ip",
"vertex": "10.2.91.12"
}
]
}
"""
url = "http://localhost:8080/rest/v1/graph/doOperation/add/elements"
response = requests.put(url, data, headers={'content-type':'application/json'})
print("Status:",response.status_code)
print(response.text)