Skip to content

Enhance REST API #495

Open
Open
@fcollonval

Description

@fcollonval

The current REST API could be improved by at least passing the git repository folder in the url like for example the content notebook API. In particular this will allow to use the full spectra of HTTP verbs in a more RESTful spirit.

For example here are some interfaces from the notebook content API:

HTTP verb URL Action
GET /api/contents/path/file Return a model for a file or directory.
PUT /api/contents/path/file Saves the file in the location specified by name and path.
PATCH /api/contents/path/file PATCH renames a notebook without re-uploading content.
POST /api/contents/path/file Create a new file or directory in the specified path.
DELETE /api/contents/path/file delete a file in the given path

Idea of evolution

Before After Note
POST /git/add POST /git/path/add
POST /git/add_all_untracked Should be merged with add using arguments to distinguish
POST /git/add_all_untracked Should be merged with add using arguments
POST /git/all_history GET /git/path/all_history Should we keep it?
POST /git/branch GET /git/path/branches
POST /git/changed_files Unused ?
POST /git/checkout ? They are 3 behaviors within this endpoint. Probably need to be distinguished
_ GET /git/path/branches/branch Branch switch
_ POST /git/path/branches/branch Branch creation
_ ? Discard all changes
POST /git/clone POST /git/path
POST /git/commit POST /git/path/commits
POST /git/config GET /git/path/config Split get and set config actions
_ POST /git/path/config
POST /git/delete_commit DELETE /git/path/commits/hash
POST /git/detailed_log GET /git/path/commits/hash
POST /git/diff GET /git/path/diff
POST /git/diffcontent ? Can it be merged with the previous one?
POST /git/init POST /git/path To be merged with clone
POST /git/log GET /git/path/log History count as query argument
POST /git/pull POST /git/path/pull Need to stay POST for authentication
POST /git/push POST /git/path/push
POST /git/reset ?
POST /git/reset_to_commit ?
GET /git/server_root GET /git/server_root
POST /git/showprefix GET /git/path/showprefix
POST /git/showtoplevel GET /git/path/showtoplevel
POST /git/status GET /git/path/status
POST /git/upstream GET /git/path/upstream

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions