Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
enhance swagger doc about restore API
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesClonk committed Jul 1, 2022
1 parent 06ba216 commit 533b433
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
21 changes: 20 additions & 1 deletion router/api/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,25 @@ import (
"github.com/swisscom/backman/service"
)

// swagger:operation POST /api/v1/restore/{service_type}/{service_name}/{filename}/{target_name} restoreBackupToTarget
// Triggers a restore of a given service backup to a specific target service.
//
// ---
// operationId: restoreBackupToTarget
// produces:
// - application/json
// responses:
// '202':
// description: Service
// schema:
// $ref: '#/definitions/Service'
// schemes:
// - http
// - https
// summary: Triggers a restore of a given service backup to a specific target service.
// tags:
// - restore

// swagger:route POST /api/v1/restore/{service_type}/{service_name}/{filename} restore restoreBackup
// Triggers a restore for given service.
//
Expand All @@ -20,7 +39,7 @@ import (
// schemes: http, https
//
// responses:
// 202: service
// 202: Service
func (h *Handler) RestoreBackup(c echo.Context) error {
serviceType := c.Param("service_type")
serviceName, err := url.QueryUnescape(c.Param("service_name"))
Expand Down
20 changes: 19 additions & 1 deletion swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,31 @@ paths:
- application/json
responses:
"202":
$ref: '#/responses/service'
description: Service
schema:
$ref: '#/definitions/Service'
schemes:
- http
- https
summary: Triggers a restore for given service.
tags:
- restore
/api/v1/restore/{service_type}/{service_name}/{filename}/{target_name}:
post:
operationId: restoreBackupToTarget
produces:
- application/json
responses:
"202":
description: Service
schema:
$ref: '#/definitions/Service'
schemes:
- http
- https
summary: Triggers a restore of a given service backup to a specific target service.
tags:
- restore
/api/v1/service/{service_type}/{service_name}:
get:
operationId: getService
Expand Down

0 comments on commit 533b433

Please sign in to comment.