Skip to content

Commit

Permalink
Merge pull request #64 from cloud-barista/feature/fix-migration-route
Browse files Browse the repository at this point in the history
fix: migrate route
  • Loading branch information
heedaeshin authored Oct 2, 2024
2 parents d8d23d5 + 1e3a4f9 commit 0741819
Show file tree
Hide file tree
Showing 5 changed files with 214 additions and 214 deletions.
8 changes: 4 additions & 4 deletions websrc/controllers/migrationHandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
// @Success 200 {object} models.BasicResponse "Successfully migrated data"
// @Failure 400 {object} models.BasicResponse "Invalid Request"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /migration/objectstorage [post]
// @Router /migrate/objectstorage [post]
func MigrationObjectstoragePostHandler(ctx echo.Context) error {
start := time.Now()

Expand Down Expand Up @@ -81,7 +81,7 @@ func MigrationObjectstoragePostHandler(ctx echo.Context) error {
// @Success 200 {object} models.BasicResponse "Successfully migrated data"
// @Failure 400 {object} models.BasicResponse "Invalid Request"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /migration/nrdbms [post]
// @Router /migrate/nrdbms [post]
func MigrationNRDBMSPostHandler(ctx echo.Context) error {
start := time.Now()

Expand Down Expand Up @@ -125,11 +125,11 @@ func MigrationNRDBMSPostHandler(ctx echo.Context) error {
// @Success 200 {object} models.BasicResponse "Successfully migrated data"
// @Failure 400 {object} models.BasicResponse "Invalid Request"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /migration/rdbms [post]
// @Router /migrate/rdbms [post]
func MigrationRDBMSPostHandler(ctx echo.Context) error {
start := time.Now()

logger, logstrings := pageLogInit(ctx, "migration", "Migration linux RDBMS to RDBMS", start)
logger, logstrings := pageLogInit(ctx, "migrate", "Migration linux RDBMS to RDBMS", start)

params := models.DataTask{}
if !getDataWithReBind(logger, start, ctx, &params) {
Expand Down
206 changes: 103 additions & 103 deletions websrc/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -721,9 +721,9 @@ const docTemplate = `{
}
}
},
"/migrate/{id}": {
"get": {
"description": "Get the details of a Task using its ID.",
"/migrate/nrdbms": {
"post": {
"description": "Migrate data from NRDBMS to NRDBMS.",
"consumes": [
"application/json"
],
Expand All @@ -733,34 +733,44 @@ const docTemplate = `{
"tags": [
"[Migrate]"
],
"summary": "Get a Task by ID",
"operationId": "GetMigrateHandler",
"summary": "Migrate data from NRDBMS to NRDBMS",
"operationId": "MigrationNRDBMSPostHandler",
"parameters": [
{
"type": "string",
"description": "Task ID",
"name": "id",
"in": "path",
"required": true
"description": "Parameters required for migration",
"name": "RequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.MigrateTask"
}
}
],
"responses": {
"200": {
"description": "Successfully retrieved a Task",
"description": "Successfully migrated data",
"schema": {
"$ref": "#/definitions/models.Task"
"$ref": "#/definitions/models.BasicResponse"
}
},
"404": {
"description": "Task not found",
"400": {
"description": "Invalid Request",
"schema": {
"$ref": "#/definitions/models.BasicResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/models.BasicResponse"
}
}
}
},
"put": {
"description": "Update the details of an existing Task using its ID.",
}
},
"/migrate/objectstorage": {
"post": {
"description": "Migrate data from ObjectStorage to ObjectStorage.",
"consumes": [
"application/json"
],
Expand All @@ -770,35 +780,28 @@ const docTemplate = `{
"tags": [
"[Migrate]"
],
"summary": "Update an existing Task",
"operationId": "UpdateMigrateHandler",
"summary": "Migrate data from ObjectStorage to ObjectStorage",
"operationId": "MigrationObjectstoragePostHandler",
"parameters": [
{
"type": "string",
"description": "Task ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Parameters required for updating a Task",
"description": "Parameters required for migration",
"name": "RequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Schedule"
"$ref": "#/definitions/models.MigrateTask"
}
}
],
"responses": {
"200": {
"description": "Successfully updated the Task",
"description": "Successfully migrated data",
"schema": {
"$ref": "#/definitions/models.BasicResponse"
}
},
"404": {
"description": "Task not found",
"400": {
"description": "Invalid Request",
"schema": {
"$ref": "#/definitions/models.BasicResponse"
}
Expand All @@ -810,45 +813,11 @@ const docTemplate = `{
}
}
}
},
"delete": {
"description": "Delete an existing Task using its ID.",
"produces": [
"application/json"
],
"tags": [
"[Migrate]"
],
"summary": "Delete a Task",
"operationId": "DeleteMigratekHandler",
"parameters": [
{
"type": "string",
"description": "Task ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Successfully deleted the Task",
"schema": {
"$ref": "#/definitions/models.BasicResponse"
}
},
"404": {
"description": "Task not found",
"schema": {
"$ref": "#/definitions/models.BasicResponse"
}
}
}
}
},
"/migration/nrdbms": {
"/migrate/rdbms": {
"post": {
"description": "Migrate data from NRDBMS to NRDBMS.",
"description": "Migrate data from RDBMS to RDBMS.",
"consumes": [
"application/json"
],
Expand All @@ -858,8 +827,8 @@ const docTemplate = `{
"tags": [
"[Migrate]"
],
"summary": "Migrate data from NRDBMS to NRDBMS",
"operationId": "MigrationNRDBMSPostHandler",
"summary": "Migrate data from RDBMS to RDBMS",
"operationId": "MigrationRDBMSPostHandler",
"parameters": [
{
"description": "Parameters required for migration",
Expand Down Expand Up @@ -893,9 +862,9 @@ const docTemplate = `{
}
}
},
"/migration/objectstorage": {
"post": {
"description": "Migrate data from ObjectStorage to ObjectStorage.",
"/migrate/{id}": {
"get": {
"description": "Get the details of a Task using its ID.",
"consumes": [
"application/json"
],
Expand All @@ -905,44 +874,34 @@ const docTemplate = `{
"tags": [
"[Migrate]"
],
"summary": "Migrate data from ObjectStorage to ObjectStorage",
"operationId": "MigrationObjectstoragePostHandler",
"summary": "Get a Task by ID",
"operationId": "GetMigrateHandler",
"parameters": [
{
"description": "Parameters required for migration",
"name": "RequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.MigrateTask"
}
"type": "string",
"description": "Task ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Successfully migrated data",
"schema": {
"$ref": "#/definitions/models.BasicResponse"
}
},
"400": {
"description": "Invalid Request",
"description": "Successfully retrieved a Task",
"schema": {
"$ref": "#/definitions/models.BasicResponse"
"$ref": "#/definitions/models.Task"
}
},
"500": {
"description": "Internal Server Error",
"404": {
"description": "Task not found",
"schema": {
"$ref": "#/definitions/models.BasicResponse"
}
}
}
}
},
"/migration/rdbms": {
"post": {
"description": "Migrate data from RDBMS to RDBMS.",
},
"put": {
"description": "Update the details of an existing Task using its ID.",
"consumes": [
"application/json"
],
Expand All @@ -952,28 +911,35 @@ const docTemplate = `{
"tags": [
"[Migrate]"
],
"summary": "Migrate data from RDBMS to RDBMS",
"operationId": "MigrationRDBMSPostHandler",
"summary": "Update an existing Task",
"operationId": "UpdateMigrateHandler",
"parameters": [
{
"description": "Parameters required for migration",
"type": "string",
"description": "Task ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Parameters required for updating a Task",
"name": "RequestBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.MigrateTask"
"$ref": "#/definitions/models.Schedule"
}
}
],
"responses": {
"200": {
"description": "Successfully migrated data",
"description": "Successfully updated the Task",
"schema": {
"$ref": "#/definitions/models.BasicResponse"
}
},
"400": {
"description": "Invalid Request",
"404": {
"description": "Task not found",
"schema": {
"$ref": "#/definitions/models.BasicResponse"
}
Expand All @@ -985,6 +951,40 @@ const docTemplate = `{
}
}
}
},
"delete": {
"description": "Delete an existing Task using its ID.",
"produces": [
"application/json"
],
"tags": [
"[Migrate]"
],
"summary": "Delete a Task",
"operationId": "DeleteMigratekHandler",
"parameters": [
{
"type": "string",
"description": "Task ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Successfully deleted the Task",
"schema": {
"$ref": "#/definitions/models.BasicResponse"
}
},
"404": {
"description": "Task not found",
"schema": {
"$ref": "#/definitions/models.BasicResponse"
}
}
}
}
},
"/restore": {
Expand Down
Loading

0 comments on commit 0741819

Please sign in to comment.