RESTful API (OD-228)
Robin Shen opened 5 years ago

RESTful api to interact with OneDev server for instant to access project information

  • OneDev referenced from other issue 5 years ago
  • Michael Weimann commented 5 years ago

    Funny thing. I thought about that in the past days as well.
    This could enable coding integrations and apps.

    If you want I could so some research if there is an api where to "borrow" some ideas from (e.g. GitLab, GitHub, Gitea, BitBucket/JIRA). In my opinion a versioned endpoint is mandatory, e.g. starting with /api/v1. It should follow semantic versioning. Often coupled software breaks because APIs change. Let's prevent that from the beginning.

    Is there a special use-case the original reporter (Yu) wants to solve at the beginning?

  • Robin Shen commented 5 years ago

    Thanks for willing to help. The user originally asking for this functionality wants to get git clone address of all projects. @rechardwang @aaronuu please correct me if I am wrong.

    OneDev currently has a draft api skeleton based on Jersey:

    https://code.onedev.io/projects/onedev-server/blob/main/server-core/src/main/java/io/onedev/server/rest

    Currently restful resource endpoints convert OneDev model (project, build etc) from/to json via Jackson serialization. This has the benefit of almost zero maintenance as api input/output will be changed automatic upon model change (adding/removing/renaming field etc). However the api is currently not be versioned. I am thinking of versioning the api automatically and get api input migrated automatically to latest version something like what I have done in DataMigrator.java for database backup/restore to minimize api maintainance overhead.

  • YU ZHANG commented 5 years ago

    @robin 感谢作者辛苦开源,RESTful API 还有其他扩展作用,比如可以根据API去扩展统计数据(自定义统计所有用户的代码提交数据,根据提交数据定位分支等等)。

  • Robin Shen changed iterations 5 years ago
    Previous Value Current Value
    empty
    5.0.0
  • hackerdom commented 5 years ago

    When will this function be released?

  • Robin Shen commented 5 years ago

    I plan to get it out before end of this year

  • OneDev changed state to 'Closed' 5 years ago
    Previous Value Current Value
    Open
    Closed
  • OneDev changed state to 'Released' 5 years ago
    Previous Value Current Value
    Closed
    Released
  • Robin Shen commented 5 years ago

    For details about RESTful API, please check http(s)://<your OneDev server url>/help/api

  • bufferUnderrun commented 5 years ago

    @robin you roxxxx !!

issue 1/1
Type
New Feature
Priority
Normal
Assignee
Issue Votes (2)
Watchers (6)
Reference
OD-228
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover