Skip to content

Commit 5da88d2

Browse files
authored
Merge pull request #8186 from wcy00000000000000/v3.13.x-sync
删除临时的带ID新增数据的API
2 parents 518b926 + 92d89f0 commit 5da88d2

25 files changed

Lines changed: 1 addition & 1042 deletions

File tree

docs/apidoc/apigw/backend/bk_apigw_resources_bk-cmdb.yaml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5878,33 +5878,3 @@ paths:
58785878
userVerifiedRequired: false
58795879
disabledStages: []
58805880
descriptionEn:
5881-
/api/v3/synchronize/create/data:
5882-
post:
5883-
operationId: create_synchronize_data
5884-
description: 新增同步数据
5885-
responses:
5886-
default:
5887-
description: ''
5888-
x-bk-apigateway-resource:
5889-
isPublic: false
5890-
allowApplyPermission: false
5891-
matchSubpath: false
5892-
backend:
5893-
type: HTTP
5894-
method: post
5895-
path: /api/v3/synchronize/create/data
5896-
matchSubpath: false
5897-
timeout: 0
5898-
upstreams: {}
5899-
transformHeaders: {}
5900-
pluginConfigs:
5901-
- type: bk-rate-limit
5902-
yaml: |
5903-
rates:
5904-
__default:
5905-
- period: 1
5906-
tokens: 100
5907-
authConfig:
5908-
userVerifiedRequired: false
5909-
disabledStages: []
5910-
descriptionEn:

pkg/synchronize/types/protocol.go

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,42 +19,10 @@
1919
package types
2020

2121
import (
22-
"encoding/json"
23-
2422
"configcenter/src/common"
2523
"configcenter/src/common/errors"
2624
)
2725

28-
// CreateSyncDataOption defines create sync data option
29-
type CreateSyncDataOption struct {
30-
ResourceType ResType `json:"resource_type"`
31-
SubResource string `json:"sub_resource"`
32-
Data []json.RawMessage `json:"data"`
33-
}
34-
35-
// Validate create sync data option
36-
func (o *CreateSyncDataOption) Validate() errors.RawErrorInfo {
37-
if rawErr := o.ResourceType.Validate(o.SubResource); rawErr.ErrCode != 0 {
38-
return rawErr
39-
}
40-
41-
if len(o.Data) == 0 {
42-
return errors.RawErrorInfo{
43-
ErrCode: common.CCErrCommParamsNeedSet,
44-
Args: []interface{}{"data"},
45-
}
46-
}
47-
48-
if len(o.Data) > common.BKMaxLimitSize {
49-
return errors.RawErrorInfo{
50-
ErrCode: common.CCErrCommXXExceedLimit,
51-
Args: []interface{}{"data", common.BKMaxLimitSize},
52-
}
53-
}
54-
55-
return errors.RawErrorInfo{}
56-
}
57-
5826
// SyncCmdbDataOption defines sync cmdb data option
5927
type SyncCmdbDataOption struct {
6028
ResType ResType `json:"resource_type"`

src/ac/iam/adaptor.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ var ccIamResTypeMap = map[meta.ResourceType]TypeID{
105105
meta.KubeContainer: TypeID(""),
106106
meta.FieldTemplate: FieldGroupingTemplate,
107107
meta.FulltextSearch: TypeID(""),
108-
meta.SynchronizeData: TypeID(""),
109108
}
110109

111110
// ConvertResourceType convert resource type from CMDB to IAM
@@ -594,9 +593,6 @@ var resourceActionMap = map[meta.ResourceType]map[meta.Action]ActionID{
594593
meta.Update: EditFieldGroupingTemplate,
595594
meta.Delete: DeleteFieldGroupingTemplate,
596595
},
597-
meta.SynchronizeData: {
598-
meta.Create: SynchronizeData,
599-
},
600596
}
601597

602598
// ParseIamPathToAncestors TODO

src/ac/iam/gen_id.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ var genIamResFuncMap = map[meta.ResourceType]func(ActionID, TypeID, *meta.Resour
5757
meta.HostInstance: genHostInstanceResource,
5858
meta.ProcessServiceCategory: genProcessServiceCategoryResource,
5959
meta.FieldTemplate: genFieldTemplateResource,
60-
meta.SynchronizeData: genSkipResource,
6160
}
6261

6362
// GenIamResource TODO

src/ac/iam/initial_action_groups.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -429,15 +429,6 @@ func genResourceManageActionGroups() []ActionGroup {
429429
},
430430
},
431431
},
432-
{
433-
Name: "CMDB数据同步",
434-
NameEn: "Synchronize Data",
435-
Actions: []ActionWithID{
436-
{
437-
ID: SynchronizeData,
438-
},
439-
},
440-
},
441432
},
442433
},
443434
}

