package
0.0.0-20230212013232-7aae7b90475c
Repository: https://github.com/infraboard/cmdb.git
Documentation: pkg.go.dev
# README
资源管理
资源的统一搜索
资源关系
资源付费模式
阿里云:
- Subscription:预付费。
- PayAsYouGo:后付费。
- PrePaid:包年包月。
- PostPaid:按量付费
腾讯云:
- prePay
- postPay
华为云:
- 1:包年/包月
- 3:按需
- 10:预留实例
统一为:
- PRE_PAY:包年包月。
- POST_PAY:按量付费
资源标签管理
应用标签
应用在部署时 需要申请对应的资源, 申请完成后 需要补充标签:
比如 deploy
- deploy = "app1-v1"
- deploy = "app2-v1"
监控标签
我们使用2个标签:
- prometheus.io/node/enabled = "true" meta:{"point": "9100:/metrics"}
- prometheus.io/appv1/enabled = "true" meta:{"point": "9100:/metrics"}
比如搜索 prometheus.io/%/enabled = "true"
[
{
"targets": ["10.0.10.2:9100", "10.0.10.3:9100", "10.0.10.4:9100", "10.0.10.5:9100"],
"labels": {
"domain": "admin",
"namespace": "default",
"env": "prod",
"accout": "acount11",
"vendor": "ali_yun",
"region": "hangzou",
"instance_id":"ins-xxxxx"
}
},
...
]
资源生命周期管理
资源申请
资源释放逻辑
create cluster app-v1 devcloud.com/deploy = app-v1 [h1, h2, bucket1, mysql01, dba]
资源状态
- 3天的 滞留期, 资源无人使用的最大窗口,
- 超过3天都未使用, 将进入待观察期(4天), 资源会停止服务
- 当资源超过观察期都还未有人处理,会直接释放, 并记录资源状态 (记录保存期,365天)
# Functions
GenResourceHashId 生成资源的短hashId.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
key1=v1,v2,v3&key2=~v1,v2,v3.
No description provided by the author
ParsePAY_MODEFromString Parse PAY_MODE from string.
ParseTAG_PURPOSEFromString Parse TAG_PURPOSE from string.
ParseTYPEFromString Parse TYPE from string.
ParseUpdateActionFromString Parse UpdateAction from string.
ParseUSAGE_MODEFromString Parse USAGE_MODE from string.
ParseVENDORFromString Parse VENDOR from string.
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
没有标识.
按需.
预付费, 包年包月.
预定.
竞价付费.
No description provided by the author
No description provided by the author
No description provided by the author
用于资源分组.
用于资源监控.
系统使用标签, 表示被其他系统引用, 比如应用关联标签.
来自第三方的标签, 比如同步时的第三方提供的标签.
No description provided by the author
辅助资源.
No description provided by the author
子资源.
No description provided by the author
No description provided by the author
No description provided by the author
业务资源.
No description provided by the author
No description provided by the author
No description provided by the author
未知资源.
No description provided by the author
No description provided by the author
添加.
移除.
独占使用.
共享使用.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
No description provided by the author
Enum value maps for PAY_MODE.
Enum value maps for PAY_MODE.
RPC_ServiceDesc is the grpc.ServiceDesc for RPC service.
Enum value maps for TAG_PURPOSE.
Enum value maps for TAG_PURPOSE.
Enum value maps for TYPE.
Enum value maps for TYPE.
Enum value maps for UpdateAction.
Enum value maps for UpdateAction.
Enum value maps for USAGE_MODE.
Enum value maps for USAGE_MODE.
Enum value maps for VENDOR.
Enum value maps for VENDOR.
# Structs
No description provided by the author
No description provided by the author
资产价格, 包年包月 记录月.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
共享策略.
No description provided by the author
资源当前状态.
No description provided by the author
No description provided by the author
No description provided by the author
UnimplementedRPCServer must be embedded to have forward compatible implementations.
# Interfaces
RPCClient is the client API for RPC service.
RPCServer is the server API for RPC service.
No description provided by the author
UnsafeRPCServer may be embedded to opt out of forward compatibility for this service.
# Type aliases
No description provided by the author
No description provided by the author
标签用途.
No description provided by the author
No description provided by the author
使用方式.
No description provided by the author