mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
capabilities 可用storage过滤
This commit is contained in:
@@ -11,9 +11,9 @@ import (
|
||||
)
|
||||
|
||||
type SCapabilities struct {
|
||||
Hypervisors []string `json:",allowempty"`
|
||||
StorageTypes []string `json:",allowempty"`
|
||||
GPUModels []string `json:",allowempty"`
|
||||
Hypervisors []string `json:",allowempty"`
|
||||
StorageTypes []string `json:",allowempty"`
|
||||
GPUModels []string `json:",allowempty"`
|
||||
MinNicCount int
|
||||
MaxNicCount int
|
||||
MinDataDiskCount int
|
||||
@@ -52,6 +52,8 @@ func getHypervisors(zone *SZone) []string {
|
||||
q = q.Equals("zone_id", zone.Id)
|
||||
}
|
||||
q = q.IsNotEmpty("host_type").IsNotNull("host_type")
|
||||
q = q.Equals("host_status", HOST_ONLINE)
|
||||
q = q.IsTrue("enabled")
|
||||
q = q.Distinct()
|
||||
rows, err := q.Rows()
|
||||
if err != nil {
|
||||
@@ -75,6 +77,8 @@ func getStorageTypes(zone *SZone) []string {
|
||||
}
|
||||
q = q.IsNotEmpty("storage_type").IsNotNull("storage_type")
|
||||
q = q.IsNotEmpty("medium_type").IsNotNull("medium_type")
|
||||
q = q.In("status", []string{STORAGE_ENABLED, STORAGE_ONLINE})
|
||||
q = q.IsTrue("enabled")
|
||||
q = q.Distinct()
|
||||
rows, err := q.Rows()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user