aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/api.go
diff options
context:
space:
mode:
authorMohamed Sekour <mohamed.sekour@exfo.com>2022-07-30 18:45:59 +0200
committerGitHub <noreply@github.com>2022-07-30 18:45:59 +0200
commit0e61a74e5a3fc14ff26d1c85065ba336d3f3994b (patch)
tree63282d44a77c410f33595e000d5fef7a9e700a35 /routers/api/v1/api.go
parente819da083734ddbf30afbc62afd48e9d0e8f3d48 (diff)
downloadgitea-0e61a74e5a3fc14ff26d1c85065ba336d3f3994b.tar.gz
gitea-0e61a74e5a3fc14ff26d1c85065ba336d3f3994b.zip
Add new API endpoints for push mirrors management (#19841)
- Add a new push mirror to specific repository - Sync now ( send all the changes to the configured push mirrors ) - Get list of all push mirrors of a repository - Get a push mirror by ID - Delete push mirror by ID Signed-off-by: Mohamed Sekour <mohamed.sekour@exfo.com> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'routers/api/v1/api.go')
-rw-r--r--routers/api/v1/api.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go
index 44e0c290a0..e1478fa2aa 100644
--- a/routers/api/v1/api.go
+++ b/routers/api/v1/api.go
@@ -982,6 +982,15 @@ func Routes() *web.Route {
})
}, reqRepoReader(unit.TypeReleases))
m.Post("/mirror-sync", reqToken(), reqRepoWriter(unit.TypeCode), repo.MirrorSync)
+ m.Post("/push_mirrors-sync", reqAdmin(), repo.PushMirrorSync)
+ m.Group("/push_mirrors", func() {
+ m.Combo("").Get(repo.ListPushMirrors).
+ Post(bind(api.CreatePushMirrorOption{}), repo.AddPushMirror)
+ m.Combo("/{name}").
+ Delete(repo.DeletePushMirrorByRemoteName).
+ Get(repo.GetPushMirrorByName)
+ }, reqAdmin())
+
m.Get("/editorconfig/{filename}", context.ReferencesGitRepo(), context.RepoRefForAPI, reqRepoReader(unit.TypeCode), repo.GetEditorconfig)
m.Group("/pulls", func() {
m.Combo("").Get(repo.ListPullRequests).