Skip to content

Commit

Permalink
Merge pull request #34 from cloud-barista/feature/add-mig-params
Browse files Browse the repository at this point in the history
add gcpCredentialJson to migrationForm
  • Loading branch information
heedaeshin authored Aug 26, 2024
2 parents 4cce722 + b514114 commit 90cb38e
Show file tree
Hide file tree
Showing 10 changed files with 212 additions and 66 deletions.
8 changes: 4 additions & 4 deletions websrc/controllers/generateHandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ func GenerateS3PostHandler(ctx echo.Context) error {
// @Tags [Test Data Generation]
// @Accept multipart/form-data
// @Produce json
// @Param RequestBody formData GenDataParams true "Parameters required to generate test data"
// @Param gcpCredential formData file false "Parameters required to generate test data"
// @Param RequestBody formData GenDataParams true "Parameters required to generate test data"
// @Param gcpCredential formData file false "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully generated test data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /generate/gcp [post]
Expand Down Expand Up @@ -483,8 +483,8 @@ func GenerateDynamoDBPostHandler(ctx echo.Context) error {
// @Tags [Test Data Generation]
// @Accept multipart/form-data
// @Produce json
// @Param GenFirestoreParams formData GenFirestoreParams true "Parameters required to generate test data"
// @Param gcpCredential formData file false "Parameters required to generate test data"
// @Param GenFirestoreParams formData GenFirestoreParams true "Parameters required to generate test data"
// @Param gcpCredential formData file false "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully generated test data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /generate/firestore [post]
Expand Down
16 changes: 8 additions & 8 deletions websrc/controllers/migrationGCPHandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import (
// @Tags [Data Migration]
// @Accept multipart/form-data
// @Produce json
// @Param RequestBody formData MigrationForm true "Parameters required for migration"
// @Param gcpCredential formData file false "Parameters required for migration"
// @Param RequestBody formData MigrationForm true "Parameters required for migration"
// @Param gcpCredential formData file false "Parameters required for migration"
// @Success 200 {object} models.BasicResponse "Successfully migrated data"
// @Failure 400 {object} models.BasicResponse "Invalid Request"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
Expand Down Expand Up @@ -97,8 +97,8 @@ func MigrationGCPToLinuxPostHandler(ctx echo.Context) error {
// @Tags [Data Migration]
// @Accept multipart/form-data
// @Produce json
// @Param RequestBody formData MigrationForm true "Parameters required for migration"
// @Param gcpCredential formData file false "Parameters required for migration"
// @Param RequestBody formData MigrationForm true "Parameters required for migration"
// @Param gcpCredential formData file false "Parameters required for migration"
// @Success 200 {object} models.BasicResponse "Successfully migrated data"
// @Failure 400 {object} models.BasicResponse "Invalid Request"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
Expand Down Expand Up @@ -163,8 +163,8 @@ func MigrationGCPToWindowsPostHandler(ctx echo.Context) error {
// @Tags [Data Migration]
// @Accept multipart/form-data
// @Produce json
// @Param RequestBody formData MigrationForm true "Parameters required for migration"
// @Param gcpCredential formData file false "Parameters required for migration"
// @Param RequestBody formData MigrationForm true "Parameters required for migration"
// @Param gcpCredential formData file false "Parameters required for migration"
// @Success 200 {object} models.BasicResponse "Successfully migrated data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /migration/gcp/s3 [post]
Expand Down Expand Up @@ -234,8 +234,8 @@ func MigrationGCPToS3PostHandler(ctx echo.Context) error {
// @Tags [Data Migration]
// @Accept multipart/form-data
// @Produce json
// @Param RequestBody formData MigrationForm true "Parameters required for migration"
// @Param gcpCredential formData file false "Parameters required for migration"
// @Param RequestBody formData MigrationForm true "Parameters required for migration"
// @Param gcpCredential formData file false "Parameters required for migration"
// @Success 200 {object} models.BasicResponse "Successfully migrated data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /migration/gcp/ncp [post]
Expand Down
8 changes: 4 additions & 4 deletions websrc/controllers/migrationHandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ func MigrationLinuxToS3PostHandler(ctx echo.Context) error {
// @Tags [Data Migration]
// @Accept multipart/form-data
// @Produce json
// @Param RequestBody formData MigrationForm true "Parameters required for migration"
// @Param gcpCredential formData file false "Parameters required for migration"
// @Param RequestBody formData MigrationForm true "Parameters required for migration"
// @Param gcpCredential formData file false "Parameters required for migration"
// @Success 200 {object} models.BasicResponse "Successfully migrated data"
// @Failure 400 {object} models.BasicResponse "Invalid Request"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
Expand Down Expand Up @@ -273,8 +273,8 @@ func MigrationWindowsToS3PostHandler(ctx echo.Context) error {
// @Tags [Data Migration]
// @Accept multipart/form-data
// @Produce json
// @Param RequestBody formData MigrationForm true "Parameters required for migration"
// @Param gcpCredential formData file false "Parameters required for migration"
// @Param RequestBody formData MigrationForm true "Parameters required for migration"
// @Param gcpCredential formData file false "Parameters required for migration"
// @Success 200 {object} models.BasicResponse "Successfully migrated data"
// @Failure 400 {object} models.BasicResponse "Invalid Request"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
Expand Down
4 changes: 2 additions & 2 deletions websrc/controllers/migrationNCPHandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ func MigrationNCPToS3PostHandler(ctx echo.Context) error {
// @Tags [Data Migration]
// @Accept multipart/form-data
// @Produce json
// @Param RequestBody formData MigrationForm true "Parameters required for migration"
// @Param gcpCredential formData file true "Parameters required to generate test data"
// @Param RequestBody formData MigrationForm true "Parameters required for migration"
// @Param gcpCredential formData file false "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully migrated data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /migration/ncp/gcp [post]
Expand Down
28 changes: 14 additions & 14 deletions websrc/controllers/migrationNoSqlHandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import (
// @Tags [Data Migration]
// @Accept multipart/form-data
// @Produce json
// @Param AWSMigrationParams formData AWSMigrationParams true "Parameters required for Linux migration"
// @Param GCPMigrationParams formData GCPMigrationParams true "Parameters required for GCP migration"
// @Param gcpCredential formData file true "Parameters required to generate test data"
// @Param AWSMigrationParams formData AWSMigrationParams true "Parameters required for Linux migration"
// @Param GCPMigrationParams formData GCPMigrationParams true "Parameters required for GCP migration"
// @Param gcpCredential formData file false "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully migrated data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /migration/dynamodb/firestore [post]
Expand Down Expand Up @@ -100,8 +100,8 @@ func MigrationDynamoDBToFirestorePostHandler(ctx echo.Context) error {
// @Tags [Data Migration]
// @Accept json
// @Produce json
// @Param AWSMigrationParams body AWSMigrationParams true "Parameters required for AWS migration"
// @Param MongoMigrationParams body MongoMigrationParams true "Parameters required for NCP migration"
// @Param AWSMigrationParams body AWSMigrationParams true "Parameters required for AWS migration"
// @Param MongoMigrationParams body MongoMigrationParams true "Parameters required for NCP migration"
// @Success 200 {object} models.BasicResponse "Successfully migrated data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /migration/dynamodb/mongodb [post]
Expand Down Expand Up @@ -159,9 +159,9 @@ func MigrationDynamoDBToMongoDBPostHandler(ctx echo.Context) error {
// @Tags [Data Migration]
// @Accept multipart/form-data
// @Produce json
// @Param GCPMigrationParams formData GCPMigrationParams true "Parameters required for GCP migration"
// @Param AWSMigrationParams formData AWSMigrationParams true "Parameters required for AWS migration"
// @Param gcpCredential formData file true "Parameters required to generate test data"
// @Param GCPMigrationParams formData GCPMigrationParams true "Parameters required for GCP migration"
// @Param AWSMigrationParams formData AWSMigrationParams true "Parameters required for AWS migration"
// @Param gcpCredential formData file false "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully migrated data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /migration/firestore/dynamodb [post]
Expand Down Expand Up @@ -229,9 +229,9 @@ func MigrationFirestoreToDynamoDBPostHandler(ctx echo.Context) error {
// @Tags [Data Migration]
// @Accept multipart/form-data
// @Produce json
// @Param GCPMigrationParams formData GCPMigrationParams true "Parameters required for GCP migration"
// @Param MongoMigrationParams formData MongoMigrationParams true "Parameters required for NCP migration"
// @Param gcpCredential formData file true "Parameters required to generate test data"
// @Param GCPMigrationParams formData GCPMigrationParams true "Parameters required for GCP migration"
// @Param MongoMigrationParams formData MongoMigrationParams true "Parameters required for NCP migration"
// @Param gcpCredential formData file false "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully migrated data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /migration/firestore/mongodb [post]
Expand Down Expand Up @@ -359,9 +359,9 @@ func MigrationMongoDBToDynamoDBPostHandler(ctx echo.Context) error {
// @Tags [Data Migration]
// @Accept multipart/form-data
// @Produce json
// @Param MongoMigrationParams formData MongoMigrationParams true "Parameters required for NCP migration"
// @Param GCPMigrationParams formData GCPMigrationParams true "Parameters required for GCP migration"
// @Param gcpCredential formData file true "Parameters required to generate test data"
// @Param MongoMigrationParams formData MongoMigrationParams true "Parameters required for NCP migration"
// @Param GCPMigrationParams formData GCPMigrationParams true "Parameters required for GCP migration"
// @Param gcpCredential formData file false "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully migrated data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /migration/mongodb/firestore [post]
Expand Down
4 changes: 2 additions & 2 deletions websrc/controllers/migrationS3Handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ func MigrationS3ToWindowsPostHandler(ctx echo.Context) error {
// @Tags [Data Migration]
// @Accept multipart/form-data
// @Produce json
// @Param RequestBody formData MigrationForm true "Parameters required for migration"
// @Param gcpCredential formData file true "Parameters required to generate test data"
// @Param RequestBody formData MigrationForm true "Parameters required for migration"
// @Param gcpCredential formData file false "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully migrated data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /migration/s3/gcp [post]
Expand Down
4 changes: 2 additions & 2 deletions websrc/controllers/migrationStructs.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type MigrationForm struct {
DatabaseID string `json:"databaseId" form:"databaseId"`
GCPRegion string `form:"gcpRegion" json:"gcpRegion"`
GCPBucket string `form:"gcpBucket" json:"gcpBucket"`
GCPCredentialJson string `form:"gcpCredentialJson" json:"gcpCredentialJson" swaggerignore:"true"`
GCPCredentialJson string `form:"gcpCredentialJson" json:"gcpCredentialJson"`
GCPCredential *multipart.FileHeader `form:"gcpCredential" json:"-" swaggerignore:"true"`

NCPRegion string `form:"ncpRegion" json:"ncpRegion"`
Expand Down Expand Up @@ -63,7 +63,7 @@ type GCPMigrationParams struct {
DatabaseID string `json:"databaseId" form:"databaseId"`
GCPRegion string `form:"gcpRegion" json:"gcpRegion"`
GCPBucket string `form:"gcpBucket" json:"gcpBucket"`
GCPCredentialJson string `form:"gcpCredentialJson" json:"gcpCredentialJson" swaggerignore:"true"`
GCPCredentialJson string `form:"gcpCredentialJson" json:"gcpCredentialJson"`
GCPCredential *multipart.FileHeader `form:"gcpCredential" json:"-" swaggerignore:"true"`
}

Expand Down
Loading

0 comments on commit 90cb38e

Please sign in to comment.