Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions api/dms/service/v1/statistic.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package v1

import base "github.com/actiontech/dms/pkg/dms-common/api/base/v1"

// swagger:parameters GetCBDbServiceStatistic
type GetCBDbServiceStatisticReq struct {
// project id
// Required: true
// in:path
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
}

// swagger:model GetCBDbServiceStatisticReply
type GetCBDbServiceStatisticReply struct {
// Generic reply
base.GenericResp
Data []*CbDbServiceStatistic `json:"data"`
}

type CbDbServiceStatistic struct {
Name string `json:"name"`
Count int64 `json:"count"`
Content []*CbDbServiceStatisticContent `json:"content"`
}

type CbDbServiceStatisticContent struct {
Schema string `json:"schema"`
Table string `json:"table"`
Count int64 `json:"count"`
}

// swagger:parameters GetCBOperationStatistic
type GetCBOperationStatisticReq struct {
// project id
// Required: true
// in:path
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
}

// swagger:model GetCBOperationStatisticReply
type GetCBOperationStatisticReply struct {
// Generic reply
base.GenericResp
Data []*CbOperationStatistic `json:"data"`
}

type CbOperationStatistic struct {
OperationType string `json:"operation_type"`
OperationCount int64 `json:"operation_count"`
}
200 changes: 185 additions & 15 deletions api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -3315,6 +3315,72 @@
}
}
},
"/v1/dms/projects/{project_uid}/statistic/cb_db_services": {
"get": {
"tags": [
"statistic"
],
"summary": "Get cb db service statistic.",
"operationId": "GetCBDbServiceStatistic",
"parameters": [
{
"type": "string",
"x-go-name": "ProjectUid",
"description": "project id",
"name": "project_uid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "GetCBDbServiceStatisticReply",
"schema": {
"$ref": "#/definitions/GetCBDbServiceStatisticReply"
}
},
"default": {
"description": "GenericResp",
"schema": {
"$ref": "#/definitions/GenericResp"
}
}
}
}
},
"/v1/dms/projects/{project_uid}/statistic/cb_operations": {
"get": {
"tags": [
"statistic"
],
"summary": "Get cb operation statistic.",
"operationId": "GetCBOperationStatistic",
"parameters": [
{
"type": "string",
"x-go-name": "ProjectUid",
"description": "project id",
"name": "project_uid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "GetCBOperationStatisticReply",
"schema": {
"$ref": "#/definitions/GetCBOperationStatisticReply"
}
},
"default": {
"description": "GenericResp",
"schema": {
"$ref": "#/definitions/GenericResp"
}
}
}
}
},
"/v1/dms/projects/{project_uid}/unarchive": {
"put": {
"tags": [
Expand Down Expand Up @@ -4738,6 +4804,19 @@
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"CBOperationLogTips": {
"type": "object",
"properties": {
"exec_result": {
"type": "array",
"items": {
"type": "string"
},
"x-go-name": "ExecResult"
}
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"CancelDataExportWorkflowPayload": {
"type": "object",
"required": [
Expand All @@ -4754,6 +4833,62 @@
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"CbDbServiceStatistic": {
"type": "object",
"properties": {
"content": {
"type": "array",
"items": {
"$ref": "#/definitions/CbDbServiceStatisticContent"
},
"x-go-name": "Content"
},
"count": {
"type": "integer",
"format": "int64",
"x-go-name": "Count"
},
"name": {
"type": "string",
"x-go-name": "Name"
}
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"CbDbServiceStatisticContent": {
"type": "object",
"properties": {
"count": {
"type": "integer",
"format": "int64",
"x-go-name": "Count"
},
"schema": {
"type": "string",
"x-go-name": "Schema"
},
"table": {
"type": "string",
"x-go-name": "Table"
}
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"CbOperationStatistic": {
"type": "object",
"properties": {
"operation_count": {
"type": "integer",
"format": "int64",
"x-go-name": "OperationCount"
},
"operation_type": {
"type": "string",
"x-go-name": "OperationType"
}
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"CheckDBServiceIsConnectableReply": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -5328,6 +5463,30 @@
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"GetCBDbServiceStatisticReply": {
"type": "object",
"properties": {
"code": {
"description": "code",
"type": "integer",
"format": "int64",
"x-go-name": "Code"
},
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/CbDbServiceStatistic"
},
"x-go-name": "Data"
},
"message": {
"description": "message",
"type": "string",
"x-go-name": "Message"
}
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"GetCBOperationLogTipsReply": {
"type": "object",
"properties": {
Expand All @@ -5338,7 +5497,31 @@
"x-go-name": "Code"
},
"data": {
"$ref": "#/definitions/cBOperationLogTips"
"$ref": "#/definitions/CBOperationLogTips"
},
"message": {
"description": "message",
"type": "string",
"x-go-name": "Message"
}
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"GetCBOperationStatisticReply": {
"type": "object",
"properties": {
"code": {
"description": "code",
"type": "integer",
"format": "int64",
"x-go-name": "Code"
},
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/CbOperationStatistic"
},
"x-go-name": "Data"
},
"message": {
"description": "message",
Expand Down Expand Up @@ -8381,7 +8564,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 @@ -9062,19 +9245,6 @@
}
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"cBOperationLogTips": {
"type": "object",
"properties": {
"exec_result": {
"type": "array",
"items": {
"type": "string"
},
"x-go-name": "ExecResult"
}
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
}
},
"responses": {
Expand Down
Loading