src/ac/iam/initial_actions.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ var ActionIDNameMap = map[ActionID]string{
154154
ViewFieldGroupingTemplate: "字段组合模板查看",
155155
EditFieldGroupingTemplate: "字段组合模板编辑",
156156
DeleteFieldGroupingTemplate: "字段组合模板删除",
157-
SynchronizeData: "CMDB数据同步",
158157
}
159158

160159
// GenerateActions generate all the actions registered to IAM.
@@ -200,7 +199,6 @@ func GenerateStaticActions() []ResourceAction {
200199
resourceActionList = append(resourceActionList, genContainerManagementActions()...)
201200
resourceActionList = append(resourceActionList, genFulltextSearchActions()...)
202201
resourceActionList = append(resourceActionList, genFieldGroupingTemplateActions()...)
203-
resourceActionList = append(resourceActionList, genSynchronizeDataActions()...)
204202

205203
return resourceActionList
206204
}
@@ -1746,13 +1744,3 @@ func genFieldGroupingTemplateActions() []ResourceAction {
17461744
},
17471745
}
17481746
}
1749-
1750-
func genSynchronizeDataActions() []ResourceAction {
1751-
return []ResourceAction{{
1752-
ID: SynchronizeData,
1753-
Name: ActionIDNameMap[SynchronizeData],
1754-
NameEn: "Synchronize Data",
1755-
Type: Edit,
1756-
Version: 1,
1757-
}}
1758-
}

src/ac/iam/types.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,6 @@ const (
540540
// UseFulltextSearch use fulltext search
541541
UseFulltextSearch ActionID = "use_fulltext_search"
542542

543-
// SynchronizeData is cmdb synchronize data action id
544-
SynchronizeData ActionID = "synchronize_data"
545-
546543
// Unsupported TODO
547544
// Unknown is an action that can not be recognized
548545
Unsupported ActionID = "unsupported"

src/ac/meta/resource.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ const (
6767
Project ResourceType = "project"
6868
FulltextSearch ResourceType = "fulltextSearch"
6969
FieldTemplate ResourceType = "fieldTemplate"
70-
71-
// SynchronizeData is cmdb synchronize data auth resource type in CMDB
72-
SynchronizeData ResourceType = "synchronize_data"
7370
)
7471

7572
// kube related auth resource in CMDB

src/apimachinery/coreservice/synchronize/api.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import (
1616
"context"
1717
"net/http"
1818

19-
"configcenter/pkg/synchronize/types"
20-
"configcenter/src/common/errors"
2119
"configcenter/src/common/metadata"
2220
)
2321

@@ -116,28 +114,3 @@ func (sync *synchronize) SetIdentifierFlag(ctx context.Context, h http.Header,
116114
Into(resp)
117115
return
118116
}
119-
120-
// CreateSyncData create sync data
121-
func (sync *synchronize) CreateSyncData(ctx context.Context, h http.Header,
122-
opt *types.CreateSyncDataOption) errors.CCErrorCoder {
123-
124-
ret := new(metadata.BaseResp)
125-
subPath := "/synchronize/create/data"
126-
127-
err := sync.client.Post().
128-
WithContext(ctx).
129-
Body(opt).
130-
SubResourcef(subPath).
131-
WithHeaders(h).
132-
Do().
133-
Into(ret)
134-
135-
if err != nil {
136-
return errors.CCHttpError
137-
}
138-
if ret.CCError() != nil {
139-
return ret.CCError()
140-
}
141-
142-
return nil
143-
}

src/apimachinery/coreservice/synchronize/synchronize.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ import (
1717
"context"
1818
"net/http"
1919

20-
"configcenter/pkg/synchronize/types"
2120
"configcenter/src/apimachinery/rest"
22-
"configcenter/src/common/errors"
2321
"configcenter/src/common/metadata"
2422
)
2523

@@ -37,8 +35,6 @@ type SynchronizeClientInterface interface {
3735
input *metadata.SynchronizeClearDataParameter) (resp *metadata.Response, err error)
3836
SetIdentifierFlag(ctx context.Context, h http.Header,
3937
input *metadata.SetIdenifierFlag) (resp *metadata.SynchronizeResult, err error)
40-
41-
CreateSyncData(ctx context.Context, h http.Header, opt *types.CreateSyncDataOption) errors.CCErrorCoder
4238
}
4339

4440
// NewSynchronizeClientInterface new public api

0 commit comments

Comments
 (0)