-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapiary.apib
365 lines (286 loc) · 10.8 KB
/
apiary.apib
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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
FORMAT: 1A
# DaoHub
Notes API is a *short texts saving* service similar to its physical paper presence on your table.
# Group Repos
Repo related resources of the **Repos API**
## Repo Collection [/repos]
### Create a Repo [POST]
+ Request (application/json)
{
"namespace": "daocloud",
"name": "hello"
}
+ Response 201 (application/json)
{
"id": 3,
"namespace": "daocloud",
"name": "hello",
"active": true,
"in_building": false,
"tags":[]
}
## Repo [/repos/{ns}/{name}]
A single Repo object with all its details
+ Parameters
+ ns (required, String) ... String `namespace` of the Repo
+ name (required, String) ... String `name` of the Repo
### Retrieve a Repo [GET]
+ Response 200 (application/json)
{
"id": 3,
"namespace": "daocloud",
"name": "hello",
"active": true,
"in_building": false,
"tags":["v1", "master"]
}
### Delete a Repo [DELETE]
+ Response 200 (application/json)
# Group Repo Remote
Remote related resources of the **Remote API**
## Remote [/repos/{ns}/{name}/remote]
### Update a Repo Remote [PUT]
+ Request (application/json)
{
"remote": "github.com",
"access": "abc",
"source": "GolfenGuo/go-test"
}
or
{
"remote": "url",
"source": "http://7sbrys.com2.z0.glb.qiniucdn.com/gotest.zip"
}
+ Response 201 (application/json)
{
"id": 1,
"remote": "github.com",
"access": "abc",
"source": "GolfenGuo/go-test"
}
### Get Repo remote [GET]
+ Request (application/json)
+ Response 200 (application/json)
{
"id": 1,
"remote": "github.com",
"access": "abc",
"source": "http://qiniu.com"
}
# Group Repo Triggers
Trigger related resources of the **Trigger API**
## Trigger [/repos/{ns}/{name}/trigger]
### Update the Repo Trigger [PUT]
+ Request (application/json)
{
"trigger_regex": "tags/v.*",
"active": true,
"wait_ci _success":true
}
+ Response 200 (application/json)
{
"id": 1,
"trigger_regex": "tags/v.*",
"active": true,
"wait_ci _success":true
}
### Get a Trigger [GET]
+ Response 200 (application/json)
{
"id": 1,
"trigger_regex": "tags/.*",
"active": true
}
# Group Repo Builds
Builds related resources of the **Build API**
## Builds Collection [/repos/{ns}/{name}/builds?offset={offset}&size={size}]
+ Parameters
+ ns (required, String) ... String `namespace` of the Repo
+ name (required, String) ... String `name` of the Repo
### Manually Trigger a Build [POST]
+ Request (application/json)
with specified commit
{
"commit":"55957ed932b5dd2298de4a24115253892cfbfa8a",
"tag":"v434"
}
or with specified branch
{
"branch":"master",
"tag":"v434"
}
or for URL remote
{
"tag":"v434"
}
+ Response 201 (application/json)
{
"id": 3,
"status": "Error",
"started_at": 1425177290,
"finished_at": 1425177402,
"duration": 112,
"sha": "aeaa0466767c907e1a836a26311d5b9e1768d72c",
"branch": "master",
"pull_request": "",
"author": "DaoCloud",
"gravatar": "2eaf368f3fe9bdfce0a2df3c73168480",
"timestamp": "",
"message": "",
"created_at": 1425136340,
"updated_at": 1425177402
}
### List all Build [GET]
+ Parameters
+ offset (optional, Int) ... Int `offset` of the return list
+ size (optional, Int) ... Int `size` of the return list
+ Response 200 (application/json)
[{
"id": 3,
"status": "Error",
"started_at": 1425177290,
"finished_at": 1425177402,
"duration": 112,
"sha": "aeaa0466767c907e1a836a26311d5b9e1768d72c",
"branch": "master",
"pull_request": "",
"author": "DaoCloud",
"gravatar": "2eaf368f3fe9bdfce0a2df3c73168480",
"timestamp": "",
"message": "",
"created_at": 1425136340,
"updated_at": 1425177402
}]
### Rebuild [/repositories/{ns}/{name}/builds/{build}/actions/rebuild]
#### Rebuild a Build [POST]
+ Response 200 (application/json)
{
"id": 16,
"status": "Pending",
"started_at": 0,
"finished_at": 0,
"duration": 0,
"sha": "250f678f368db3ebbb3663f92a18b4c79330881f",
"branch": "",
"tag": "v434",
"pull_request": "",
"author": "DaoCloud",
"timestamp": "",
"message": "",
"created_at": 1425730778,
"updated_at": 1425730778
}
### Build output [/repositories/{ns}/{name}/builds/{build}/output]
#### Get output of a Build [GET]
+ Response 200 (application/json)
{
"logs": "this is a build log"
}
# Group Repo Tags
Tags related resources of the **Tag API**
## Tags Collection [/repos/{ns}/{name}/tags]
### List all Tag [GET]
+ Response 200 (application/json)
[{
"id": 1,
"name": "v1",
"build_id": "1"
}]
## Tags Collection [/repos/{ns}/{name}/tags/{tag}]
### Get Tag [GET]
+ Response 200 (application/json)
{
"id": 1,
"name": "v1",
"build_id": "1"
}
# Group Repo Hooks
Hook related resources of the **Hook API**
## Repo Hook [/repos/{ns}/{name}/hook]
### Create the Repo Hook [PUT]
+ Request (application/json)
{
"hook_url":"http://127.0.0.1:8080/api/ping",
"hook_on _success": true,
"hook_on _failure":true
}
+ Response 200 (application/json)
{
"hook_url":"http://127.0.0.1:8080/api/ping",
"hook_on _success": true,
"hook_on _failure":true
}
## Hook Callback [/callback_url]
### Call the hook [POST]
+ Request (application/json)
{
"from_url": "http://16a848c5.shinebaby520.com",
"owner": {
"remote": "",
"login": "",
"name": "",
"gravatar": "",
"admin": false,
"active": false,
"syncing": false,
"created_at": 1425958863,
"updated_at": 1425958863,
"synced_at": 0
},
"repository": {
"remote": "github.com",
"host": "github.com",
"namespace": "golfen",
"name": "ci",
"source": "DaoCloud/go-test",
"trigger_regex": "tags/.*",
"trigger_active": true,
"trigger_wait_ci_success": true,
"registry": "192.168.1.49:5000",
"hook_url": "http://127.0.0.1:8080/api/ping",
"hook_on_success": true,
"hook_on_failure": true,
"url": "https://github.com/DaoCloud/go-test",
"clone_url": "git@github.com:DaoCloud/go-test.git",
"git_url": "git://github.com/DaoCloud/go-test.git",
"ssh_url": "git@github.com:DaoCloud/go-test.git",
"active": true,
"private": true,
"privileged": false,
"post_commits": true,
"pull_requests": false,
"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC5KjqjU4zNIurfo53qyRIxXcQovSDMbxfBjzyL6qPDB+Qk0jatHO0XPeH7QoPqERFw4jxqcZKDRifcRma26JkjjZNz6KVPRiCeNIUnssfVyQJecnheYTyQ+SxirBy0lz1cC0T61tdueqMHLDRE3t0MO3PqzzIzF4mk573huF1sAOI0yAeuNWQp6pF2ssb9z24iyEUAHPeWW5pQ63l98Y0SJNt96UHorfsQkZambPxraFvTTLbOJwIplIITLAm6qzAlmEsEPZMpooUJCPZXpMHdHIy3GHcKF5P4LmftHuopQokIHCasHMqrOHoV7vwhXVnOR5+kf7Os2OqT8hO85h27\n",
"private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEogIBAAKCAQEAuSo6o1OMzSLq36Od6skSMV3EKL0gzG8XwY88i+qjwwfkJNI2\nrRztFz3h+0KD6hERcOI8anGSg0Yn3EZmtuiZI42Tc+ilT0YgnjSFJ7LH1ckCXnJ4\nXmE8kPksYqwctJc9XAtE+tbXbnqjByw0RN7d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UMFz56CKRnVT\nGNZ04S1/d5wlrN8yAvMm3QKBgGlClujRcBQlextbkmUEkR3mSubJTm1E+MmSkMhb\nqAGe/DAudJSfAFgDoy2cyyLINksGRx1mvKoCwoXwt8S9PYo8vMkbrkPw8diOJlSD\nYot0UxBJTP/mdPFZ4zKY0OnXHnjTFnhFuHu6CmbqaNv39LMOdNcp7GlJiYuWHjLT\n8ZMpAoGAJZ+vf27oY9rOuR/XItVV60ADG4kgA9Ie2Fk3aMxxSdSLQN2FySs9kiuR\ndxv1cYVGrWcQyH/3ynqoi39xocO8S4o+QeeHtI5pfgPr8IU6lDwRHToy9twW3RSu\nFKBRixhm3XG4Jp/1MKvuzfG9nk0NWQm/OMNSCQBm+5dtzDe5jgo=\n-----END RSA PRIVATE KEY-----\n",
"timeout": 7200,
"created_at": 1425898996,
"updated_at": 1425959344
},
"commit": {
"id": 12,
"status": "Failure",
"started_at": 1425959441,
"finished_at": 1425959446,
"duration": 5,
"sha": "250f678f368db3ebbb3663f92a18b4c79330881f",
"branch": "tags/yy",
"tag": "yy",
"pull_request": "",
"author": "golfen.guo@daocloud.io",
"timestamp": "2015-03-05T14:55:38+08:00",
"message": "initial commit",
"created_at": 1425959441,
"updated_at": 1425959446
}
}
+ Response 200 (application/json)
# Group Repo Logs
Logs related resources of the **Log API**
## Logs Collection [/repos/{ns}/{name}/logs]
### List all Tag [GET]
+ Response 200 (application/json)
[
{
"log": "fatal: unable to access 'https://github.com/jpetazzo/dind/': Could not resolve host: github.com",
"created_at": 1425625549
}
]