diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2016-10-23 16:16:54 +0200 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2016-10-23 16:16:54 +0200 |
commit | f332907457c897ad0483a0bffce3d01503445d0b (patch) | |
tree | d871082cc6b0fec206ea5c7a135fe4573039b1a2 /docs/gl_objects | |
parent | 20fdbe870f161ad7c47c7d57ebb2b6952acba8be (diff) | |
download | gitlab-f332907457c897ad0483a0bffce3d01503445d0b.tar.gz |
Add support for boards API
This is not fully usable because the gitlab API has some limitations:
- not possible to create boards programmatically
- not possible to get labels ID
(https://gitlab.com/gitlab-org/gitlab-ce/issues/23448)
Diffstat (limited to 'docs/gl_objects')
-rw-r--r-- | docs/gl_objects/projects.py | 36 | ||||
-rw-r--r-- | docs/gl_objects/projects.rst | 54 |
2 files changed, 90 insertions, 0 deletions
diff --git a/docs/gl_objects/projects.py b/docs/gl_objects/projects.py index 7623c15..c2bc5aa 100644 --- a/docs/gl_objects/projects.py +++ b/docs/gl_objects/projects.py @@ -405,3 +405,39 @@ pipeline.retry() # pipeline cancel pipeline.cancel() # end pipeline cancel + +# boards list +boards = gl.project_boards.list(project_id=1) +# or +boards = project.boards.list() +# end boards list + +# boards get +board = gl.project_boards.get(board_id, project_id=1) +# or +board = project.boards.get(board_id) +# end boards get + +# board lists list +b_lists = board.lists.list() +# end board lists list + +# board lists get +b_list = board.lists.get(list_id) +# end board lists get + +# board lists create +# First get a ProjectLabel +label = get_or_create_label() +# Then use its ID to create the new board list +b_list = board.lists.create({'label_id': label.id}) +# end board lists create + +# board lists update +b_list.position = 2 +b_list.save() +# end board lists update + +# board lists delete +b_list.delete() +# end boards lists delete diff --git a/docs/gl_objects/projects.rst b/docs/gl_objects/projects.rst index afc0d3a..bdbf140 100644 --- a/docs/gl_objects/projects.rst +++ b/docs/gl_objects/projects.rst @@ -468,3 +468,57 @@ Disable a service: .. literalinclude:: projects.py :start-after: # service delete :end-before: # end service delete + +Boards +------ + +Boards are a visual representation of existing issues for a project. Issues can +be moved from one list to the other to track progress and help with +priorities. + +Get the list of existing boards for a project: + +.. literalinclude:: projects.py + :start-after: # boards list + :end-before: # end boards list + +Get a single board for a project: + +.. literalinclude:: projects.py + :start-after: # boards get + :end-before: # end boards get + +Boards have lists of issues. Each list is defined by a +:class:`~gitlab.objects.ProjectLabel` and a position in the board. + +List the issue lists for a board: + +.. literalinclude:: projects.py + :start-after: # board lists list + :end-before: # end board lists list + +Get a single list: + +.. literalinclude:: projects.py + :start-after: # board lists get + :end-before: # end board lists get + +Create a new list. Note that getting the label ID is broken at the moment (see +https://gitlab.com/gitlab-org/gitlab-ce/issues/23448): + +.. literalinclude:: projects.py + :start-after: # board lists create + :end-before: # end board lists create + +Change a list position. The first list is at position 0. Moving a list will +insert it at the given position and move the following lists up a position: + +.. literalinclude:: projects.py + :start-after: # board lists update + :end-before: # end board lists update + +Delete a list: + +.. literalinclude:: projects.py + :start-after: # board lists delete + :end-before: # end board lists delete |