补充cmdb业务定义
This commit is contained in:
parent
dcd5136a8c
commit
f53853f53a
@ -17,16 +17,18 @@
|
||||
资源管理模型的设计:
|
||||
|
||||
1. 基于模型的CMDB设计
|
||||
|
||||
|
||||
|
||||
2. 云管的CMDB设计
|
||||
|
||||
|
||||
## 功能模块开发
|
||||
|
||||
1. resource
|
||||
2. secret
|
||||
3. tag
|
||||
|
||||
|
||||
业务功能 以GRPC方式实现,然后选择以何种方式 提供API(RESTful/GRPC), 不适用于 先有叻RESTful API,后补充GRPC:
|
||||
1. 内部包
|
||||
2. 暴露为 RESTful API
|
||||
3. 暴露为 GRPC rpc
|
||||
|
||||
## 接入用户中心,接入审计中心
|
||||
|
||||
|
1
devcloud-mini/cmdb/apps/registry.go
Normal file
1
devcloud-mini/cmdb/apps/registry.go
Normal file
@ -0,0 +1 @@
|
||||
package apps
|
1
devcloud-mini/cmdb/apps/resource/README.md
Normal file
1
devcloud-mini/cmdb/apps/resource/README.md
Normal file
@ -0,0 +1 @@
|
||||
# 资源管理模块
|
2
devcloud-mini/cmdb/apps/secret/README.md
Normal file
2
devcloud-mini/cmdb/apps/secret/README.md
Normal file
@ -0,0 +1,2 @@
|
||||
# 资源账号
|
||||
|
1
devcloud-mini/cmdb/apps/tag/README.md
Normal file
1
devcloud-mini/cmdb/apps/tag/README.md
Normal file
@ -0,0 +1 @@
|
||||
# 资源标签
|
37
devcloud-mini/cmdb/docs/design.drawio
Normal file
37
devcloud-mini/cmdb/docs/design.drawio
Normal file
@ -0,0 +1,37 @@
|
||||
<mxfile host="65bd71144e">
|
||||
<diagram id="7pEBGre3FdwmhDWsT8h2" name="第 1 页">
|
||||
<mxGraphModel dx="873" dy="479" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0"/>
|
||||
<mxCell id="1" parent="0"/>
|
||||
<mxCell id="10" style="edgeStyle=none;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="2" target="9">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="2" value="resource<div><br></div><div>资源管理</div>" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="170" y="230" width="190" height="90" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="5" style="edgeStyle=none;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="3" target="2">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="3" value="<div>secret</div><div><br></div><div>资源账号: sync</div>" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="460" y="230" width="190" height="90" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="6" style="edgeStyle=none;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="4" target="2">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="4" value="<div>tags</div><div><br></div><div>资源管理</div>" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="170" y="370" width="190" height="90" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="8" style="edgeStyle=none;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="7" target="2">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="7" value="资源检索" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="25" y="80" width="480" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="9" value="prom<div>资源发现</div>" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="10" y="230" width="110" height="90" as="geometry"/>
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
22
devcloud-mini/cmdb/etc/application.toml
Normal file
22
devcloud-mini/cmdb/etc/application.toml
Normal file
@ -0,0 +1,22 @@
|
||||
[app]
|
||||
name = "cmdb"
|
||||
description = "cmdb"
|
||||
|
||||
[http]
|
||||
# 开启GRPC服务
|
||||
enable = true
|
||||
# HTTP服务Host
|
||||
host = "127.0.0.1"
|
||||
# HTTP服务端口
|
||||
port = 8010
|
||||
|
||||
[grpc]
|
||||
# 开启GRPC服务
|
||||
enable = true
|
||||
# Server监听的地址
|
||||
host = "127.0.0.1"
|
||||
# Server监听的端口
|
||||
port = 18010
|
||||
|
||||
[mongo]
|
||||
endpoints = ["127.0.0.1:27017"]
|
12
devcloud-mini/cmdb/main.go
Normal file
12
devcloud-mini/cmdb/main.go
Normal file
@ -0,0 +1,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/infraboard/mcube/v2/ioc/server/cmd"
|
||||
|
||||
_ "gitlab.com/go-course-project/go17/devcloud-mini/cmdb/apps"
|
||||
)
|
||||
|
||||
// mcube
|
||||
func main() {
|
||||
cmd.Start()
|
||||
}
|
2
go.mod
2
go.mod
@ -6,7 +6,7 @@ require (
|
||||
github.com/gin-gonic/gin v1.10.0
|
||||
github.com/go-playground/validator/v10 v10.20.0
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/infraboard/mcube/v2 v2.0.44
|
||||
github.com/infraboard/mcube/v2 v2.0.49
|
||||
github.com/rs/zerolog v1.32.0
|
||||
golang.org/x/crypto v0.31.0
|
||||
google.golang.org/grpc v1.70.0
|
||||
|
4
go.sum
4
go.sum
@ -69,8 +69,8 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU=
|
||||
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
||||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||
github.com/infraboard/mcube/v2 v2.0.44 h1:dspnLDspWpz5r6YgFTOmIlWE4kjog0082luhvd8AUds=
|
||||
github.com/infraboard/mcube/v2 v2.0.44/go.mod h1:UkjuO7zbehNNvAsA1kZMB2ztaZlDY9XmTfBnNnilzB4=
|
||||
github.com/infraboard/mcube/v2 v2.0.49 h1:V8Q8j5vOiYSnQmcVBeVGPlyJxNVsyniJgoKCGvGwy8c=
|
||||
github.com/infraboard/mcube/v2 v2.0.49/go.mod h1:gnr0xPPDPHvCS6JAzvdjqJ62J2+vUZTkobomjTXKsx0=
|
||||
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
|
||||
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
|
||||
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk=
|
||||
|
Loading…
x
Reference in New Issue
Block a user