Skip to content

Commit

Permalink
Merge pull request #273 from actiontech/feat-overview-of-global-DBSer…
Browse files Browse the repository at this point in the history
…vices-ce

全局数据源总览新增接口
  • Loading branch information
LordofAvernus authored Jul 10, 2024
2 parents a7d1750 + 17d53b9 commit 9d19f7b
Show file tree
Hide file tree
Showing 6 changed files with 512 additions and 0 deletions.
59 changes: 59 additions & 0 deletions api/dms/service/v1/db_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,3 +310,62 @@ type ImportDBServicesCheckReply struct {
// Generic reply
base.GenericResp
}

// swagger:parameters ListGlobalDBServices
type ListGlobalDBServicesReq struct {
// the maximum count of db service to be returned
// in:query
// Required: true
PageSize uint32 `query:"page_size" json:"page_size" validate:"required"`
// the offset of users to be returned, default is 0
// in:query
PageIndex uint32 `query:"page_index" json:"page_index"`
// Multiple of ["name"], default is ["name"]
// in:query
OrderBy dmsCommonV1.DBServiceOrderByField `query:"order_by" json:"order_by"`
// the db service business name
// in:query
FilterByBusiness string `query:"filter_by_business" json:"filter_by_business"`
// the db service host
// in:query
FilterByHost string `query:"filter_by_host" json:"filter_by_host"`
// the db service uid
// in:query
FilterByUID string `query:"filter_by_uid" json:"filter_by_uid"`
// the db service name
// in:query
FilterByName string `query:"filter_by_name" json:"filter_by_name"`
// the db service port
// in:query
FilterByPort string `query:"filter_by_port" json:"filter_by_port"`
// the db service db type
// in:query
FilterByDBType string `query:"filter_by_db_type" json:"filter_by_db_type"`
// the db service project id
// in:query
FilterByProjectUid string `query:"filter_by_project_uid" json:"filter_by_project_uid"`
// the db service fuzzy keyword
// in:query
FuzzyKeyword string `query:"fuzzy_keyword" json:"fuzzy_keyword"`
// is masking
// in:query
IsEnableMasking *bool `query:"is_enable_masking" json:"is_enable_masking"`
}

// swagger:model ListGlobalDBServicesReply
type ListGlobalDBServicesReply struct {
// List global db service reply
Data []*ListGlobalDBService `json:"data"`
Total int64 `json:"total_nums"`

// Generic reply
base.GenericResp
}

type ListGlobalDBService struct {
dmsCommonV1.ListDBService
// db service project_name
ProjectName string `json:"project_name"`
// db service unfinished workflow num
UnfinishedWorkflowNum int64 `json:"unfinished_workflow_num"`
}
242 changes: 242 additions & 0 deletions api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,122 @@
}
}
},
"/v1/dms/db_services": {
"get": {
"description": "list global DBServices",
"tags": [
"DBService"
],
"operationId": "ListGlobalDBServices",
"parameters": [
{
"type": "integer",
"format": "uint32",
"x-go-name": "PageSize",
"description": "the maximum count of db service to be returned",
"name": "page_size",
"in": "query",
"required": true
},
{
"type": "integer",
"format": "uint32",
"x-go-name": "PageIndex",
"description": "the offset of users to be returned, default is 0",
"name": "page_index",
"in": "query"
},
{
"enum": [
"name"
],
"type": "string",
"x-go-enum-desc": "name DBServiceOrderByName",
"x-go-name": "OrderBy",
"description": "Multiple of [\"name\"], default is [\"name\"]\nname DBServiceOrderByName",
"name": "order_by",
"in": "query"
},
{
"type": "string",
"x-go-name": "FilterByBusiness",
"description": "the db service business name",
"name": "filter_by_business",
"in": "query"
},
{
"type": "string",
"x-go-name": "FilterByHost",
"description": "the db service host",
"name": "filter_by_host",
"in": "query"
},
{
"type": "string",
"x-go-name": "FilterByUID",
"description": "the db service uid",
"name": "filter_by_uid",
"in": "query"
},
{
"type": "string",
"x-go-name": "FilterByName",
"description": "the db service name",
"name": "filter_by_name",
"in": "query"
},
{
"type": "string",
"x-go-name": "FilterByPort",
"description": "the db service port",
"name": "filter_by_port",
"in": "query"
},
{
"type": "string",
"x-go-name": "FilterByDBType",
"description": "the db service db type",
"name": "filter_by_db_type",
"in": "query"
},
{
"type": "string",
"x-go-name": "FilterByProjectUid",
"description": "the db service project id",
"name": "filter_by_project_uid",
"in": "query"
},
{
"type": "string",
"x-go-name": "FuzzyKeyword",
"description": "the db service fuzzy keyword",
"name": "fuzzy_keyword",
"in": "query"
},
{
"type": "boolean",
"x-go-name": "IsEnableMasking",
"description": "is masking",
"name": "is_enable_masking",
"in": "query"
}
],
"responses": {
"200": {
"description": "ListGlobalDBServicesReply",
"schema": {
"$ref": "#/definitions/ListGlobalDBServicesReply"
}
},
"default": {
"description": "GenericResp",
"schema": {
"$ref": "#/definitions/GenericResp"
}
}
}
}
},
"/v1/dms/db_services/driver_options": {
"get": {
"tags": [
Expand Down Expand Up @@ -7492,6 +7608,132 @@
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"ListGlobalDBService": {
"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_name": {
"description": "db service project_name",
"type": "string",
"x-go-name": "ProjectName"
},
"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"
},
"uid": {
"description": "db service uid",
"type": "string",
"x-go-name": "DBServiceUid"
},
"unfinished_workflow_num": {
"description": "db service unfinished workflow num",
"type": "integer",
"format": "int64",
"x-go-name": "UnfinishedWorkflowNum"
},
"user": {
"description": "db service admin user",
"type": "string",
"x-go-name": "User"
}
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"ListGlobalDBServicesReply": {
"type": "object",
"properties": {
"code": {
"description": "code",
"type": "integer",
"format": "int64",
"x-go-name": "Code"
},
"data": {
"description": "List global db service reply",
"type": "array",
"items": {
"$ref": "#/definitions/ListGlobalDBService"
},
"x-go-name": "Data"
},
"message": {
"description": "message",
"type": "string",
"x-go-name": "Message"
},
"total_nums": {
"type": "integer",
"format": "int64",
"x-go-name": "Total"
}
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"ListMaskingRulesData": {
"type": "object",
"properties": {
Expand Down
Loading

0 comments on commit 9d19f7b

Please sign in to comment.