Files
aiops/backend/cloud/billing.go
T
Logan.Li 0b785da8ae feat: 完善多云资产与腾讯云账单同步
- 接入 AWS、腾讯云、华为云和 Azure 区域及主机发现
- 接入腾讯云账单分页、限流与组件费用汇总
- 批量账单仅同步已支持厂商并优化云账号操作
2026-07-25 14:45:19 +08:00

32 lines
999 B
Go

package cloud
// CloudBillingRecord 云账单同步记录(跨平台统一结构) // Logan.Li
type CloudBillingRecord struct {
BillingDate string `json:"billing_date"`
Provider string `json:"provider"`
Cost float64 `json:"cost"`
Currency string `json:"currency"`
Service string `json:"service"`
Region string `json:"region"`
Description string `json:"description"`
}
// BillingFetcher 云账单拉取接口
type BillingFetcher interface {
FetchDailyBill(billingDate string) ([]CloudBillingRecord, error)
}
// SupportedBillingProviders 已接入账单 API 的云厂商列表。 // Logan.Li
var SupportedBillingProviders = []string{"aliyun", "tencent"}
// NewBillingFetcher 根据云厂商创建账单拉取器
func NewBillingFetcher(provider, accessKey, secretKey string) BillingFetcher {
switch provider {
case "aliyun":
return NewAliyunProvider(accessKey, secretKey)
case "tencent":
return NewTencentProvider(accessKey, secretKey)
}
return nil
}