Skip to content

Commit 4afb7b7

Browse files
committed
Merge pull request gitlabhq#1522 from NARKOZ/api
API clean up
2 parents 1315536 + bbdb2c3 commit 4afb7b7

File tree

17 files changed

+420
-458
lines changed

17 files changed

+420
-458
lines changed

app/views/help/api.html.haml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
= link_to "Projects", "#projects", 'data-toggle' => 'tab'
1212
%li
1313
= link_to "Snippets", "#snippets", 'data-toggle' => 'tab'
14+
%li
15+
= link_to "Repositories", "#repositories", 'data-toggle' => 'tab'
1416
%li
1517
= link_to "Users", "#users", 'data-toggle' => 'tab'
1618
%li
@@ -19,8 +21,6 @@
1921
= link_to "Issues", "#issues", 'data-toggle' => 'tab'
2022
%li
2123
= link_to "Milestones", "#milestones", 'data-toggle' => 'tab'
22-
%li
23-
= link_to "Commits", "#commits", 'data-toggle' => 'tab'
2424

2525
.tab-content
2626
.tab-pane.active#README
@@ -50,6 +50,15 @@
5050
= preserve do
5151
= markdown File.read(Rails.root.join("doc", "api", "snippets.md"))
5252

53+
.tab-pane#repositories
54+
.file_holder
55+
.file_title
56+
%i.icon-file
57+
Projects
58+
.file_content.wiki
59+
= preserve do
60+
= markdown File.read(Rails.root.join("doc", "api", "repositories.md"))
61+
5362
.tab-pane#users
5463
.file_holder
5564
.file_title
@@ -85,12 +94,3 @@
8594
.file_content.wiki
8695
= preserve do
8796
= markdown File.read(Rails.root.join("doc", "api", "milestones.md"))
88-
89-
.tab-pane#commits
90-
.file_holder
91-
.file_title
92-
%i.icon-file
93-
Commits
94-
.file_content.wiki
95-
= preserve do
96-
= markdown File.read(Rails.root.join("doc", "api", "commits.md"))

doc/api/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ When listing resources you can pass the following parameters:
3333
+ [Session](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/session.md)
3434
+ [Projects](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md)
3535
+ [Snippets](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/snippets.md)
36+
+ [Repositories](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/repositories.md)
3637
+ [Issues](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/issues.md)
3738
+ [Milestones](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/milestones.md)
38-
+ [SSH Keys](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/keys.md)

doc/api/commits.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

doc/api/keys.md

Lines changed: 0 additions & 79 deletions
This file was deleted.

doc/api/projects.md

Lines changed: 0 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -239,135 +239,3 @@ Parameters:
239239
+ `hook_id` (required) - The ID of hook to delete
240240

241241
Will return status `200 OK` on success, or `404 Not found` on fail.
242-
243-
## Project repository branches
244-
245-
Get a list of repository branches from a project, sorted by name alphabetically.
246-
247-
```
248-
GET /projects/:id/repository/branches
249-
```
250-
251-
Parameters:
252-
253-
+ `id` (required) - The ID or code name of a project
254-
255-
```json
256-
[
257-
{
258-
"name": "master",
259-
"commit": {
260-
"id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c",
261-
"parents": [
262-
{
263-
"id": "4ad91d3c1144c406e50c7b33bae684bd6837faf8"
264-
}
265-
],
266-
"tree": "46e82de44b1061621357f24c05515327f2795a95",
267-
"message": "add projects API",
268-
"author": {
269-
"name": "John Smith",
270-
"email": "john@example.com"
271-
},
272-
"committer": {
273-
"name": "John Smith",
274-
"email": "john@example.com"
275-
},
276-
"authored_date": "2012-06-27T05:51:39-07:00",
277-
"committed_date": "2012-06-28T03:44:20-07:00"
278-
}
279-
}
280-
]
281-
```
282-
283-
Get a single project repository branch.
284-
285-
```
286-
GET /projects/:id/repository/branches/:branch
287-
```
288-
289-
Parameters:
290-
291-
+ `id` (required) - The ID or code name of a project
292-
+ `branch` (required) - The name of the branch
293-
294-
```json
295-
{
296-
"name": "master",
297-
"commit": {
298-
"id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c",
299-
"parents": [
300-
{
301-
"id": "4ad91d3c1144c406e50c7b33bae684bd6837faf8"
302-
}
303-
],
304-
"tree": "46e82de44b1061621357f24c05515327f2795a95",
305-
"message": "add projects API",
306-
"author": {
307-
"name": "John Smith",
308-
"email": "john@example.com"
309-
},
310-
"committer": {
311-
"name": "John Smith",
312-
"email": "john@example.com"
313-
},
314-
"authored_date": "2012-06-27T05:51:39-07:00",
315-
"committed_date": "2012-06-28T03:44:20-07:00"
316-
}
317-
}
318-
```
319-
320-
## Project repository tags
321-
322-
Get a list of repository tags from a project, sorted by name in reverse alphabetical order.
323-
324-
```
325-
GET /projects/:id/repository/tags
326-
```
327-
328-
Parameters:
329-
330-
+ `id` (required) - The ID or code name of a project
331-
332-
```json
333-
[
334-
{
335-
"name": "v1.0.0",
336-
"commit": {
337-
"id": "2695effb5807a22ff3d138d593fd856244e155e7",
338-
"parents": [
339-
340-
],
341-
"tree": "38017f2f189336fe4497e9d230c5bb1bf873f08d",
342-
"message": "Initial commit",
343-
"author": {
344-
"name": "John Smith",
345-
"email": "john@example.com"
346-
},
347-
"committer": {
348-
"name": "Jack Smith",
349-
"email": "jack@example.com"
350-
},
351-
"authored_date": "2012-05-28T04:42:42-07:00",
352-
"committed_date": "2012-05-28T04:42:42-07:00"
353-
}
354-
}
355-
]
356-
```
357-
358-
## Raw blob content
359-
360-
Get the raw file contents for a file.
361-
362-
```
363-
GET /projects/:id/repository/commits/:sha/blob
364-
```
365-
366-
Parameters:
367-
368-
+ `id` (required) - The ID or code name of a project
369-
+ `sha` (required) - The commit or branch name
370-
+ `filepath` (required) - The path the file
371-
372-
Will return the raw file contents.
373-

0 commit comments

Comments
 (0)