changeset 8978:3c55f6f179fb stable

docs: first pass of introducing documentation of repo groups API
author Louis Bertrand <louis.bertrand@durhamcollege.ca>
date Tue, 27 Dec 2022 20:22:14 +0100
parents 2244eb820732
children c1df0ddc9c58
files CONTRIBUTORS docs/api/api.rst kallithea/templates/about.html
diffstat 3 files changed, 163 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/CONTRIBUTORS	Tue Dec 27 21:10:06 2022 +0100
+++ b/CONTRIBUTORS	Tue Dec 27 20:22:14 2022 +0100
@@ -4,6 +4,7 @@
     Asterios Dimitriou <steve@pci.gr> 2016-2017 2020 2022
     Manuel Jacob <me@manueljacob.de> 2019-2020 2022
     Jaime Marquínez Ferrándiz <weblate@jregistros.fastmail.net> 2022
+    Louis Bertrand <louis.bertrand@durhamcollege.ca> 2022
     toras9000 <toras9000@gmail.com> 2022
     yzqzss <yzqzss@othing.xyz> 2022
     МАН69К <weblate@mah69k.net> 2022
--- a/docs/api/api.rst	Tue Dec 27 21:10:06 2022 +0100
+++ b/docs/api/api.rst	Tue Dec 27 20:22:14 2022 +0100
@@ -540,6 +540,167 @@
              }
     error : null
 
+get_repo_group
+^^^^^^^^^^^^^^
+
+Get an existing repository group.
+This command can only be executed using the api_key of a user with admin rights.
+
+INPUT::
+
+    id : <id_for_response>
+    api_key : "<api_key>"
+    method :  "get_repo_group"
+    args :    {
+                "repogroupid" : "<repo group id or name>"
+              }
+
+OUTPUT::
+
+    id : <id_given_in_input>
+    result :
+               {
+               "group_id" :          "<id>",
+               "group_name" :        "<groupname>",
+               "group_description" : "<groupdescription>",
+               "parent_group" :      "<groupid>"|null,
+               "repositories" :      "<list_of_all_repo_names_in_group>",
+               "owner" :             "<owner>",
+               "members" :           [
+                                       {
+                                         "name" : "<name>",
+                                         "type" : "user",
+                                         "permission" : "group.(none|read|write|admin)"
+                                       },
+                                       {
+                                         "name" : "<name>",
+                                         "type" : "user_group",
+                                         "permission" : "group.(none|read|write|admin)"
+                                       },
+                                       …
+                                     ]
+
+               },
+    error : null
+
+get_repo_groups
+^^^^^^^^^^^^^^^
+
+List all existing repository groups.
+This command can only be executed using the api_key of a user with admin rights.
+
+INPUT::
+
+    id : <id_for_response>
+    api_key : "<api_key>"
+    method :  "get_repo_groups"
+    args :    { }
+
+OUTPUT::
+
+    id : <id_given_in_input>
+    result : [
+               {
+               "group_id" :          "<id>",
+               "group_name" :        "<groupname>",
+               "group_description" : "<groupdescription>",
+               "parent_group" :      "<groupid>"|null,
+               "repositories" :      "<list_of_all_repo_names_in_group>",
+               "owner" :             "<owner>"
+               },
+               …
+              ]
+    error : null
+
+create_repo_group
+^^^^^^^^^^^^^^^^^
+
+Create a new repository group.
+This command can only be executed using the api_key of a user with admin rights.
+
+INPUT::
+
+    id : <id_for_response>
+    api_key : "<api_key>"
+    method :  "create_repo_group"
+    args :    {
+                "group_name" :       "<group_name>",
+                "description" :      "<description> = Optional("")",
+                "owner" :            "<username or user_id> = Optional(None)",
+                "parent" :           "<reponame or id> = Optional(None)",
+                "copy_permissions" : "<bool> = Optional(False)"
+              }
+
+OUTPUT::
+
+    id : <id_given_in_input>
+    result : {
+                "msg" : "created new repo group `<group_name>`",
+                "repo_group" : {
+                                 "group_id" :          <id>,
+                                 "group_name" :        "<parent_group>/<group_name>",
+                                 "group_description" : "<description>",
+                                 "parent_group" :      <id>|null,
+                                 "repositories" :      <list of repositories>,
+                                 "owner" :             "<user_name>"
+                                }
+
+update_repo_group
+^^^^^^^^^^^^^^^^^
+
+Update a repository group.
+This command can only be executed using the api_key of a user with admin rights.
+
+INPUT::
+
+    id : <id_for_response>
+    api_key : "<api_key>"
+    method :  "update_repo_group"
+    args :    {
+                "repogroupid" :         "<id>",
+                "group_name" :       "<group_name> = Optional(None)",
+                "description" :      "<description> = Optional(None)",
+                "owner" :            "<username or user_id> = Optional(None)",
+                "parent" :           "<reponame or id> = Optional(None)"
+              }
+
+OUTPUT::
+
+    id : <id_given_in_input>
+    result : {
+                "msg" : "updated repository group ID:<id> <group_name>",
+                "repo_group" : {
+                                 "group_id" :          <id>,
+                                 "group_name" :        "<parent_group>/<group_name>",
+                                 "group_description" : "<description>",
+                                 "parent_group" :      <id>|null,
+                                 "repositories" :      <list of repositories>,
+                                 "owner" :             "<user_name>"
+                                }
+
+delete_repo_group
+^^^^^^^^^^^^^^^^^
+
+Delete a repository group.
+This command can only be executed using the api_key of a user with admin rights.
+
+INPUT::
+
+    id : <id_for_response>
+    api_key : "<api_key>"
+    method :  "delete_repo_group"
+    args :    {
+                "repogroupid" : "<id>"
+              }
+
+OUTPUT::
+
+    id : <id_given_in_input>
+    result : {
+                "msg" : "deleted repo group ID:<id> <group_name>",
+                "repo_group" : null
+              }
+
 get_repo
 ^^^^^^^^
 
--- a/kallithea/templates/about.html	Tue Dec 27 21:10:06 2022 +0100
+++ b/kallithea/templates/about.html	Tue Dec 27 20:22:14 2022 +0100
@@ -28,6 +28,7 @@
   <li>Copyright &copy; 2016&ndash;2017, 2020, 2022, Asterios Dimitriou</li>
   <li>Copyright &copy; 2019&ndash;2020, 2022, Manuel Jacob</li>
   <li>Copyright &copy; 2022, Jaime Marquínez Ferrándiz</li>
+  <li>Copyright &copy; 2022, Louis Bertrand</li>
   <li>Copyright &copy; 2022, toras9000</li>
   <li>Copyright &copy; 2022, yzqzss</li>
   <li>Copyright &copy; 2022, МАН69К</li>