|
|
|
@@ -373,6 +373,8 @@ type CloudbrainsOptions struct { |
|
|
|
BeginTimeUnix int64 |
|
|
|
EndTimeUnix int64 |
|
|
|
AiCenter string |
|
|
|
NeedDeleteInfo string |
|
|
|
Cluster string |
|
|
|
} |
|
|
|
|
|
|
|
type TaskPod struct { |
|
|
|
@@ -1409,6 +1411,18 @@ func Cloudbrains(opts *CloudbrainsOptions) ([]*CloudbrainInfo, int64, error) { |
|
|
|
builder.Like{"cloudbrain.ai_center", opts.AiCenter}, |
|
|
|
) |
|
|
|
} |
|
|
|
if (opts.Cluster) != "" { |
|
|
|
if opts.Cluster == "resource_cluster_openi" { |
|
|
|
cond = cond.And( |
|
|
|
builder.Or(builder.Eq{"cloudbrain.type": TypeCloudBrainOne}, builder.Eq{"cloudbrain.type": TypeCloudBrainTwo}), |
|
|
|
) |
|
|
|
} |
|
|
|
if opts.Cluster == "resource_cluster_c2net" { |
|
|
|
cond = cond.And( |
|
|
|
builder.Eq{"cloudbrain.type": TypeC2Net}, |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (opts.IsLatestVersion) != "" { |
|
|
|
cond = cond.And(builder.Or(builder.And(builder.Eq{"cloudbrain.is_latest_version": opts.IsLatestVersion}, builder.Eq{"cloudbrain.job_type": "TRAIN"}), builder.Neq{"cloudbrain.job_type": "TRAIN"})) |
|
|
|
@@ -1955,6 +1969,18 @@ func CloudbrainAll(opts *CloudbrainsOptions) ([]*CloudbrainInfo, int64, error) { |
|
|
|
builder.Like{"cloudbrain.ai_center", opts.AiCenter}, |
|
|
|
) |
|
|
|
} |
|
|
|
if (opts.NeedDeleteInfo) != "" { |
|
|
|
if opts.NeedDeleteInfo == "yes" { |
|
|
|
cond = cond.And( |
|
|
|
builder.And(builder.NotNull{"cloudbrain.deleted_at"}), |
|
|
|
) |
|
|
|
} |
|
|
|
if opts.NeedDeleteInfo == "no" { |
|
|
|
cond = cond.And( |
|
|
|
builder.And(builder.IsNull{"cloudbrain.deleted_at"}), |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (opts.IsLatestVersion) != "" { |
|
|
|
cond = cond.And(builder.Or(builder.And(builder.Eq{"cloudbrain.is_latest_version": opts.IsLatestVersion}, |
|
|
|
|