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 1517070
Show file tree
Hide file tree
Showing 5 changed files with 367 additions and 10 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"`
}
175 changes: 170 additions & 5 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 Down Expand Up @@ -5328,6 +5407,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 +5441,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 @@ -9063,15 +9190,53 @@
},
"x-go-package": "github.com/actiontech/dms/api/dms/service/v1"
},
"cBOperationLogTips": {
"cbDbServiceStatistic": {
"type": "object",
"properties": {
"exec_result": {
"content": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/cbDbServiceStatisticContent"
},
"x-go-name": "ExecResult"
"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"
Expand Down
Loading

0 comments on commit 1517070

Please sign in to comment.