summary refs log tree commit diff
path: root/lib/Net/Neo4j.pm
blob: b615e0976b5ba02ef679142247f5bec3530489fd (plain) (blame)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
package Net::Neo4j;

use MooseX::Net::API;

net_api_declare neo4j => (
    api_format      => 'json',
    api_format_mode => 'content-type',
);

net_api_method root => (
    method   => 'GET',
    path     => '/',
    expected => [qw/200/],
);

net_api_method add_node => (
    method   => 'POST',
    path     => '/node',
    strict   => 0,
    expected => [qw/201/],
);

net_api_method node => (
    method   => 'GET',
    path     => '/node/:id',
    params   => [qw/id/],
    required => [qw/id/],
    expected => [qw/200 404/],
);

net_api_method set_node_properties => (
    method   => 'PUT',
    path     => '/node/:id/properties',
    strict   => 0,
    params   => [qw/id/],
    required => [qw/id/],
    expected => [qw/204 400 404/],
);

net_api_method node_properties => (
    method   => 'GET',
    path     => '/node/:id/properties',
    params   => [qw/id/],
    required => [qw/id/],
    expected => [qw/200 204 404/],
);

net_api_method delete_node_properties => (
    method   => 'DELETE',
    path     => '/node/:id/properties',
    params   => [qw/id/],
    required => [qw/id/],
    expected => [qw/204 404/],
);

# XXX won't work with JSON...
net_api_method set_node_property => (
    method   => 'PUT',
    path     => '/node/:id/properties/:property',
    params   => [qw/id property/],
    required => [qw/id property/],
    expected => [qw/200 404/],
);

net_api_method node_property => (
    method   => 'GET',
    path     => '/node/:id/properties/:property',
    params   => [qw/id property/],
    required => [qw/id property/],
    expected => [qw/200 404/],
);

net_api_method delete_node_property => (
    method   => 'DELETE',
    path     => '/node/:id/properties/:property',
    params   => [qw/id property/],
    required => [qw/id property/],
    expected => [qw/204 404 /],
);

net_api_method delete_node => (
    method   => 'DELETE',
    path     => '/node/:id',
    params   => [qw/id/],
    required => [qw/id/],
    expected => [qw/204 404 409/],
);

net_api_method add_edge => (
    method   => 'POST',
    path     => '/node/:id/relationships',
    params   => [qw/id to data type/],
    required => [qw/id to data type/],
    expeced  => [qw/201 400 404/],
);

net_api_method set_edge_properties => (
    method   => 'PUT',
    path     => '/relationship/:id/properties',
    params   => [qw/id/],
    required => [qw/id/],
    strict   => 0,
    expected => [qw/204 400 404/],
);

net_api_method edge_properties => (
    method   => 'GET',
    path     => '/relationship/:id/properties',
    params   => [qw/id/],
    required => [qw/id/],
    expected => [qw/200 204 404/],
);

net_api_method delete_edge_properties => (
    method   => 'DELETE',
    path     => '/relationship/:id/properties',
    params   => [qw/id/],
    required => [qw/id/],
    expected => [qw/204 404/],
);

net_api_method set_edge_property => (
    method   => 'PUT',
    path     => '/relationship/:id/properties/:property',
    params   => [qw/id property/],
    required => [qw/id property/],
    expected => [qw/204 404 400/],
);

net_api_method edge_property => (
    method   => 'GET',
    path     => '/relationship/:id/properties/:property',
    params   => [qw/id property/],
    required => [qw/id property/],
    expected => [qw/200 404/],
);

net_api_method delete_edge_property => (
    method   => 'DELETE',
    path     => '/relationship/:id/properties/:property',
    params   => [qw/id property/],
    required => [qw/id property/],
    expected => [qw/204 404/],
);

net_api_method delete_edge => (
    method   => 'DELETE',
    path     => '/relationship/:id',
    params   => [qw/id /],
    required => [qw/id /],
    expected => [qw/204 404/],
);

net_api_method get_edges => (
    method   => 'GET',
    path     => '/node/123/relationships/:dir/:types',
    params   => [qw/id dir types/],
    required => [qw/id dir types/],
    expected => [qw/200 404/],
);

# XXX index methods

net_api_method traverse => (
    method   => 'POST',
    path     => '/node/:id/traverse/:returntype',
    params   => [qw/id returntype/],
    required => [qw/id returntype/],
    expected => [qw/200 404/],
    strict   => 0,
);

1;