Skip to content

Commit

Permalink
feat:Data Object Usage and Overview of Data Object Usage
Browse files Browse the repository at this point in the history
  • Loading branch information
taolx0 committed Jun 4, 2024
1 parent 0f21f13 commit bdf7db2
Show file tree
Hide file tree
Showing 5 changed files with 381 additions and 24 deletions.
49 changes: 49 additions & 0 deletions api/dms/service/v1/statistic.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package v1

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

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

// swagger:model GetCBInstanceStatisticReply
type GetCBInstanceStatisticReply 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"`
}

// 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"`
}
193 changes: 179 additions & 14 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_instances": {
"get": {
"tags": [
"dms"
],
"summary": "Get cb instance statistic.",
"operationId": "GetCBInstanceStatistic",
"parameters": [
{
"type": "string",
"x-go-name": "ProjectUid",
"description": "project id",
"name": "project_uid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "GetCBInstanceStatisticReply",
"schema": {
"$ref": "#/definitions/GetCBInstanceStatisticReply"
}
},
"default": {
"description": "GenericResp",
"schema": {
"$ref": "#/definitions/GenericResp"
}
}
}
}
},
"/v1/dms/projects/{project_uid}/statistic/cb_operations": {
"get": {
"tags": [
"dms"
],
"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,57 @@
},
"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": {
"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 +5458,30 @@
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"GetCBInstanceStatisticReply": {
"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 +5492,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 @@ -9062,19 +9240,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

0 comments on commit bdf7db2

Please sign in to comment.