keymaker 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +71 -11
- data/Rakefile +1 -1
- data/keymaker.gemspec +46 -15
- data/lib/keymaker.rb +25 -12
- data/lib/keymaker/configuration.rb +4 -0
- data/lib/keymaker/errors.rb +22 -0
- data/lib/keymaker/match_method.rb +24 -0
- data/lib/keymaker/request.rb +2 -1
- data/lib/keymaker/{add_node_to_index_request.rb → requests/add_node_to_index_request.rb} +0 -0
- data/lib/keymaker/requests/batch_get_nodes_request.rb +24 -0
- data/lib/keymaker/requests/batch_request.rb +18 -0
- data/lib/keymaker/{create_node_request.rb → requests/create_node_request.rb} +0 -0
- data/lib/keymaker/{create_relationship_request.rb → requests/create_relationship_request.rb} +0 -0
- data/lib/keymaker/requests/delete_node_request.rb +18 -0
- data/lib/keymaker/{delete_relationship_request.rb → requests/delete_relationship_request.rb} +0 -0
- data/lib/keymaker/{execute_cypher_request.rb → requests/execute_cypher_request.rb} +0 -0
- data/lib/keymaker/{execute_gremlin_request.rb → requests/execute_gremlin_request.rb} +0 -0
- data/lib/keymaker/requests/get_node_request.rb +16 -0
- data/lib/keymaker/requests/get_relationship_types_request.rb +18 -0
- data/lib/keymaker/{path_traverse_request.rb → requests/path_traverse_request.rb} +0 -0
- data/lib/keymaker/{remove_node_from_index_request.rb → requests/remove_node_from_index_request.rb} +0 -0
- data/lib/keymaker/requests/service_root_request.rb +11 -0
- data/lib/keymaker/{update_node_properties_request.rb → requests/update_node_properties_request.rb} +0 -0
- data/lib/keymaker/response.rb +8 -1
- data/lib/keymaker/service.rb +17 -43
- data/spec/cassettes/Keymaker_AddNodeToIndexRequest/returns_a_201_status_code.yml +204 -0
- data/spec/cassettes/Keymaker_AddNodeToIndexRequest/returns_application/json.yml +204 -0
- data/spec/cassettes/Keymaker_AddNodeToIndexRequest/returns_the_Neo4j_REST_API_starting_point_response_request.yml +204 -0
- data/spec/cassettes/Keymaker_BatchRequest/when_a_resource_is_not_found/raises_BatchRequestError.yml +120 -0
- data/spec/cassettes/Keymaker_BatchRequest/when_to_and_method_are_not_set/raises_BatchRequestError.yml +106 -0
- data/spec/cassettes/Keymaker_BatchRequest/with_valid_options/returns_a_200_status_code.yml +129 -0
- data/spec/cassettes/Keymaker_BatchRequest/with_valid_options/runs_the_commands_and_returns_their_respective_results.yml +129 -0
- data/spec/cassettes/Keymaker_GetNodeRequest/with_a_non-existent_node_id/raises_ResourceNotFound.yml +101 -0
- data/spec/cassettes/Keymaker_GetNodeRequest/with_an_empty_node_id/raises_ClientError.yml +111 -0
- data/spec/cassettes/Keymaker_GetRelationshipTypesRequest/with_existing_relationships/returns_a_unique_array_of_relationship_types.yml +220 -0
- data/spec/cassettes/Keymaker_ServiceRootRequest/returns_a_200_status_code.yml +105 -0
- data/spec/cassettes/Keymaker_ServiceRootRequest/returns_application/json.yml +105 -0
- data/spec/cassettes/Keymaker_ServiceRootRequest/returns_the_Neo4j_REST_API_starting_point_response_request.yml +105 -0
- data/spec/{keymaker/configuration_spec.rb → configuration_spec.rb} +0 -0
- data/spec/keymaker/requests/add_node_to_index_request_spec.rb +41 -0
- data/spec/keymaker/requests/batch_get_nodes_request_spec.rb +23 -0
- data/spec/keymaker/requests/batch_request_spec.rb +115 -0
- data/spec/keymaker/requests/delete_node_request_spec.rb +37 -0
- data/spec/keymaker/requests/get_node_request_spec.rb +24 -0
- data/spec/keymaker/requests/get_relationship_types_request_spec.rb +17 -0
- data/spec/keymaker/requests/service_root_request_spec.rb +35 -0
- data/spec/{keymaker/service_spec.rb → service_spec.rb} +0 -0
- data/spec/support/vcr.rb +8 -0
- metadata +116 -19
- data/lib/keymaker/batch_get_nodes_request.rb +0 -19
@@ -0,0 +1,16 @@
|
|
1
|
+
module Keymaker
|
2
|
+
class GetNodeRequest < Request
|
3
|
+
def submit
|
4
|
+
service.get(node_uri(opts[:node_id]), {}).on_error do |response|
|
5
|
+
case response.status
|
6
|
+
when 404
|
7
|
+
raise ResourceNotFound.new(response, response.body)
|
8
|
+
when (400..499)
|
9
|
+
raise ClientError.new(response, response.body)
|
10
|
+
when (500..599)
|
11
|
+
raise ServerError.new(response, response.body)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Keymaker
|
2
|
+
|
3
|
+
class GetRelationshipTypesRequest < Request
|
4
|
+
|
5
|
+
def submit
|
6
|
+
service.get(relationship_types_path, {}).on_error do |response|
|
7
|
+
case response.status
|
8
|
+
when (400..499)
|
9
|
+
raise ClientError.new(response, response.body)
|
10
|
+
when (500..599)
|
11
|
+
raise ServerError.new(response, response.body)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
File without changes
|
data/lib/keymaker/{remove_node_from_index_request.rb → requests/remove_node_from_index_request.rb}
RENAMED
File without changes
|
data/lib/keymaker/{update_node_properties_request.rb → requests/update_node_properties_request.rb}
RENAMED
File without changes
|
data/lib/keymaker/response.rb
CHANGED
data/lib/keymaker/service.rb
CHANGED
@@ -4,6 +4,8 @@ module Keymaker
|
|
4
4
|
|
5
5
|
class Service
|
6
6
|
|
7
|
+
extend MatchMethodMacros
|
8
|
+
|
7
9
|
attr_accessor :config
|
8
10
|
|
9
11
|
def initialize(config)
|
@@ -22,106 +24,78 @@ module Keymaker
|
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
27
|
+
# Raw requests to Neo4j REST API which live in lib/requests/*
|
28
|
+
match_method(/_request$/) do |name, *args|
|
29
|
+
"Keymaker::#{name.to_s.classify}".constantize.new(self, args.first).submit
|
30
|
+
end
|
31
|
+
|
32
|
+
def method_missing(name, *args)
|
33
|
+
# match_method uses modules, so we can use super to delegate to
|
34
|
+
# the generated #method_missing definitions.
|
35
|
+
super
|
36
|
+
end
|
37
|
+
|
38
|
+
## Nodes
|
25
39
|
# Create Node
|
26
40
|
def create_node(attrs)
|
41
|
+
# TODO: parse response into manageable Ruby objects
|
27
42
|
create_node_request(attrs)
|
28
43
|
end
|
29
44
|
|
30
|
-
def create_node_request(opts)
|
31
|
-
CreateNodeRequest.new(self, opts).submit
|
32
|
-
end
|
33
|
-
|
34
45
|
# Update Node properties
|
35
46
|
def update_node_properties(node_id, attrs)
|
36
47
|
update_node_properties_request({node_id: node_id}.merge(attrs))
|
37
48
|
end
|
38
49
|
|
39
|
-
def update_node_properties_request(opts)
|
40
|
-
UpdateNodePropertiesRequest.new(self, opts).submit
|
41
|
-
end
|
42
|
-
|
43
50
|
# Create Relationship
|
44
51
|
def create_relationship(rel_type, start_node_id, end_node_id, data={})
|
45
52
|
create_relationship_request({node_id: start_node_id, rel_type: rel_type, end_node_id: end_node_id, data: data})
|
46
53
|
end
|
47
54
|
|
48
|
-
def create_relationship_request(opts)
|
49
|
-
CreateRelationshipRequest.new(self, opts).submit
|
50
|
-
end
|
51
|
-
|
52
55
|
# Delete Relationship
|
53
56
|
def delete_relationship(relationship_id)
|
54
57
|
delete_relationship_request(relationship_id: relationship_id)
|
55
58
|
end
|
56
59
|
|
57
|
-
def delete_relationship_request(opts)
|
58
|
-
DeleteRelationshipRequest.new(self, opts).submit
|
59
|
-
end
|
60
|
-
|
61
60
|
# Add Node to Index
|
62
61
|
def add_node_to_index(index_name, key, value, node_id)
|
63
62
|
add_node_to_index_request(index_name: index_name, key: key, value: value, node_id: node_id)
|
64
63
|
end
|
65
64
|
|
66
|
-
def add_node_to_index_request(opts)
|
67
|
-
AddNodeToIndexRequest.new(self, opts).submit
|
68
|
-
end
|
69
|
-
|
70
65
|
# Remove Node from Index
|
71
66
|
def remove_node_from_index(index_name, key, value, node_id)
|
72
67
|
remove_node_from_index_request(index_name: index_name, key: key, value: value, node_id: node_id)
|
73
68
|
end
|
74
69
|
|
75
|
-
def remove_node_from_index_request(opts)
|
76
|
-
RemoveNodeFromIndexRequest.new(self, opts).submit
|
77
|
-
end
|
78
|
-
|
79
70
|
# Path Traverse
|
80
71
|
def path_traverse(start_node_id, data={})
|
81
72
|
path_traverse_request({node_id: start_node_id}.merge(data))
|
82
73
|
end
|
83
74
|
|
84
|
-
def path_traverse_request(opts)
|
85
|
-
PathTraverseRequest.new(self, opts).submit
|
86
|
-
end
|
87
|
-
|
88
75
|
# Batch
|
89
76
|
## GET Nodes
|
90
77
|
def batch_get_nodes(node_ids)
|
91
78
|
batch_get_nodes_request(node_ids)
|
92
79
|
end
|
93
80
|
|
94
|
-
def batch_get_nodes_request(opts)
|
95
|
-
BatchGetNodesRequest.new(self, opts).submit
|
96
|
-
end
|
97
|
-
|
98
81
|
# Cypher Query
|
99
82
|
def execute_query(query, params)
|
100
83
|
execute_cypher_request({query: query, params: params})
|
101
84
|
end
|
102
85
|
|
103
|
-
def execute_cypher_request(opts)
|
104
|
-
ExecuteCypherRequest.new(self, opts).submit
|
105
|
-
end
|
106
|
-
|
107
86
|
# Gremlin Script
|
108
87
|
def execute_script(script, params={})
|
109
88
|
execute_gremlin_request({script: script, params: params})
|
110
89
|
end
|
111
90
|
|
112
|
-
def execute_gremlin_request(opts)
|
113
|
-
ExecuteGremlinRequest.new(self, opts).submit
|
114
|
-
end
|
115
|
-
|
116
91
|
# HTTP Verbs
|
117
|
-
|
118
92
|
def get(url, body)
|
119
93
|
faraday_response = connection.get(parse_url(url), body)
|
120
94
|
Keymaker::Response.new(self, faraday_response)
|
121
95
|
end
|
122
96
|
|
123
|
-
def delete(url)
|
124
|
-
faraday_response = connection.delete(parse_url(url))
|
97
|
+
def delete(url, body={})
|
98
|
+
faraday_response = connection.delete(parse_url(url), body)
|
125
99
|
Keymaker::Response.new(self, faraday_response)
|
126
100
|
end
|
127
101
|
|
@@ -0,0 +1,204 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://localhost:7477/db/data/ext/GremlinPlugin/graphdb/execute_script
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ! '{"script":"g.clear();g.V()"}'
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message: !!null
|
16
|
+
headers:
|
17
|
+
content-length:
|
18
|
+
- '3'
|
19
|
+
content-encoding:
|
20
|
+
- UTF-8
|
21
|
+
content-type:
|
22
|
+
- application/json
|
23
|
+
access-control-allow-origin:
|
24
|
+
- ! '*'
|
25
|
+
connection:
|
26
|
+
- close
|
27
|
+
server:
|
28
|
+
- Jetty(6.1.25)
|
29
|
+
body:
|
30
|
+
encoding: US-ASCII
|
31
|
+
string: ! '[ ]'
|
32
|
+
http_version: !!null
|
33
|
+
recorded_at: Fri, 06 Jul 2012 02:25:17 GMT
|
34
|
+
- request:
|
35
|
+
method: delete
|
36
|
+
uri: http://localhost:7477/db/data/index/node/users
|
37
|
+
body:
|
38
|
+
encoding: US-ASCII
|
39
|
+
string: ''
|
40
|
+
headers: {}
|
41
|
+
response:
|
42
|
+
status:
|
43
|
+
code: 404
|
44
|
+
message: !!null
|
45
|
+
headers:
|
46
|
+
content-length:
|
47
|
+
- '470'
|
48
|
+
content-encoding:
|
49
|
+
- UTF-8
|
50
|
+
content-type:
|
51
|
+
- application/json
|
52
|
+
access-control-allow-origin:
|
53
|
+
- ! '*'
|
54
|
+
connection:
|
55
|
+
- close
|
56
|
+
server:
|
57
|
+
- Jetty(6.1.25)
|
58
|
+
body:
|
59
|
+
encoding: US-ASCII
|
60
|
+
string: ! "{\n \"message\" : \"No node index named 'users'.\",\n \"exception\"
|
61
|
+
: \"org.neo4j.graphdb.NotFoundException: No node index named 'users'.\",\n
|
62
|
+
\ \"stacktrace\" : [ \"org.neo4j.server.rest.web.DatabaseActions.removeNodeIndex(DatabaseActions.java:421)\",
|
63
|
+
\"org.neo4j.server.rest.web.RestfulGraphDatabase.deleteNodeIndex(RestfulGraphDatabase.java:729)\",
|
64
|
+
\"java.lang.reflect.Method.invoke(Method.java:597)\", \"org.neo4j.server.statistic.StatisticFilter.doFilter(StatisticFilter.java:62)\"
|
65
|
+
]\n}"
|
66
|
+
http_version: !!null
|
67
|
+
recorded_at: Fri, 06 Jul 2012 02:25:17 GMT
|
68
|
+
- request:
|
69
|
+
method: post
|
70
|
+
uri: http://localhost:7477/db/data/node
|
71
|
+
body:
|
72
|
+
encoding: UTF-8
|
73
|
+
string: ! '{"email":"john@resistance.net"}'
|
74
|
+
headers:
|
75
|
+
Content-Type:
|
76
|
+
- application/json
|
77
|
+
response:
|
78
|
+
status:
|
79
|
+
code: 201
|
80
|
+
message: !!null
|
81
|
+
headers:
|
82
|
+
content-length:
|
83
|
+
- '1150'
|
84
|
+
location:
|
85
|
+
- http://localhost:7477/db/data/node/1006
|
86
|
+
content-encoding:
|
87
|
+
- UTF-8
|
88
|
+
content-type:
|
89
|
+
- application/json
|
90
|
+
access-control-allow-origin:
|
91
|
+
- ! '*'
|
92
|
+
connection:
|
93
|
+
- close
|
94
|
+
server:
|
95
|
+
- Jetty(6.1.25)
|
96
|
+
body:
|
97
|
+
encoding: US-ASCII
|
98
|
+
string: ! "{\n \"outgoing_relationships\" : \"http://localhost:7477/db/data/node/1006/relationships/out\",\n
|
99
|
+
\ \"data\" : {\n \"email\" : \"john@resistance.net\"\n },\n \"traverse\"
|
100
|
+
: \"http://localhost:7477/db/data/node/1006/traverse/{returnType}\",\n \"all_typed_relationships\"
|
101
|
+
: \"http://localhost:7477/db/data/node/1006/relationships/all/{-list|&|types}\",\n
|
102
|
+
\ \"property\" : \"http://localhost:7477/db/data/node/1006/properties/{key}\",\n
|
103
|
+
\ \"self\" : \"http://localhost:7477/db/data/node/1006\",\n \"properties\"
|
104
|
+
: \"http://localhost:7477/db/data/node/1006/properties\",\n \"outgoing_typed_relationships\"
|
105
|
+
: \"http://localhost:7477/db/data/node/1006/relationships/out/{-list|&|types}\",\n
|
106
|
+
\ \"incoming_relationships\" : \"http://localhost:7477/db/data/node/1006/relationships/in\",\n
|
107
|
+
\ \"extensions\" : {\n },\n \"create_relationship\" : \"http://localhost:7477/db/data/node/1006/relationships\",\n
|
108
|
+
\ \"paged_traverse\" : \"http://localhost:7477/db/data/node/1006/paged/traverse/{returnType}{?pageSize,leaseTime}\",\n
|
109
|
+
\ \"all_relationships\" : \"http://localhost:7477/db/data/node/1006/relationships/all\",\n
|
110
|
+
\ \"incoming_typed_relationships\" : \"http://localhost:7477/db/data/node/1006/relationships/in/{-list|&|types}\"\n}"
|
111
|
+
http_version: !!null
|
112
|
+
recorded_at: Fri, 06 Jul 2012 02:25:17 GMT
|
113
|
+
- request:
|
114
|
+
method: post
|
115
|
+
uri: http://localhost:7477/db/data/node
|
116
|
+
body:
|
117
|
+
encoding: UTF-8
|
118
|
+
string: ! '{"email":"sarah@resistance.net"}'
|
119
|
+
headers:
|
120
|
+
Content-Type:
|
121
|
+
- application/json
|
122
|
+
response:
|
123
|
+
status:
|
124
|
+
code: 201
|
125
|
+
message: !!null
|
126
|
+
headers:
|
127
|
+
content-length:
|
128
|
+
- '1151'
|
129
|
+
location:
|
130
|
+
- http://localhost:7477/db/data/node/1007
|
131
|
+
content-encoding:
|
132
|
+
- UTF-8
|
133
|
+
content-type:
|
134
|
+
- application/json
|
135
|
+
access-control-allow-origin:
|
136
|
+
- ! '*'
|
137
|
+
connection:
|
138
|
+
- close
|
139
|
+
server:
|
140
|
+
- Jetty(6.1.25)
|
141
|
+
body:
|
142
|
+
encoding: US-ASCII
|
143
|
+
string: ! "{\n \"outgoing_relationships\" : \"http://localhost:7477/db/data/node/1007/relationships/out\",\n
|
144
|
+
\ \"data\" : {\n \"email\" : \"sarah@resistance.net\"\n },\n \"traverse\"
|
145
|
+
: \"http://localhost:7477/db/data/node/1007/traverse/{returnType}\",\n \"all_typed_relationships\"
|
146
|
+
: \"http://localhost:7477/db/data/node/1007/relationships/all/{-list|&|types}\",\n
|
147
|
+
\ \"property\" : \"http://localhost:7477/db/data/node/1007/properties/{key}\",\n
|
148
|
+
\ \"self\" : \"http://localhost:7477/db/data/node/1007\",\n \"properties\"
|
149
|
+
: \"http://localhost:7477/db/data/node/1007/properties\",\n \"outgoing_typed_relationships\"
|
150
|
+
: \"http://localhost:7477/db/data/node/1007/relationships/out/{-list|&|types}\",\n
|
151
|
+
\ \"incoming_relationships\" : \"http://localhost:7477/db/data/node/1007/relationships/in\",\n
|
152
|
+
\ \"extensions\" : {\n },\n \"create_relationship\" : \"http://localhost:7477/db/data/node/1007/relationships\",\n
|
153
|
+
\ \"paged_traverse\" : \"http://localhost:7477/db/data/node/1007/paged/traverse/{returnType}{?pageSize,leaseTime}\",\n
|
154
|
+
\ \"all_relationships\" : \"http://localhost:7477/db/data/node/1007/relationships/all\",\n
|
155
|
+
\ \"incoming_typed_relationships\" : \"http://localhost:7477/db/data/node/1007/relationships/in/{-list|&|types}\"\n}"
|
156
|
+
http_version: !!null
|
157
|
+
recorded_at: Fri, 06 Jul 2012 02:25:17 GMT
|
158
|
+
- request:
|
159
|
+
method: post
|
160
|
+
uri: http://localhost:7477/db/data/index/node/users
|
161
|
+
body:
|
162
|
+
encoding: UTF-8
|
163
|
+
string: ! '{"key":"email","value":"john@resistance.net","uri":"http://localhost:7477/db/data/node/1006"}'
|
164
|
+
headers:
|
165
|
+
Content-Type:
|
166
|
+
- application/json
|
167
|
+
response:
|
168
|
+
status:
|
169
|
+
code: 201
|
170
|
+
message: !!null
|
171
|
+
headers:
|
172
|
+
content-length:
|
173
|
+
- '1247'
|
174
|
+
location:
|
175
|
+
- http://localhost:7477/db/data/index/node/users/email/john%40resistance.net/1006
|
176
|
+
content-encoding:
|
177
|
+
- UTF-8
|
178
|
+
content-type:
|
179
|
+
- application/json
|
180
|
+
access-control-allow-origin:
|
181
|
+
- ! '*'
|
182
|
+
connection:
|
183
|
+
- close
|
184
|
+
server:
|
185
|
+
- Jetty(6.1.25)
|
186
|
+
body:
|
187
|
+
encoding: US-ASCII
|
188
|
+
string: ! "{\n \"indexed\" : \"http://localhost:7477/db/data/index/node/users/email/john%40resistance.net/1006\",\n
|
189
|
+
\ \"outgoing_relationships\" : \"http://localhost:7477/db/data/node/1006/relationships/out\",\n
|
190
|
+
\ \"data\" : {\n \"email\" : \"john@resistance.net\"\n },\n \"traverse\"
|
191
|
+
: \"http://localhost:7477/db/data/node/1006/traverse/{returnType}\",\n \"all_typed_relationships\"
|
192
|
+
: \"http://localhost:7477/db/data/node/1006/relationships/all/{-list|&|types}\",\n
|
193
|
+
\ \"property\" : \"http://localhost:7477/db/data/node/1006/properties/{key}\",\n
|
194
|
+
\ \"self\" : \"http://localhost:7477/db/data/node/1006\",\n \"properties\"
|
195
|
+
: \"http://localhost:7477/db/data/node/1006/properties\",\n \"outgoing_typed_relationships\"
|
196
|
+
: \"http://localhost:7477/db/data/node/1006/relationships/out/{-list|&|types}\",\n
|
197
|
+
\ \"incoming_relationships\" : \"http://localhost:7477/db/data/node/1006/relationships/in\",\n
|
198
|
+
\ \"extensions\" : {\n },\n \"create_relationship\" : \"http://localhost:7477/db/data/node/1006/relationships\",\n
|
199
|
+
\ \"paged_traverse\" : \"http://localhost:7477/db/data/node/1006/paged/traverse/{returnType}{?pageSize,leaseTime}\",\n
|
200
|
+
\ \"all_relationships\" : \"http://localhost:7477/db/data/node/1006/relationships/all\",\n
|
201
|
+
\ \"incoming_typed_relationships\" : \"http://localhost:7477/db/data/node/1006/relationships/in/{-list|&|types}\"\n}"
|
202
|
+
http_version: !!null
|
203
|
+
recorded_at: Fri, 06 Jul 2012 02:25:27 GMT
|
204
|
+
recorded_with: VCR 2.2.2
|
@@ -0,0 +1,204 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://localhost:7477/db/data/ext/GremlinPlugin/graphdb/execute_script
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ! '{"script":"g.clear();g.V()"}'
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message: !!null
|
16
|
+
headers:
|
17
|
+
content-length:
|
18
|
+
- '3'
|
19
|
+
content-encoding:
|
20
|
+
- UTF-8
|
21
|
+
content-type:
|
22
|
+
- application/json
|
23
|
+
access-control-allow-origin:
|
24
|
+
- ! '*'
|
25
|
+
connection:
|
26
|
+
- close
|
27
|
+
server:
|
28
|
+
- Jetty(6.1.25)
|
29
|
+
body:
|
30
|
+
encoding: US-ASCII
|
31
|
+
string: ! '[ ]'
|
32
|
+
http_version: !!null
|
33
|
+
recorded_at: Fri, 06 Jul 2012 02:25:34 GMT
|
34
|
+
- request:
|
35
|
+
method: delete
|
36
|
+
uri: http://localhost:7477/db/data/index/node/users
|
37
|
+
body:
|
38
|
+
encoding: US-ASCII
|
39
|
+
string: ''
|
40
|
+
headers: {}
|
41
|
+
response:
|
42
|
+
status:
|
43
|
+
code: 404
|
44
|
+
message: !!null
|
45
|
+
headers:
|
46
|
+
content-length:
|
47
|
+
- '470'
|
48
|
+
content-encoding:
|
49
|
+
- UTF-8
|
50
|
+
content-type:
|
51
|
+
- application/json
|
52
|
+
access-control-allow-origin:
|
53
|
+
- ! '*'
|
54
|
+
connection:
|
55
|
+
- close
|
56
|
+
server:
|
57
|
+
- Jetty(6.1.25)
|
58
|
+
body:
|
59
|
+
encoding: US-ASCII
|
60
|
+
string: ! "{\n \"message\" : \"No node index named 'users'.\",\n \"exception\"
|
61
|
+
: \"org.neo4j.graphdb.NotFoundException: No node index named 'users'.\",\n
|
62
|
+
\ \"stacktrace\" : [ \"org.neo4j.server.rest.web.DatabaseActions.removeNodeIndex(DatabaseActions.java:421)\",
|
63
|
+
\"org.neo4j.server.rest.web.RestfulGraphDatabase.deleteNodeIndex(RestfulGraphDatabase.java:729)\",
|
64
|
+
\"java.lang.reflect.Method.invoke(Method.java:597)\", \"org.neo4j.server.statistic.StatisticFilter.doFilter(StatisticFilter.java:62)\"
|
65
|
+
]\n}"
|
66
|
+
http_version: !!null
|
67
|
+
recorded_at: Fri, 06 Jul 2012 02:25:34 GMT
|
68
|
+
- request:
|
69
|
+
method: post
|
70
|
+
uri: http://localhost:7477/db/data/node
|
71
|
+
body:
|
72
|
+
encoding: UTF-8
|
73
|
+
string: ! '{"email":"john@resistance.net"}'
|
74
|
+
headers:
|
75
|
+
Content-Type:
|
76
|
+
- application/json
|
77
|
+
response:
|
78
|
+
status:
|
79
|
+
code: 201
|
80
|
+
message: !!null
|
81
|
+
headers:
|
82
|
+
content-length:
|
83
|
+
- '1150'
|
84
|
+
location:
|
85
|
+
- http://localhost:7477/db/data/node/1008
|
86
|
+
content-encoding:
|
87
|
+
- UTF-8
|
88
|
+
content-type:
|
89
|
+
- application/json
|
90
|
+
access-control-allow-origin:
|
91
|
+
- ! '*'
|
92
|
+
connection:
|
93
|
+
- close
|
94
|
+
server:
|
95
|
+
- Jetty(6.1.25)
|
96
|
+
body:
|
97
|
+
encoding: US-ASCII
|
98
|
+
string: ! "{\n \"outgoing_relationships\" : \"http://localhost:7477/db/data/node/1008/relationships/out\",\n
|
99
|
+
\ \"data\" : {\n \"email\" : \"john@resistance.net\"\n },\n \"traverse\"
|
100
|
+
: \"http://localhost:7477/db/data/node/1008/traverse/{returnType}\",\n \"all_typed_relationships\"
|
101
|
+
: \"http://localhost:7477/db/data/node/1008/relationships/all/{-list|&|types}\",\n
|
102
|
+
\ \"property\" : \"http://localhost:7477/db/data/node/1008/properties/{key}\",\n
|
103
|
+
\ \"self\" : \"http://localhost:7477/db/data/node/1008\",\n \"properties\"
|
104
|
+
: \"http://localhost:7477/db/data/node/1008/properties\",\n \"outgoing_typed_relationships\"
|
105
|
+
: \"http://localhost:7477/db/data/node/1008/relationships/out/{-list|&|types}\",\n
|
106
|
+
\ \"incoming_relationships\" : \"http://localhost:7477/db/data/node/1008/relationships/in\",\n
|
107
|
+
\ \"extensions\" : {\n },\n \"create_relationship\" : \"http://localhost:7477/db/data/node/1008/relationships\",\n
|
108
|
+
\ \"paged_traverse\" : \"http://localhost:7477/db/data/node/1008/paged/traverse/{returnType}{?pageSize,leaseTime}\",\n
|
109
|
+
\ \"all_relationships\" : \"http://localhost:7477/db/data/node/1008/relationships/all\",\n
|
110
|
+
\ \"incoming_typed_relationships\" : \"http://localhost:7477/db/data/node/1008/relationships/in/{-list|&|types}\"\n}"
|
111
|
+
http_version: !!null
|
112
|
+
recorded_at: Fri, 06 Jul 2012 02:25:34 GMT
|
113
|
+
- request:
|
114
|
+
method: post
|
115
|
+
uri: http://localhost:7477/db/data/node
|
116
|
+
body:
|
117
|
+
encoding: UTF-8
|
118
|
+
string: ! '{"email":"sarah@resistance.net"}'
|
119
|
+
headers:
|
120
|
+
Content-Type:
|
121
|
+
- application/json
|
122
|
+
response:
|
123
|
+
status:
|
124
|
+
code: 201
|
125
|
+
message: !!null
|
126
|
+
headers:
|
127
|
+
content-length:
|
128
|
+
- '1151'
|
129
|
+
location:
|
130
|
+
- http://localhost:7477/db/data/node/1009
|
131
|
+
content-encoding:
|
132
|
+
- UTF-8
|
133
|
+
content-type:
|
134
|
+
- application/json
|
135
|
+
access-control-allow-origin:
|
136
|
+
- ! '*'
|
137
|
+
connection:
|
138
|
+
- close
|
139
|
+
server:
|
140
|
+
- Jetty(6.1.25)
|
141
|
+
body:
|
142
|
+
encoding: US-ASCII
|
143
|
+
string: ! "{\n \"outgoing_relationships\" : \"http://localhost:7477/db/data/node/1009/relationships/out\",\n
|
144
|
+
\ \"data\" : {\n \"email\" : \"sarah@resistance.net\"\n },\n \"traverse\"
|
145
|
+
: \"http://localhost:7477/db/data/node/1009/traverse/{returnType}\",\n \"all_typed_relationships\"
|
146
|
+
: \"http://localhost:7477/db/data/node/1009/relationships/all/{-list|&|types}\",\n
|
147
|
+
\ \"property\" : \"http://localhost:7477/db/data/node/1009/properties/{key}\",\n
|
148
|
+
\ \"self\" : \"http://localhost:7477/db/data/node/1009\",\n \"properties\"
|
149
|
+
: \"http://localhost:7477/db/data/node/1009/properties\",\n \"outgoing_typed_relationships\"
|
150
|
+
: \"http://localhost:7477/db/data/node/1009/relationships/out/{-list|&|types}\",\n
|
151
|
+
\ \"incoming_relationships\" : \"http://localhost:7477/db/data/node/1009/relationships/in\",\n
|
152
|
+
\ \"extensions\" : {\n },\n \"create_relationship\" : \"http://localhost:7477/db/data/node/1009/relationships\",\n
|
153
|
+
\ \"paged_traverse\" : \"http://localhost:7477/db/data/node/1009/paged/traverse/{returnType}{?pageSize,leaseTime}\",\n
|
154
|
+
\ \"all_relationships\" : \"http://localhost:7477/db/data/node/1009/relationships/all\",\n
|
155
|
+
\ \"incoming_typed_relationships\" : \"http://localhost:7477/db/data/node/1009/relationships/in/{-list|&|types}\"\n}"
|
156
|
+
http_version: !!null
|
157
|
+
recorded_at: Fri, 06 Jul 2012 02:25:34 GMT
|
158
|
+
- request:
|
159
|
+
method: post
|
160
|
+
uri: http://localhost:7477/db/data/index/node/users
|
161
|
+
body:
|
162
|
+
encoding: UTF-8
|
163
|
+
string: ! '{"key":"email","value":"john@resistance.net","uri":"http://localhost:7477/db/data/node/1008"}'
|
164
|
+
headers:
|
165
|
+
Content-Type:
|
166
|
+
- application/json
|
167
|
+
response:
|
168
|
+
status:
|
169
|
+
code: 201
|
170
|
+
message: !!null
|
171
|
+
headers:
|
172
|
+
content-length:
|
173
|
+
- '1247'
|
174
|
+
location:
|
175
|
+
- http://localhost:7477/db/data/index/node/users/email/john%40resistance.net/1008
|
176
|
+
content-encoding:
|
177
|
+
- UTF-8
|
178
|
+
content-type:
|
179
|
+
- application/json
|
180
|
+
access-control-allow-origin:
|
181
|
+
- ! '*'
|
182
|
+
connection:
|
183
|
+
- close
|
184
|
+
server:
|
185
|
+
- Jetty(6.1.25)
|
186
|
+
body:
|
187
|
+
encoding: US-ASCII
|
188
|
+
string: ! "{\n \"indexed\" : \"http://localhost:7477/db/data/index/node/users/email/john%40resistance.net/1008\",\n
|
189
|
+
\ \"outgoing_relationships\" : \"http://localhost:7477/db/data/node/1008/relationships/out\",\n
|
190
|
+
\ \"data\" : {\n \"email\" : \"john@resistance.net\"\n },\n \"traverse\"
|
191
|
+
: \"http://localhost:7477/db/data/node/1008/traverse/{returnType}\",\n \"all_typed_relationships\"
|
192
|
+
: \"http://localhost:7477/db/data/node/1008/relationships/all/{-list|&|types}\",\n
|
193
|
+
\ \"property\" : \"http://localhost:7477/db/data/node/1008/properties/{key}\",\n
|
194
|
+
\ \"self\" : \"http://localhost:7477/db/data/node/1008\",\n \"properties\"
|
195
|
+
: \"http://localhost:7477/db/data/node/1008/properties\",\n \"outgoing_typed_relationships\"
|
196
|
+
: \"http://localhost:7477/db/data/node/1008/relationships/out/{-list|&|types}\",\n
|
197
|
+
\ \"incoming_relationships\" : \"http://localhost:7477/db/data/node/1008/relationships/in\",\n
|
198
|
+
\ \"extensions\" : {\n },\n \"create_relationship\" : \"http://localhost:7477/db/data/node/1008/relationships\",\n
|
199
|
+
\ \"paged_traverse\" : \"http://localhost:7477/db/data/node/1008/paged/traverse/{returnType}{?pageSize,leaseTime}\",\n
|
200
|
+
\ \"all_relationships\" : \"http://localhost:7477/db/data/node/1008/relationships/all\",\n
|
201
|
+
\ \"incoming_typed_relationships\" : \"http://localhost:7477/db/data/node/1008/relationships/in/{-list|&|types}\"\n}"
|
202
|
+
http_version: !!null
|
203
|
+
recorded_at: Fri, 06 Jul 2012 02:25:34 GMT
|
204
|
+
recorded_with: VCR 2.2.2
|