Skip to content

Commit

Permalink
Merge pull request #299 from actiontech/main
Browse files Browse the repository at this point in the history
sync-Main
  • Loading branch information
BugsGuru authored Jun 14, 2024
2 parents a97eb22 + 39ef672 commit 33575aa
Show file tree
Hide file tree
Showing 5 changed files with 298 additions and 104 deletions.
45 changes: 38 additions & 7 deletions api/dms/service/v1/db_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,35 @@ type ImportDBServicesOfOneProjectCheckReq struct {
DBServicesFile *bytes.Buffer `json:"db_services_file"`
}

// swagger:model ImportDBServicesCheckReply
type ImportDBServicesCheckReply struct {
// db services
Data []*DBService `json:"data"`
// Generic reply
base.GenericResp
type ImportDBService struct {
// db service name
Name string `json:"name"`
// db service DB type
DBType string `json:"db_type"`
// db service host
Host string `json:"host"`
// db service port
Port string `json:"port"`
// db service admin user
User string `json:"user"`
// db service admin encrypted password
Password string `json:"password"`
// the db service business name
Business string `json:"business"`
// DB Service maintenance time
MaintenanceTimes []*dmsCommonV1.MaintenanceTime `json:"maintenance_times"`
// DB desc
Desc string `json:"desc"`
// DB source
Source string `json:"source"`
// DB project uid
ProjectUID string `json:"project_uid"`
// sqle config
SQLEConfig *dmsCommonV1.SQLEConfig `json:"sqle_config"`
// DB Service Custom connection parameters
AdditionalParams []*dmsCommonV1.AdditionalParam `json:"additional_params"`
// is enable masking
IsEnableMasking bool `json:"is_enable_masking"`
}

// swagger:parameters ImportDBServicesOfOneProject
Expand All @@ -300,5 +323,13 @@ type ImportDBServicesOfOneProjectReq struct {
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
// new db services
// in:body
DBServices []DBService `json:"db_services" validate:"required"`
DBServices []ImportDBService `json:"db_services" validate:"required"`
}

// swagger:model ImportDBServicesCheckReply
type ImportDBServicesCheckReply struct {
// db services
Data []*ImportDBService `json:"data"`
// Generic reply
base.GenericResp
}
8 changes: 5 additions & 3 deletions api/dms/service/v1/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ type UnarchiveProjectReq struct {

// swagger:parameters ImportProjects
type ImportProjectsReq struct {
// import projects
// in:body
Projects []*ImportProjects `json:"projects" validate:"required"`
}

Expand Down Expand Up @@ -232,7 +234,7 @@ type ImportDBServicesCheckCsvReply struct {
type ImportDBServicesOfProjectsReq struct {
// new db services
// in:body
DBServices []DBService `json:"db_services" validate:"required"`
DBServices []ImportDBService `json:"db_services" validate:"required"`
}

type CheckDbsConnectable struct {
Expand Down Expand Up @@ -281,10 +283,10 @@ type DBServicesConnectionItem struct {
FailedNames []string `json:"failed_names"`
}

// swagger:response DBServicesConnectionReply
// swagger:model DBServicesConnectionReply
type DBServicesConnectionReply struct {
// Generic reply
base.GenericResp
// connection result
Data []*DBServicesConnectionItem `json:"data"`
Data *DBServicesConnectionItem `json:"data"`
}
181 changes: 138 additions & 43 deletions api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1120,9 +1120,6 @@
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"dms"
],
Expand All @@ -1142,8 +1139,17 @@
}
],
"responses": {
"200": {
"description": "DBServicesConnectionReply",
"schema": {
"$ref": "#/definitions/DBServicesConnectionReply"
}
},
"default": {
"$ref": "#/responses/DBServicesConnectionReply"
"description": "GenericResp",
"schema": {
"$ref": "#/definitions/GenericResp"
}
}
}
}
Expand Down Expand Up @@ -1204,13 +1210,16 @@
"operationId": "ImportProjects",
"parameters": [
{
"type": "array",
"items": {
"$ref": "#/definitions/ImportProjects"
},
"x-go-name": "Projects",
"description": "import projects",
"name": "projects",
"in": "query"
"in": "body",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/ImportProjects"
}
}
}
],
"responses": {
Expand Down Expand Up @@ -1251,12 +1260,18 @@
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/DBService"
"$ref": "#/definitions/ImportDBService"
}
}
}
],
"responses": {
"200": {
"description": "GenericResp",
"schema": {
"$ref": "#/definitions/GenericResp"
}
},
"default": {
"description": "GenericResp",
"schema": {
Expand Down Expand Up @@ -2752,9 +2767,6 @@
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"dms"
],
Expand All @@ -2776,12 +2788,18 @@
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/DBService"
"$ref": "#/definitions/ImportDBService"
}
}
}
],
"responses": {
"200": {
"description": "GenericResp",
"schema": {
"$ref": "#/definitions/GenericResp"
}
},
"default": {
"description": "GenericResp",
"schema": {
Expand Down Expand Up @@ -5300,6 +5318,26 @@
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"DBServicesConnectionReply": {
"type": "object",
"properties": {
"code": {
"description": "code",
"type": "integer",
"format": "int64",
"x-go-name": "Code"
},
"data": {
"$ref": "#/definitions/DBServicesConnectionItem"
},
"message": {
"description": "message",
"type": "string",
"x-go-name": "Message"
}
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"DMSProxyTarget": {
"description": "A dms proxy target",
"type": "object",
Expand Down Expand Up @@ -6217,15 +6255,14 @@
"$ref": "#/definitions/AccessTokenInfo"
},
"authentication_type": {
"description": "user authentication type\nldap UserAuthenticationTypeLDAP\ndms UserAuthenticationTypeDMS\noauth2 UserAuthenticationTypeOAUTH2\nunknown UserAuthenticationTypeUnknown",
"description": "user authentication type\nldap UserAuthenticationTypeLDAP\noauth2 UserAuthenticationTypeOAUTH2\nunknown UserAuthenticationTypeUnknown",
"type": "string",
"enum": [
"ldap",
"dms",
"oauth2",
"unknown"
],
"x-go-enum-desc": "ldap UserAuthenticationTypeLDAP\ndms UserAuthenticationTypeDMS\noauth2 UserAuthenticationTypeOAUTH2\nunknown UserAuthenticationTypeUnknown",
"x-go-enum-desc": "ldap UserAuthenticationTypeLDAP\noauth2 UserAuthenticationTypeOAUTH2\nunknown UserAuthenticationTypeUnknown",
"x-go-name": "AuthenticationType"
},
"email": {
Expand Down Expand Up @@ -6489,6 +6526,86 @@
},
"x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
},
"ImportDBService": {
"type": "object",
"properties": {
"additional_params": {
"description": "DB Service Custom connection parameters",
"type": "array",
"items": {
"$ref": "#/definitions/AdditionalParam"
},
"x-go-name": "AdditionalParams"
},
"business": {
"description": "the db service business name",
"type": "string",
"x-go-name": "Business"
},
"db_type": {
"description": "db service DB type",
"type": "string",
"x-go-name": "DBType"
},
"desc": {
"description": "DB desc",
"type": "string",
"x-go-name": "Desc"
},
"host": {
"description": "db service host",
"type": "string",
"x-go-name": "Host"
},
"is_enable_masking": {
"description": "is enable masking",
"type": "boolean",
"x-go-name": "IsEnableMasking"
},
"maintenance_times": {
"description": "DB Service maintenance time",
"type": "array",
"items": {
"$ref": "#/definitions/MaintenanceTime"
},
"x-go-name": "MaintenanceTimes"
},
"name": {
"description": "db service name",
"type": "string",
"x-go-name": "Name"
},
"password": {
"description": "db service admin encrypted password",
"type": "string",
"x-go-name": "Password"
},
"port": {
"description": "db service port",
"type": "string",
"x-go-name": "Port"
},
"project_uid": {
"description": "DB project uid",
"type": "string",
"x-go-name": "ProjectUID"
},
"source": {
"description": "DB source",
"type": "string",
"x-go-name": "Source"
},
"sqle_config": {
"$ref": "#/definitions/SQLEConfig"
},
"user": {
"description": "db service admin user",
"type": "string",
"x-go-name": "User"
}
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"ImportDBServicesCheckReply": {
"type": "object",
"properties": {
Expand All @@ -6502,7 +6619,7 @@
"description": "db services",
"type": "array",
"items": {
"$ref": "#/definitions/DBService"
"$ref": "#/definitions/ImportDBService"
},
"x-go-name": "Data"
},
Expand Down Expand Up @@ -7707,15 +7824,14 @@
"type": "object",
"properties": {
"authentication_type": {
"description": "user authentication type\nldap UserAuthenticationTypeLDAP\ndms UserAuthenticationTypeDMS\noauth2 UserAuthenticationTypeOAUTH2\nunknown UserAuthenticationTypeUnknown",
"description": "user authentication type\nldap UserAuthenticationTypeLDAP\noauth2 UserAuthenticationTypeOAUTH2\nunknown UserAuthenticationTypeUnknown",
"type": "string",
"enum": [
"ldap",
"dms",
"oauth2",
"unknown"
],
"x-go-enum-desc": "ldap UserAuthenticationTypeLDAP\ndms UserAuthenticationTypeDMS\noauth2 UserAuthenticationTypeOAUTH2\nunknown UserAuthenticationTypeUnknown",
"x-go-enum-desc": "ldap UserAuthenticationTypeLDAP\noauth2 UserAuthenticationTypeOAUTH2\nunknown UserAuthenticationTypeUnknown",
"x-go-name": "AuthenticationType"
},
"email": {
Expand Down Expand Up @@ -8719,7 +8835,7 @@
"x-go-name": "Uid"
}
},
"x-go-package": "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"UpdateCompanyNotice": {
"description": "A companynotice",
Expand Down Expand Up @@ -9403,27 +9519,6 @@
}
},
"responses": {
"DBServicesConnectionReply": {
"description": "",
"headers": {
"code": {
"type": "integer",
"format": "int64",
"description": "code"
},
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/DBServicesConnectionItem"
},
"description": "connection result"
},
"message": {
"type": "string",
"description": "message"
}
}
},
"DownloadDataExportTaskReply": {
"description": "",
"schema": {
Expand Down
Loading

0 comments on commit 33575aa

Please sign in to comment.