mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-29 17:58:36 +08:00
fix(region): dbinstance swagger api (#21553)
This commit is contained in:
+28281
-28955
File diff suppressed because it is too large
Load Diff
@@ -604,7 +604,7 @@ definitions:
|
||||
AlertPanelDetail:
|
||||
properties:
|
||||
Setting:
|
||||
type: object
|
||||
$ref: '#/definitions/AlertSetting'
|
||||
can_delete:
|
||||
description: 资源是否可以删除, 若为flase, delete_fail_reason会返回不能删除的原因
|
||||
example: true
|
||||
@@ -790,6 +790,23 @@ definitions:
|
||||
x-go-name: UsedBy
|
||||
type: object
|
||||
x-go-package: yunion.io/x/onecloud/pkg/apis/monitor
|
||||
AlertPanelSetOrderInput:
|
||||
properties:
|
||||
order:
|
||||
items:
|
||||
properties:
|
||||
index:
|
||||
format: int64
|
||||
type: integer
|
||||
x-go-name: Index
|
||||
panel_id:
|
||||
type: string
|
||||
x-go-name: PanelId
|
||||
type: object
|
||||
type: array
|
||||
x-go-name: Order
|
||||
type: object
|
||||
x-go-package: yunion.io/x/onecloud/pkg/apis/monitor
|
||||
AlertPauseInput:
|
||||
properties:
|
||||
paused:
|
||||
@@ -2203,6 +2220,9 @@ definitions:
|
||||
condition:
|
||||
type: string
|
||||
x-go-name: Condition
|
||||
is_recovery:
|
||||
type: boolean
|
||||
x-go-name: IsRecovery
|
||||
metric:
|
||||
type: string
|
||||
x-go-name: Metric
|
||||
@@ -5241,6 +5261,31 @@ paths:
|
||||
summary: 全量替换资源的所有 class 标签
|
||||
tags:
|
||||
- alert_dash_board
|
||||
/alert_dash_boards/{id}/set-panel-order:
|
||||
post:
|
||||
description: 执行操作SetPanelOrder
|
||||
operationId: alert_dash_board_PerformSetPanelOrder
|
||||
parameters:
|
||||
- description: The Id or Name of alert_dash_board
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
x-go-name: Id
|
||||
- in: body
|
||||
name: body
|
||||
schema:
|
||||
properties:
|
||||
alert_dash_board:
|
||||
$ref: '#/definitions/AlertPanelSetOrderInput'
|
||||
type: object
|
||||
x-go-name: Body
|
||||
responses:
|
||||
"200":
|
||||
$ref: '#/responses/alert_dash_board_PerformSetPanelOrderOutput'
|
||||
summary: 执行操作SetPanelOrder
|
||||
tags:
|
||||
- alert_dash_board
|
||||
/alert_dash_boards/{id}/set-scope:
|
||||
post:
|
||||
description: 执行操作SetScope
|
||||
@@ -17718,6 +17763,8 @@ responses:
|
||||
description: ""
|
||||
alert_dash_board_PerformSetOrgMetadataOutput:
|
||||
description: ""
|
||||
alert_dash_board_PerformSetPanelOrderOutput:
|
||||
description: ""
|
||||
alert_dash_board_PerformSetScopeOutput:
|
||||
description: ""
|
||||
alert_dash_board_PerformSetUserMetadataOutput:
|
||||
|
||||
@@ -39,6 +39,4 @@ type CloudproviderQuotaDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
CloudregionResourceInfo
|
||||
ManagedResourceInfo
|
||||
|
||||
SCloudproviderQuota
|
||||
}
|
||||
|
||||
@@ -312,11 +312,6 @@ type GuestsecgroupDetails struct {
|
||||
Secgroup string `json:"secgroup"`
|
||||
}
|
||||
|
||||
//type SElasticcachesecgroup struct {
|
||||
// SElasticcacheJointsBase
|
||||
// SSecurityGroupResourceBase
|
||||
//}
|
||||
|
||||
type ElasticcachesecgroupDetails struct {
|
||||
ElasticcacheJointResourceDetails
|
||||
|
||||
|
||||
@@ -273,13 +273,6 @@ type SCloudaccount struct {
|
||||
RegionId string `json:"region_id"`
|
||||
}
|
||||
|
||||
// SCloudimage is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudimage.
|
||||
type SCloudimage struct {
|
||||
apis.SStandaloneResourceBase
|
||||
apis.SExternalizedResourceBase
|
||||
SCloudregionResourceBase
|
||||
}
|
||||
|
||||
// SCloudprovider is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudprovider.
|
||||
type SCloudprovider struct {
|
||||
apis.SEnabledStatusStandaloneResourceBase
|
||||
@@ -311,33 +304,6 @@ type SCloudprovider struct {
|
||||
SProjectMappingResourceBase
|
||||
}
|
||||
|
||||
// SCloudproviderCapability is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudproviderCapability.
|
||||
type SCloudproviderCapability struct {
|
||||
apis.SResourceBase
|
||||
CloudproviderId string `json:"cloudprovider_id"`
|
||||
CloudregionId string `json:"cloudregion_id"`
|
||||
Capability string `json:"capability"`
|
||||
}
|
||||
|
||||
// SCloudproviderQuota is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudproviderQuota.
|
||||
type SCloudproviderQuota struct {
|
||||
apis.SStandaloneResourceBase
|
||||
apis.SExternalizedResourceBase
|
||||
SManagedResourceBase
|
||||
SCloudregionResourceBase
|
||||
// 配额范围
|
||||
// cloudregion: 区域级别
|
||||
// cloudprovider: 云订阅级别
|
||||
QuotaRange string `json:"quota_range"`
|
||||
// 已使用的配额
|
||||
// -1代表未从云平台拿到已使用配额信息
|
||||
UsedCount int64 `json:"used_count"`
|
||||
// 最大配额限制
|
||||
MaxCount int64 `json:"max_count"`
|
||||
// 配额类型
|
||||
QuotaType string `json:"quota_type"`
|
||||
}
|
||||
|
||||
// SCloudproviderResourceBase is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SCloudproviderResourceBase.
|
||||
type SCloudproviderResourceBase struct {
|
||||
CloudproviderId string `json:"cloudprovider_id"`
|
||||
@@ -384,6 +350,12 @@ type SContainer struct {
|
||||
GuestId string `json:"guest_id"`
|
||||
// Spec stores all container running options
|
||||
Spec *ContainerSpec `json:"spec"`
|
||||
// 启动时间
|
||||
StartedAt time.Time `json:"started_at"`
|
||||
// 上次退出时间
|
||||
LastFinishedAt time.Time `json:"last_finished_at"`
|
||||
// 重启次数
|
||||
RestartCount int `json:"restart_count"`
|
||||
}
|
||||
|
||||
// SDBInstance is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDBInstance.
|
||||
@@ -580,6 +552,8 @@ type SDisk struct {
|
||||
BackupId string `json:"backup_id"`
|
||||
// 文件系统
|
||||
FsFormat string `json:"fs_format"`
|
||||
// 文件系统特性
|
||||
FsFeatures *DiskFsFeatures `json:"fs_features"`
|
||||
// 磁盘类型
|
||||
// sys: 系统盘
|
||||
// data: 数据盘
|
||||
@@ -658,13 +632,6 @@ type SDnsZoneResourceBase struct {
|
||||
DnsZoneId string `json:"dns_zone_id"`
|
||||
}
|
||||
|
||||
// SDnsZoneVpc is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDnsZoneVpc.
|
||||
type SDnsZoneVpc struct {
|
||||
apis.SJointResourceBase
|
||||
SDnsZoneResourceBase
|
||||
VpcId string `json:"vpc_id"`
|
||||
}
|
||||
|
||||
// SDynamicschedtag is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SDynamicschedtag.
|
||||
type SDynamicschedtag struct {
|
||||
apis.SStandaloneResourceBase
|
||||
@@ -945,7 +912,7 @@ type SExternalProject struct {
|
||||
|
||||
// SFileSystem is an autogenerated struct via yunion.io/x/onecloud/pkg/compute/models.SFileSystem.
|
||||
type SFileSystem struct {
|
||||
apis.SVirtualResourceBase
|
||||
apis.SSharableVirtualResourceBase
|
||||
apis.SExternalizedResourceBase
|
||||
SManagedResourceBase
|
||||
SBillingResourceBase
|
||||
|
||||
@@ -65,14 +65,15 @@ type SAlertDashboardPanel struct {
|
||||
apis.SVirtualJointResourceBase
|
||||
DashboardId string `json:"dashboard_id"`
|
||||
PanelId string `json:"panel_id"`
|
||||
Index int `json:"index"`
|
||||
}
|
||||
|
||||
// SAlertPanel is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SAlertPanel.
|
||||
type SAlertPanel struct {
|
||||
apis.SStatusStandaloneResourceBase
|
||||
apis.SScopedResourceBase
|
||||
Settings jsonutils.JSONObject `json:"settings"`
|
||||
Message string `json:"message"`
|
||||
Settings *AlertSetting `json:"settings"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
// SAlertRecord is an autogenerated struct via yunion.io/x/onecloud/pkg/monitor/models.SAlertRecord.
|
||||
|
||||
@@ -39,6 +39,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=webapp
|
||||
// +onecloud:swagger-gen-model-plural=webapps
|
||||
type SAppManager struct {
|
||||
db.SVirtualResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -30,6 +30,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=webappenvironment
|
||||
// +onecloud:swagger-gen-model-plural=webappenvironments
|
||||
type SAppEnvironmentManager struct {
|
||||
db.SVirtualResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -33,6 +33,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=backupstorage
|
||||
// +onecloud:swagger-gen-model-plural=backupstorages
|
||||
type SBackupStorageManager struct {
|
||||
db.SEnabledStatusInfrasResourceBaseManager
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=baremetalagent
|
||||
// +onecloud:swagger-gen-model-plural=baremetalagents
|
||||
type SBaremetalagentManager struct {
|
||||
db.SStandaloneResourceBaseManager
|
||||
SZoneResourceBaseManager
|
||||
|
||||
@@ -27,6 +27,7 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/yunionmeta"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-ignore
|
||||
type SCloudimageManager struct {
|
||||
db.SStandaloneResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
@@ -46,6 +47,7 @@ func init() {
|
||||
CloudimageManager.SetVirtualObject(CloudimageManager)
|
||||
}
|
||||
|
||||
// +onecloud:swagger-gen-ignore
|
||||
type SCloudimage struct {
|
||||
db.SStandaloneResourceBase
|
||||
db.SExternalizedResourceBase
|
||||
|
||||
@@ -54,6 +54,7 @@ func init() {
|
||||
CloudproviderQuotaManager.SetVirtualObject(CloudproviderQuotaManager)
|
||||
}
|
||||
|
||||
// +onecloud:swagger-gen-ignore
|
||||
type SCloudproviderQuota struct {
|
||||
db.SStandaloneResourceBase
|
||||
db.SExternalizedResourceBase
|
||||
|
||||
@@ -45,6 +45,7 @@ func init() {
|
||||
CloudproviderCapabilityManager.SetVirtualObject(CloudproviderCapabilityManager)
|
||||
}
|
||||
|
||||
// +onecloud:swagger-gen-ignore
|
||||
type SCloudproviderCapability struct {
|
||||
db.SResourceBase
|
||||
|
||||
|
||||
@@ -38,6 +38,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=dbinstanceaccount
|
||||
// +onecloud:swagger-gen-model-plural=dbinstanceaccounts
|
||||
type SDBInstanceAccountManager struct {
|
||||
db.SStatusStandaloneResourceBaseManager
|
||||
SDBInstanceResourceBaseManager
|
||||
|
||||
@@ -37,6 +37,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=dbinstancebackup
|
||||
// +onecloud:swagger-gen-model-plural=dbinstancebackups
|
||||
type SDBInstanceBackupManager struct {
|
||||
db.SVirtualResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -35,6 +35,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=dbinstancedatabase
|
||||
// +onecloud:swagger-gen-model-plural=dbinstancedatabases
|
||||
type SDBInstanceDatabaseManager struct {
|
||||
db.SStatusStandaloneResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -32,6 +32,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=dbinstanceparameter
|
||||
// +onecloud:swagger-gen-model-plural=dbinstanceparameters
|
||||
type SDBInstanceParameterManager struct {
|
||||
db.SStandaloneResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -31,6 +31,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=dbinstanceprivilege
|
||||
// +onecloud:swagger-gen-model-plural=dbinstanceprivileges
|
||||
type SDBInstancePrivilegeManager struct {
|
||||
db.SResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -40,6 +40,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/yunionmeta"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=dbinstance_sku
|
||||
// +onecloud:swagger-gen-model-plural=dbinstance_skus
|
||||
type SDBInstanceSkuManager struct {
|
||||
db.SEnabledStatusStandaloneResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -53,6 +53,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=dbinstance
|
||||
// +onecloud:swagger-gen-model-plural=dbinstances
|
||||
type SDBInstanceManager struct {
|
||||
db.SVirtualResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -36,6 +36,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=diskbackup
|
||||
// +onecloud:swagger-gen-model-plural=diskbackups
|
||||
type SDiskBackupManager struct {
|
||||
db.SVirtualResourceBaseManager
|
||||
SDiskResourceBaseManager
|
||||
|
||||
@@ -44,6 +44,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=dnsrecord
|
||||
// +onecloud:swagger-gen-model-plural=dnsrecords
|
||||
type SDnsRecordManager struct {
|
||||
db.SEnabledStatusStandaloneResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -21,6 +21,7 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-ignore
|
||||
type SDnsZoneVpcManager struct {
|
||||
db.SJointResourceBaseManager
|
||||
}
|
||||
@@ -43,6 +44,7 @@ func init() {
|
||||
})
|
||||
}
|
||||
|
||||
// +onecloud:swagger-gen-ignore
|
||||
type SDnsZoneVpc struct {
|
||||
db.SJointResourceBase
|
||||
SDnsZoneResourceBase
|
||||
|
||||
@@ -40,7 +40,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// SElasticcache.Account
|
||||
// +onecloud:swagger-gen-model-singular=elasticcacheaccount
|
||||
// +onecloud:swagger-gen-model-plural=elasticcacheaccounts
|
||||
type SElasticcacheAccountManager struct {
|
||||
db.SStatusStandaloneResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -38,7 +38,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// SElasticcache.Acl
|
||||
// +onecloud:swagger-gen-model-singular=elasticcacheacl
|
||||
// +onecloud:swagger-gen-model-plural=elasticcacheacls
|
||||
type SElasticcacheAclManager struct {
|
||||
db.SStandaloneResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -37,7 +37,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// SElasticcache.Backup
|
||||
// +onecloud:swagger-gen-model-singular=elasticcachebackup
|
||||
// +onecloud:swagger-gen-model-plural=elasticcachebackups
|
||||
type SElasticcacheBackupManager struct {
|
||||
db.SStatusStandaloneResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -34,7 +34,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// SElasticcache.Parameter
|
||||
// +onecloud:swagger-gen-model-singular=elasticcacheparameter
|
||||
// +onecloud:swagger-gen-model-plural=elasticcacheparameters
|
||||
type SElasticcacheParameterManager struct {
|
||||
db.SStandaloneResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -42,6 +42,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/yunionmeta"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=elasticcachesku
|
||||
// +onecloud:swagger-gen-model-plural=elasticcacheskus
|
||||
type SElasticcacheSkuManager struct {
|
||||
db.SStatusStandaloneResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -49,6 +49,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=eip
|
||||
// +onecloud:swagger-gen-model-plural=eips
|
||||
type SElasticipManager struct {
|
||||
db.SVirtualResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -45,6 +45,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=externalproject
|
||||
// +onecloud:swagger-gen-model-plural=externalprojects
|
||||
type SExternalProjectManager struct {
|
||||
db.SVirtualResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -40,6 +40,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=globalvpc
|
||||
// +onecloud:swagger-gen-model-plural=globalvpcs
|
||||
type SGlobalVpcManager struct {
|
||||
db.SEnabledStatusInfrasResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -46,6 +46,8 @@ const (
|
||||
RDS_TYPE = "RDS"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=instancegroup
|
||||
// +onecloud:swagger-gen-model-plural=instancegroups
|
||||
type SGroupManager struct {
|
||||
db.SVirtualResourceBaseManager
|
||||
db.SEnabledResourceBaseManager
|
||||
|
||||
@@ -77,6 +77,8 @@ type SInstanceBackup struct {
|
||||
SizeMb int `nullable:"false" list:"user"`
|
||||
}
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=instancebackup
|
||||
// +onecloud:swagger-gen-model-plural=instancebackups
|
||||
type SInstanceBackupManager struct {
|
||||
db.SVirtualResourceBaseManager
|
||||
SManagedResourceBaseManager
|
||||
|
||||
@@ -42,6 +42,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=cloud_kube_cluster
|
||||
// +onecloud:swagger-gen-model-plural=cloud_kube_clusters
|
||||
type SKubeClusterManager struct {
|
||||
db.SEnabledStatusInfrasResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -37,6 +37,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=cloud_kube_node_pool
|
||||
// +onecloud:swagger-gen-model-plural=cloud_kube_node_pools
|
||||
type SKubeNodePoolManager struct {
|
||||
db.SStatusStandaloneResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -35,6 +35,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=cloud_kube_node
|
||||
// +onecloud:swagger-gen-model-plural=cloud_kube_nodes
|
||||
type SKubeNodeManager struct {
|
||||
db.SStatusStandaloneResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -36,6 +36,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=loadbalanceracl
|
||||
// +onecloud:swagger-gen-model-plural=loadbalanceracls
|
||||
type SLoadbalancerAclManager struct {
|
||||
SLoadbalancerLogSkipper
|
||||
|
||||
|
||||
@@ -44,6 +44,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=loadbalanceragent
|
||||
// +onecloud:swagger-gen-model-plural=loadbalanceragents
|
||||
type SLoadbalancerAgentManager struct {
|
||||
SLoadbalancerLogSkipper
|
||||
db.SStandaloneResourceBaseManager
|
||||
|
||||
@@ -40,6 +40,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=loadbalancerbackendgroup
|
||||
// +onecloud:swagger-gen-model-plural=loadbalancerbackendgroups
|
||||
type SLoadbalancerBackendGroupManager struct {
|
||||
SLoadbalancerLogSkipper
|
||||
db.SStatusStandaloneResourceBaseManager
|
||||
|
||||
@@ -40,6 +40,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=loadbalancerbackend
|
||||
// +onecloud:swagger-gen-model-plural=loadbalancerbackends
|
||||
type SLoadbalancerBackendManager struct {
|
||||
SLoadbalancerLogSkipper
|
||||
db.SStatusStandaloneResourceBaseManager
|
||||
|
||||
@@ -44,6 +44,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=loadbalancercertificate
|
||||
// +onecloud:swagger-gen-model-plural=loadbalancercertificates
|
||||
type SLoadbalancerCertificateManager struct {
|
||||
SLoadbalancerLogSkipper
|
||||
db.SSharableVirtualResourceBaseManager
|
||||
|
||||
@@ -35,6 +35,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=loadbalancercluster
|
||||
// +onecloud:swagger-gen-model-plural=loadbalancerclusters
|
||||
type SLoadbalancerClusterManager struct {
|
||||
db.SStandaloneResourceBaseManager
|
||||
SZoneResourceBaseManager
|
||||
|
||||
@@ -37,6 +37,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=loadbalancerlistenerrule
|
||||
// +onecloud:swagger-gen-model-plural=loadbalancerlistenerrules
|
||||
type SLoadbalancerListenerRuleManager struct {
|
||||
SLoadbalancerLogSkipper
|
||||
db.SStatusStandaloneResourceBaseManager
|
||||
|
||||
@@ -39,6 +39,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=loadbalancerlistener
|
||||
// +onecloud:swagger-gen-model-plural=loadbalancerlisteners
|
||||
type SLoadbalancerListenerManager struct {
|
||||
SLoadbalancerLogSkipper
|
||||
db.SStatusStandaloneResourceBaseManager
|
||||
|
||||
@@ -43,6 +43,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=mongodb
|
||||
// +onecloud:swagger-gen-model-plural=mongodbs
|
||||
type SMongoDBManager struct {
|
||||
db.SVirtualResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -34,6 +34,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=natdentry
|
||||
// +onecloud:swagger-gen-model-plural=natdentries
|
||||
type SNatDEntryManager struct {
|
||||
SNatEntryManager
|
||||
}
|
||||
|
||||
@@ -43,6 +43,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=natgateway
|
||||
// +onecloud:swagger-gen-model-plural=natgateways
|
||||
type SNatGatewayManager struct {
|
||||
db.SStatusInfrasResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -34,6 +34,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=natsentry
|
||||
// +onecloud:swagger-gen-model-plural=natsenties
|
||||
type SNatSEntryManager struct {
|
||||
SNatEntryManager
|
||||
SNetworkResourceBaseManager
|
||||
|
||||
@@ -34,6 +34,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=tap_flow
|
||||
// +onecloud:swagger-gen-model-plural=tap_flows
|
||||
type SNetTapFlowManager struct {
|
||||
db.SEnabledStatusStandaloneResourceBaseManager
|
||||
}
|
||||
|
||||
@@ -37,6 +37,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=tap_service
|
||||
// +onecloud:swagger-gen-model-plural=tap_services
|
||||
type SNetTapServiceManager struct {
|
||||
db.SEnabledStatusStandaloneResourceBaseManager
|
||||
}
|
||||
|
||||
@@ -37,6 +37,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=networkaddress
|
||||
// +onecloud:swagger-gen-model-plural=networkaddresses
|
||||
type SNetworkAddressManager struct {
|
||||
db.SStandaloneAnonResourceBaseManager
|
||||
SNetworkResourceBaseManager
|
||||
|
||||
@@ -33,6 +33,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=networkinterface
|
||||
// +onecloud:swagger-gen-model-plural=networkinterfaces
|
||||
type SNetworkInterfaceManager struct {
|
||||
db.SStatusInfrasResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -29,6 +29,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=scalingactivity
|
||||
// +onecloud:swagger-gen-model-plural=scalingactivities
|
||||
type SScalingActivityManager struct {
|
||||
db.SStatusStandaloneResourceBaseManager
|
||||
SScalingGroupResourceBaseManager
|
||||
|
||||
@@ -39,6 +39,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=scalinggroup
|
||||
// +onecloud:swagger-gen-model-plural=scalinggroups
|
||||
type SScalingGroupManager struct {
|
||||
db.SVirtualResourceBaseManager
|
||||
SCloudregionResourceBaseManager
|
||||
|
||||
@@ -36,6 +36,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=scalingpolicy
|
||||
// +onecloud:swagger-gen-model-plural=scalingpolicies
|
||||
type SScalingPolicyManager struct {
|
||||
db.SVirtualResourceBaseManager
|
||||
SScalingGroupResourceBaseManager
|
||||
|
||||
@@ -42,6 +42,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=secgrouprule
|
||||
// +onecloud:swagger-gen-model-plural=secgrouprules
|
||||
type SSecurityGroupRuleManager struct {
|
||||
db.SResourceBaseManager
|
||||
db.SStatusResourceBaseManager
|
||||
|
||||
@@ -50,6 +50,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=secgroup
|
||||
// +onecloud:swagger-gen-model-plural=secgroups
|
||||
type SSecurityGroupManager struct {
|
||||
db.SSharableVirtualResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -49,6 +49,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/yunionmeta"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=serversku
|
||||
// +onecloud:swagger-gen-model-plural=serverskus
|
||||
type SServerSkuManager struct {
|
||||
db.SEnabledStatusStandaloneResourceBaseManager
|
||||
SCloudregionResourceBaseManager
|
||||
|
||||
@@ -33,6 +33,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=servicecatalog
|
||||
// +onecloud:swagger-gen-model-plural=servicecatalogs
|
||||
type SServiceCatalogManager struct {
|
||||
db.SSharableVirtualResourceBaseManager
|
||||
}
|
||||
|
||||
@@ -39,6 +39,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=snapshotpolicy
|
||||
// +onecloud:swagger-gen-model-plural=snapshotpolicies
|
||||
type SSnapshotPolicyManager struct {
|
||||
db.SVirtualResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -33,6 +33,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=sslcertificate
|
||||
// +onecloud:swagger-gen-model-plural=sslcertificates
|
||||
type SSSLCertificateManager struct {
|
||||
db.SVirtualResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -35,6 +35,8 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
)
|
||||
|
||||
// +onecloud:swagger-gen-model-singular=waf_regexset
|
||||
// +onecloud:swagger-gen-model-plural=waf_regexsets
|
||||
type SWafRegexSetManager struct {
|
||||
db.SStatusInfrasResourceBaseManager
|
||||
db.SExternalizedResourceBaseManager
|
||||
|
||||
@@ -116,11 +116,11 @@ type SAlert struct {
|
||||
//db.SStatusResourceBase
|
||||
|
||||
// Frequency is evaluate period
|
||||
Frequency int64 `nullable:"false" list:"user" create:"required" update:"user"`
|
||||
Settings jsonutils.JSONObject `nullable:"false" list:"user" create:"required" update:"user" length:"medium"`
|
||||
Level string `charset:"ascii" width:"36" nullable:"false" default:"normal" list:"user" update:"user"`
|
||||
Message string `charset:"utf8" list:"user" create:"optional" update:"user"`
|
||||
UsedBy string `charset:"ascii" create:"optional" list:"user"`
|
||||
Frequency int64 `nullable:"false" list:"user" create:"required" update:"user"`
|
||||
Settings *monitor.AlertSetting `nullable:"false" list:"user" create:"required" update:"user" length:"medium"`
|
||||
Level string `charset:"ascii" width:"36" nullable:"false" default:"normal" list:"user" update:"user"`
|
||||
Message string `charset:"utf8" list:"user" create:"optional" update:"user"`
|
||||
UsedBy string `charset:"ascii" create:"optional" list:"user"`
|
||||
|
||||
// Silenced bool
|
||||
ExecutionError string `charset:"utf8" list:"user"`
|
||||
@@ -184,14 +184,7 @@ func (alert *SAlert) ShouldUpdateState(newState monitor.AlertStateType) bool {
|
||||
}
|
||||
|
||||
func (alert *SAlert) GetSettings() (*monitor.AlertSetting, error) {
|
||||
setting := new(monitor.AlertSetting)
|
||||
if alert.Settings == nil {
|
||||
return setting, nil
|
||||
}
|
||||
if err := alert.Settings.Unmarshal(setting); err != nil {
|
||||
return nil, errors.Wrapf(err, "alert %s unmarshal", alert.GetId())
|
||||
}
|
||||
return setting, nil
|
||||
return alert.Settings, nil
|
||||
}
|
||||
|
||||
type AlertRuleTags map[string]AlertRuleTag
|
||||
@@ -459,15 +452,6 @@ func (alert *SAlert) SetState(input AlertSetStateInput) error {
|
||||
}
|
||||
|
||||
func (alert *SAlert) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input monitor.AlertUpdateInput) (monitor.AlertUpdateInput, error) {
|
||||
if input.Settings != nil {
|
||||
updateSettings := jsonutils.NewDict()
|
||||
updateSettings.Update(alert.Settings)
|
||||
updateSettings.Update(jsonutils.Marshal(input.Settings))
|
||||
input.Settings = new(monitor.AlertSetting)
|
||||
if err := updateSettings.Unmarshal(input.Settings); err != nil {
|
||||
return input, err
|
||||
}
|
||||
}
|
||||
var err error
|
||||
input.StandaloneResourceBaseUpdateInput, err = alert.SStandaloneResourceBase.ValidateUpdateData(ctx, userCred, query, input.StandaloneResourceBaseUpdateInput)
|
||||
if err != nil {
|
||||
|
||||
@@ -583,10 +583,7 @@ func (man *SCommonAlertManager) CustomizeFilterList(
|
||||
return nil, err
|
||||
}
|
||||
mF := func(obj *SCommonAlert) (bool, error) {
|
||||
settings := new(monitor.AlertSetting)
|
||||
if err := obj.Settings.Unmarshal(settings); err != nil {
|
||||
return false, errors.Wrapf(err, "alert %s unmarshal", obj.GetId())
|
||||
}
|
||||
settings := obj.Settings
|
||||
for _, s := range settings.Conditions {
|
||||
if s.Query.Model.Measurement == meaurement && len(s.Query.Model.Selects) == 1 {
|
||||
if IsQuerySelectHasField(s.Query.Model.Selects[0], field) {
|
||||
@@ -607,10 +604,7 @@ func (man *SCommonAlertManager) CustomizeFilterList(
|
||||
|
||||
if len(input.ResType) != 0 {
|
||||
mF := func(obj *SCommonAlert) (bool, error) {
|
||||
settings := new(monitor.AlertSetting)
|
||||
if err := obj.Settings.Unmarshal(settings); err != nil {
|
||||
return false, errors.Wrapf(err, "alert %s unmarshal", obj.GetId())
|
||||
}
|
||||
settings := obj.Settings
|
||||
for _, s := range settings.Conditions {
|
||||
if mesurement, contain := MetricMeasurementManager.measurementsCache.Get(s.Query.Model.
|
||||
Measurement); contain {
|
||||
@@ -773,7 +767,7 @@ func (alert *SCommonAlert) GetCommonAlertMetricDetails() ([]*monitor.CommonAlert
|
||||
setting.Conditions[i] = cond
|
||||
}
|
||||
// side effect, update setting cause of setting.Conditions has changed by GetCommonAlertMetricDetailsFromAlertCondition
|
||||
alert.Settings = jsonutils.Marshal(setting)
|
||||
alert.Settings = setting
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
@@ -1307,7 +1301,7 @@ func (alert *SCommonAlert) PerformConfig(ctx context.Context, userCred mcclient.
|
||||
fmt.Println(threshold)
|
||||
setting.Conditions[0].Evaluator.Params = []float64{fieldOperatorThreshold("", val)}
|
||||
}
|
||||
alert.Settings = jsonutils.Marshal(setting)
|
||||
alert.Settings = setting
|
||||
return nil
|
||||
})
|
||||
PerformConfigLog(alert, userCred)
|
||||
|
||||
@@ -344,10 +344,7 @@ func (man *SNodeAlertManager) CustomizeFilterList(
|
||||
return nil, err
|
||||
}
|
||||
mF := func(obj *SNodeAlert) (bool, error) {
|
||||
settings := new(monitor.AlertSetting)
|
||||
if err := obj.Settings.Unmarshal(settings); err != nil {
|
||||
return false, errors.Wrapf(err, "alert %s unmarshal", obj.GetId())
|
||||
}
|
||||
settings := obj.Settings
|
||||
for _, s := range settings.Conditions {
|
||||
if s.Query.Model.Measurement == meaurement && len(s.Query.Model.Selects) == 1 {
|
||||
if IsQuerySelectHasField(s.Query.Model.Selects[0], field) {
|
||||
|
||||
Reference in New Issue
Block a user