summaryrefslogtreecommitdiffstats
path: root/templates/swagger
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 /templates/swagger
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 'templates/swagger')
-rw-r--r--templates/swagger/v1_json.tmpl302
1 files changed, 301 insertions, 1 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index c0dd50a7b9..daec38044f 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -8774,6 +8774,233 @@
}
}
},
+ "/repos/{owner}/{repo}/push_mirrors": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Get all push mirrors of the repository",
+ "operationId": "repoListPushMirrors",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "description": "page number of results to return (1-based)",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page size of results",
+ "name": "limit",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/PushMirrorList"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ }
+ }
+ },
+ "post": {
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "add a push mirror to the repository",
+ "operationId": "repoAddPushMirror",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "name": "body",
+ "in": "body",
+ "schema": {
+ "$ref": "#/definitions/CreatePushMirrorOption"
+ }
+ }
+ ],
+ "responses": {
+ "201": {
+ "$ref": "#/responses/PushMirror"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ }
+ }
+ }
+ },
+ "/repos/{owner}/{repo}/push_mirrors-sync": {
+ "post": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Sync all push mirrored repository",
+ "operationId": "repoPushMirrorSync",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo to sync",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo to sync",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/empty"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ }
+ }
+ }
+ },
+ "/repos/{owner}/{repo}/push_mirrors/{name}": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "Get push mirror of the repository by remoteName",
+ "operationId": "repoGetPushMirrorByRemoteName",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "remote name of push mirror",
+ "name": "name",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/PushMirror"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ }
+ }
+ },
+ "delete": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "repository"
+ ],
+ "summary": "deletes a push mirror from a repository by remoteName",
+ "operationId": "repoDeletePushMirror",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "remote name of the pushMirror",
+ "name": "name",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "204": {
+ "$ref": "#/responses/empty"
+ },
+ "400": {
+ "$ref": "#/responses/error"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
"/repos/{owner}/{repo}/raw/{filepath}": {
"get": {
"produces": [
@@ -14441,6 +14668,29 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "CreatePushMirrorOption": {
+ "type": "object",
+ "title": "CreatePushMirrorOption represents need information to create a push mirror of a repository.",
+ "properties": {
+ "interval": {
+ "type": "string",
+ "x-go-name": "Interval"
+ },
+ "remote_address": {
+ "type": "string",
+ "x-go-name": "RemoteAddress"
+ },
+ "remote_password": {
+ "type": "string",
+ "x-go-name": "RemotePassword"
+ },
+ "remote_username": {
+ "type": "string",
+ "x-go-name": "RemoteUsername"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"CreateReleaseOption": {
"description": "CreateReleaseOption options when creating a release",
"type": "object",
@@ -17516,6 +17766,41 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "PushMirror": {
+ "description": "PushMirror represents information of a push mirror",
+ "type": "object",
+ "properties": {
+ "created": {
+ "type": "string",
+ "x-go-name": "CreatedUnix"
+ },
+ "interval": {
+ "type": "string",
+ "x-go-name": "Interval"
+ },
+ "last_error": {
+ "type": "string",
+ "x-go-name": "LastError"
+ },
+ "last_update": {
+ "type": "string",
+ "x-go-name": "LastUpdateUnix"
+ },
+ "remote_address": {
+ "type": "string",
+ "x-go-name": "RemoteAddress"
+ },
+ "remote_name": {
+ "type": "string",
+ "x-go-name": "RemoteName"
+ },
+ "repo_name": {
+ "type": "string",
+ "x-go-name": "RepoName"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"Reaction": {
"description": "Reaction contain one reaction",
"type": "object",
@@ -19293,6 +19578,21 @@
}
}
},
+ "PushMirror": {
+ "description": "PushMirror",
+ "schema": {
+ "$ref": "#/definitions/PushMirror"
+ }
+ },
+ "PushMirrorList": {
+ "description": "PushMirrorList",
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PushMirror"
+ }
+ }
+ },
"Reaction": {
"description": "Reaction",
"schema": {
@@ -19572,7 +19872,7 @@
"parameterBodies": {
"description": "parameterBodies",
"schema": {
- "$ref": "#/definitions/CreateWikiPageOptions"
+ "$ref": "#/definitions/CreatePushMirrorOption"
}
},
"redirect": {