summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--public/swagger.v1.json16
-rw-r--r--routers/api/v1/repo/repo.go9
2 files changed, 25 insertions, 0 deletions
diff --git a/public/swagger.v1.json b/public/swagger.v1.json
index 264ae52be6..dd91a6fdc1 100644
--- a/public/swagger.v1.json
+++ b/public/swagger.v1.json
@@ -228,6 +228,22 @@
}
}
},
+ "/repos/{username}/{reponame}/mirror-sync": {
+ "post": {
+ "produces": [
+ "application/json"
+ ],
+ "operationId": "repoMirrorSync",
+ "responses": {
+ "200": {
+ "$ref": "#/responses/empty"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ }
+ }
+ }
+ },
"/repos/{username}/{reponame}/subscription": {
"get": {
"operationId": "userCurrentCheckSubscription",
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index 83b1dbd26b..da4034a0d4 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -337,6 +337,15 @@ func Delete(ctx *context.APIContext) {
// MirrorSync adds a mirrored repository to the sync queue
func MirrorSync(ctx *context.APIContext) {
+ // swagger:route POST /repos/{username}/{reponame}/mirror-sync repoMirrorSync
+ //
+ // Produces:
+ // - application/json
+ //
+ // Responses:
+ // 200: empty
+ // 403: forbidden
+
repo := ctx.Repo.Repository
if !ctx.Repo.IsWriter() {