-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.html
239 lines (217 loc) · 5.9 KB
/
api.html
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="test.css">
<title>Postsai API</title>
</head>
<body>
<header>
<div class="content">
<h1><a class="homelink" href="/">Postsai</a></h1>
<h2>The Commit Database</h2>
<a class="button" href="https://github.com/postsai/postsai">GitHub</a>
<a class="button" href="https://arianne-project.org/postsai/query.html?date=month">Demo</a>
<a class="button download" href="https://github.com/postsai/postsai/releases/download/v0.9.7/postsai-0.9.7.zip">Download</a>
</div>
</header>
<div class="content">
<section id="queryapi">
<h3>Query API</h3>
<br>
<p>The Postsai database may be queried programmatically using a REST service.</p>
<p>The endpoint is /api.py and it understands the same parameters as the webinterface.</p>
</section>
<section id="urlparamerts">
<h3>URL Parameters</h3>
<br>
<p>The Postsai API understand the following parameters.
All of these parameter are optional.</p>
<table class="table table-bordered">
<tr class="th">
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td>branch</td>
<td>Name of the SCM branch</td>
</tr>
<tr>
<td>branchtype</td>
<td><code>match, regexp, notregexp</code> how to parse the branch parameter.</td>
</tr>
<tr>
<td>commit</td>
<td>The repository wide commitid, e.g. the git hash. Note for CVS: This is the CVS commitid, it is not the file revision.</td>
</tr>
<tr>
<td>committype</td>
<td><code>match, regexp, notregexp</code> how to parse the commit parameter.</td>
</tr>
<tr>
<td>date</td>
<td><code>day, month, hours, exact</code> Limits the result to the most recent day or month. Or use the parameters hours, mindate, maxdate. Defaults to date=day.</td>
</tr>
<tr>
<td>description</td>
<td>Commit comment</td>
</tr>
<tr>
<td>descriptiontype</td>
<td><code>match, search, regexp, notregexp</code> how to parse the description parameter. Search performs a fulltext word search, but falls back to regexp on MySQL <= 5.5</td>
</tr>
<tr>
<td>dir</td>
<td>Directory of the modified files.</td>
</tr>
<tr>
<td>dirtype</td>
<td><code>match, regexp, notregexp</code> how to parse the dir parameter.</td>
</tr>
<tr>
<td>file</td>
<td>Name (without directory) of the modified files.</td>
</tr>
<tr>
<td>filetype</td>
<td><code>match, regexp, notregexp</code> how to parse the file parameter.</td>
</tr>
<tr>
<td>hours</td>
<td>Number of hours to look into the past, requires parameter date=hours.</td>
</tr>
<tr>
<td>limit</td>
<td>Maximum number of results to return.</td>
</tr>
<tr>
<td>mindate</td>
<td>Start results at this timestamp, requires parameter date=exact.</td>
</tr>
<tr>
<td>maxdate</td>
<td>End results at this timestamp, requires parameter date=exact.</td>
</tr>
<tr>
<td>repository</td>
<td>Name of repository. Note for CVS: The module inside the repository is part of the dir parameter.</td>
</tr>
<tr>
<td>repositorytype</td>
<td><code>match, regexp, notregexp</code> how to parse the repository parameter.</td>
</tr>
<tr>
<td>who</td>
<td>Email address of author.</td>
</tr>
<tr>
<td>whotype</td>
<td><code>match, regexp, notregexp</code> how to parse the who parameter.</td>
</tr>
</table>
</section>
<section id="result">
<h3>Result</h3>
<br>
<p>The query is answered with a JSON structure consisting of four main parts:</p>
<table class="table table-bordered">
<tr class="th">
<th>Key</th>
<th>Description</th>
</tr>
<tr>
<td>repositories</td>
<td>Meta information about each repository such as commit urls and tracker links.</td>
</tr>
<tr>
<td>data</td>
<td>An array of commits: repository, timestamp, author, file-array, revision-array (for CVS), branch, deprecated, commit message, deprecated, commitid</td>
</tr>
<tr>
<td>config</td>
<td>The ui-section of config.py.</td>
</tr>
<tr>
<td>extensions</td>
<td>Additional information provided by extensions.</td>
</tr>
</table>
</section>
<section id="example">
<h3>Example</h3>
<br>
<p><b>Query</b></p>
<pre>https://arianne-project.org/postsai/<b>api.py</b>
?<b>repository</b>=postsai%2Fpostsai
&<b>repositorytype</b>=match
&<b>date</b>=explicit
&<b>mindate</b>=2017-02-25+23%3A12%3A16
&<b>maxdate</b>=2017-02-25+23%3A12%3A16
</pre>
<p><b>Response</b></p>
<pre>
{
"repositories":{
"postsai/postsai":{
"repository":"postsai/postsai",
"commit_url":"https://github.com/postsai/postsai/commit/[commit]",
"icon_url":"https://arianne-project.org/postsai/resources/postsai-16.png",
"file_url":"https://github.com/postsai/postsai/blob/[commit]/[file]",
"base_url":"https://github.com/postsai/postsai",
"tracker_url":"https://github.com/postsai/postsai/issues/$1",
"id":6
}
},
"data":[
[
"postsai/postsai",
"2017-02-25 23:12:16",
[
"resources/postsai.js"
],
[
"cd363f6e1de2f7c55e97c7b1c28df110822813ce"
],
"",
"0/0",
"improved error handling",
"postsai/postsai",
"cd363f6e1de2f7c55e97c7b1c28df110822813ce"
],
[
"postsai/postsai",
"2017-02-25 23:12:16",
[
"query.html",
"resources/postsai.js"
],
[
"4c9ebae295797a9533a06d70f90684b29f15b377",
"4c9ebae295797a9533a06d70f90684b29f15b377"
],
"",
"0/0",
"added a comma between file names on export",
"postsai/postsai",
"4c9ebae295797a9533a06d70f90684b29f15b377"
]
],
"config":{
"trim_email":true,
"avatar":"https://gravatar.com",
"pre_merge":true
},
"extension":{
}
}
</pre>
</section>
<footer>
(C) Copyright 2016-2017 Postsai. Postsai is released as Free and Open Source Software under MIT license.
</footer>
</div>
</body>
</html>