fix: 修复错误提交

Former-commit-id: cca78dded7684afa7b80b771aa6fc8a7c74b4d94
This commit is contained in:
zhouqunjie 2023-09-05 09:52:19 +08:00
parent d794903f39
commit 9a87a62519
6 changed files with 605 additions and 342 deletions

View File

@ -6,6 +6,7 @@ import (
"ai/pcm-ai.api"
"storage/pcm-storage.api"
"vm/pcm-vm.api"
"cloud/pcm-cloud.api"
)
info(
@ -66,6 +67,15 @@ service pcm {
@handler getComputilityStatisticsHandler
get /core/getComputilityStatistics () returns (ComputilityStatisticsResp)
@handler nodeAssetsHandler
get /core/assets () returns (NodeAssetsResp)
@handler saveHashcatHandler
post /core/saveHashcat (SaveHashcatReq) returns ()
@handler getHashcatHandler
get /core/getHashcat/:crackTaskId (getHashcatHandlerReq) returns (getHashcatHandlerResp)
}
//hpc二级接口
@ -79,6 +89,22 @@ service pcm {
@handler listHistoryJobHandler
get /hpc/listHistoryJob (listHistoryJobReq) returns (listHistoryJobResp)
@handler queueAssetsHandler
get /queue/assets () returns (QueueAssetsResp)
}
//cloud二级接口
@server(
prefix: pcm/v1
group : cloud
)
service pcm {
@handler cloudListHandler
get /task/list () returns (cloudListResp)
@handler deleteYamlHandler
get /cloud/DeleteYaml (ApplyReq) returns (DeleteResp)
}
//智算二级接口
@ -217,6 +243,10 @@ service pcm {
group : vm
)
service pcm {
@handler GetComputeLimitsHandler
get /vm/getComputeLimits (GetComputeLimitsReq) returns (GetComputeLimitsResp)
@handler GetVolumeLimitsHandler
get /vm/getVolumeLimits (GetVolumeLimitsReq) returns (GetVolumeLimitsResp)
@handler ListServerHandler
get /vm/listServer (ListServersReq) returns (ListServersResp)
@handler ListServersDetailedHandler

View File

@ -7,6 +7,77 @@ info(
email: "1364512070@qq.com"
)
type (
Rate {
}
Absolute {
MaxServerMeta int64 `json:"max_server_meta,optional"`
MaxPersonality int64 `json:"max_personality,optional"`
TotalServerGroupsUsed int64 `json:"total_server_groups_used,optional"`
MaxImageMeta int64 `json:"max_image_meta,optional"`
MaxPersonalitySize int64 `json:"max_personality_size,optional"`
MaxTotalKeypairs int64 `json:"max_total_keypairs,optional"`
MaxSecurityGroupRules int64 `json:"max_security_group_rules,optional"`
MaxServerGroups int64 `json:"max_server_groups,optional"`
TotalCoresUsed int64 `json:"total_cores_used,optional"`
TotalRAMUsed int64 `json:"total_ram_used,optional"`
TotalInstancesUsed int64 `json:"total_instances_used,optional"`
MaxSecurityGroups int64 `json:"max_security_groups,optional"`
TotalFloatingIpsUsed int64 `json:"total_floating_ips_used,optional"`
MaxTotalCores int64 `json:"max_total_cores,optional"`
MaxServerGroupMembers int64 `json:"max_server_group_members,optional"`
MaxTotalFloatingIps int64 `json:"max_total_floating_ips,optional"`
TotalSecurityGroupsUsed int64 `json:"total_security_groups_used,optional"`
MaxTotalInstances int64 `json:"max_total_instances,optional"`
MaxTotalRAMSize int64 `json:"max_total_ram_size,optional"`
}
Limits {
rate Rate `json:"rate,optional"`
absolute Absolute `json:"absolute,optional"`
}
GetComputeLimitsReq {
Limit int32 `json:"limit,optional"`
OffSet int32 `json:"offSet,optional"`
}
GetComputeLimitsResp {
limits Limits `json:"limits,optional"`
Code int32 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
ErrorMsg string `json:"errorMsg,omitempty"`
}
)
type (
VolumeRate {
}
VolumeAbsolute {
TotalSnapshotsUsed int32 `json:"total_snapshots_used,optional"`
MaxTotalBackups int32 `json:"max_total_backups,optional"`
MaxTotalVolumeGigabytes int32 `json:"max_total_volume_gigabytes,optional"`
MaxTotalSnapshots int32 `json:"max_total_snapshots,optional"`
MaxTotalBackupGigabytes int32 `json:"max_total_backup_gigabytes,optional"`
TotalBackupGigabytesUsed int32 `json:"total_backup_gigabytes_used,optional"`
MaxTotalVolumes int32 `json:"max_total_volumes,optional"`
TotalVolumesUsed int32 `json:"total_volumes_used,optional"`
TotalBackupsUsed int32 `json:"total_backups_used,optional"`
TotalGigabytesUsed int32 `json:"total_gigabytes_used,optional"`
}
VolumeLimits {
rate VolumeRate `json:"rate,optional"`
absolute VolumeAbsolute `json:"absolute,optional"`
}
GetVolumeLimitsReq {
Limit int32 `json:"limit,optional"`
OffSet int32 `json:"offSet,optional"`
}
GetVolumeLimitsResp {
limits VolumeLimits `json:"limits,optional"`
Code int32 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
ErrorMsg string `json:"errorMsg,omitempty"`
}
)
/****************** servers start*************************/
type (
ListServersReq {
@ -103,7 +174,6 @@ type (
OSDCFDiskConfig string `json:"OS_DCF_diskConfig" copier:"OSDCFDiskConfig"`
SecurityGroups []Security_groups `json:"security_groups" copier:"SecurityGroups"`
AdminPass string `json:"adminPass" copier:"AdminPass"`
}
Security_groups {
Name string `json:"name" copier:"Name"`
@ -203,7 +273,6 @@ type(
Msg string `json:"msg,omitempty" copier:"Msg"`
ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"`
}
)
type (
UploadOsImageReq {
@ -225,7 +294,6 @@ type(
Msg string `json:"msg,omitempty"`
ErrorMsg string `json:"errorMsg,omitempty"`
}
)
/******************find images end*************************/
@ -277,7 +345,6 @@ type(
Msg string `json:"msg,omitempty" copier:"Msg"`
ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"`
}
)
type (
CreateNetworkReq {
@ -456,7 +523,6 @@ type(
Extra_specs {
Capabilities string `json:"capabilities" copier:"Capabilities"`
}
)
/******************find ListVolumesDetail end*************************/
@ -485,6 +551,4 @@ type(
rxtx_factor float32 `json:"rxtx_factor" copier:"rxtx_factor"`
os_flavor_access_is_public bool `json:"os_flavor_access_is_public" copier:"os_flavor_access_is_public"`
}
)

View File

@ -5,6 +5,7 @@ import (
"net/http"
ai "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/ai"
cloud "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/cloud"
core "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/core"
hpc "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/hpc"
image "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/image"
@ -93,6 +94,21 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Path: "/core/getComputilityStatistics",
Handler: core.GetComputilityStatisticsHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/core/assets",
Handler: core.NodeAssetsHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/core/saveHashcat",
Handler: core.SaveHashcatHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/core/getHashcat/:crackTaskId",
Handler: core.GetHashcatHandler(serverCtx),
},
},
rest.WithPrefix("/pcm/v1"),
)
@ -109,6 +125,27 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Path: "/hpc/listHistoryJob",
Handler: hpc.ListHistoryJobHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/queue/assets",
Handler: hpc.QueueAssetsHandler(serverCtx),
},
},
rest.WithPrefix("/pcm/v1"),
)
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodGet,
Path: "/task/list",
Handler: cloud.CloudListHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/cloud/DeleteYaml",
Handler: cloud.DeleteYamlHandler(serverCtx),
},
},
rest.WithPrefix("/pcm/v1"),
)
@ -318,6 +355,16 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodGet,
Path: "/vm/getComputeLimits",
Handler: vm.GetComputeLimitsHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/vm/getVolumeLimits",
Handler: vm.GetVolumeLimitsHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/vm/listServer",

View File

@ -2143,6 +2143,81 @@ type CheckResp struct {
Exist bool `json:"exist"`
}
type Rate struct {
}
type Absolute struct {
MaxServerMeta int64 `json:"max_server_meta,optional"`
MaxPersonality int64 `json:"max_personality,optional"`
TotalServerGroupsUsed int64 `json:"total_server_groups_used,optional"`
MaxImageMeta int64 `json:"max_image_meta,optional"`
MaxPersonalitySize int64 `json:"max_personality_size,optional"`
MaxTotalKeypairs int64 `json:"max_total_keypairs,optional"`
MaxSecurityGroupRules int64 `json:"max_security_group_rules,optional"`
MaxServerGroups int64 `json:"max_server_groups,optional"`
TotalCoresUsed int64 `json:"total_cores_used,optional"`
TotalRAMUsed int64 `json:"total_ram_used,optional"`
TotalInstancesUsed int64 `json:"total_instances_used,optional"`
MaxSecurityGroups int64 `json:"max_security_groups,optional"`
TotalFloatingIpsUsed int64 `json:"total_floating_ips_used,optional"`
MaxTotalCores int64 `json:"max_total_cores,optional"`
MaxServerGroupMembers int64 `json:"max_server_group_members,optional"`
MaxTotalFloatingIps int64 `json:"max_total_floating_ips,optional"`
TotalSecurityGroupsUsed int64 `json:"total_security_groups_used,optional"`
MaxTotalInstances int64 `json:"max_total_instances,optional"`
MaxTotalRAMSize int64 `json:"max_total_ram_size,optional"`
}
type Limits struct {
Rate Rate `json:"rate,optional"`
Absolute Absolute `json:"absolute,optional"`
}
type GetComputeLimitsReq struct {
Limit int32 `json:"limit,optional"`
OffSet int32 `json:"offSet,optional"`
}
type GetComputeLimitsResp struct {
Limits Limits `json:"limits,optional"`
Code int32 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
ErrorMsg string `json:"errorMsg,omitempty"`
}
type VolumeRate struct {
}
type VolumeAbsolute struct {
TotalSnapshotsUsed int32 `json:"total_snapshots_used,optional"`
MaxTotalBackups int32 `json:"max_total_backups,optional"`
MaxTotalVolumeGigabytes int32 `json:"max_total_volume_gigabytes,optional"`
MaxTotalSnapshots int32 `json:"max_total_snapshots,optional"`
MaxTotalBackupGigabytes int32 `json:"max_total_backup_gigabytes,optional"`
TotalBackupGigabytesUsed int32 `json:"total_backup_gigabytes_used,optional"`
MaxTotalVolumes int32 `json:"max_total_volumes,optional"`
TotalVolumesUsed int32 `json:"total_volumes_used,optional"`
TotalBackupsUsed int32 `json:"total_backups_used,optional"`
TotalGigabytesUsed int32 `json:"total_gigabytes_used,optional"`
}
type VolumeLimits struct {
Rate VolumeRate `json:"rate,optional"`
Absolute VolumeAbsolute `json:"absolute,optional"`
}
type GetVolumeLimitsReq struct {
Limit int32 `json:"limit,optional"`
OffSet int32 `json:"offSet,optional"`
}
type GetVolumeLimitsResp struct {
Limits VolumeLimits `json:"limits,optional"`
Code int32 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
ErrorMsg string `json:"errorMsg,omitempty"`
}
type ListServersReq struct {
Limit int32 `form:"limit,optional"`
OffSet int32 `form:"offSet,optional"`
@ -2584,3 +2659,50 @@ type Flavors struct {
Rxtx_factor float32 `json:"rxtx_factor" copier:"rxtx_factor"`
Os_flavor_access_is_public bool `json:"os_flavor_access_is_public" copier:"os_flavor_access_is_public"`
}
type ApplyReq struct {
YamlString string `json:"yamlString" copier:"yamlString"`
}
type DeleteReq struct {
YamlString string `json:"yamlString" copier:"yamlString"`
}
type ApplyResp struct {
Code int32 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
DataSet []DataSet `json:"dataSet,omitempty"`
}
type DeleteResp struct {
Code int32 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Data string `json:"data,omitempty"`
}
type DataSet struct {
ApiVersion int32 `json:"apiVersion,omitempty"`
Kind string `json:"kind,omitempty"`
Name string `json:"name,omitempty"`
NameSpace string `json:"nameSpace,omitempty"`
}
type CloudListResp struct {
Clouds []Cloud `json:"clouds"`
}
type Cloud struct {
Id int64 `json:"id"` // id
TaskId int64 `json:"taskId"` // 任务id
ParticipantId int64 `json:"participantId"` // 集群静态信息id
ApiVersion string `json:"apiVersion"`
Name string `json:"name"` // 名称
Namespace string `json:"namespace"` // 命名空间
Kind string `json:"kind"` // 种类
Status string `json:"status"` // 状态
StartTime string `json:"startTime"` // 开始时间
RunningTime int64 `json:"runningTime"` // 运行时长
CreatedBy int64 `json:"createdBy"` // 创建人
CreatedTime string `json:"createdTime"` // 创建时间
Result string `json:"result"`
}

2
go.mod
View File

@ -19,7 +19,7 @@ require (
gitlink.org.cn/jcce-pcm/pcm-participant-ceph v0.0.0-20230817103341-2459e5bfc835
gitlink.org.cn/jcce-pcm/pcm-participant-modelarts v0.0.0-20230719015658-08a29549d86a
gitlink.org.cn/jcce-pcm/pcm-participant-octopus v0.0.0-20230714030856-601935bc30e2
gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20230904012700-2e8e98c5fd2f
gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20230904093908-860f0b2b4eb4
gitlink.org.cn/jcce-pcm/pcm-participant-slurm v0.0.0-20230714030125-a52fa198ddf4
gitlink.org.cn/jcce-pcm/utils v0.0.2
gonum.org/v1/gonum v0.11.0

4
go.sum
View File

@ -1150,8 +1150,8 @@ gitlink.org.cn/jcce-pcm/pcm-participant-modelarts v0.0.0-20230719015658-08a29549
gitlink.org.cn/jcce-pcm/pcm-participant-modelarts v0.0.0-20230719015658-08a29549d86a/go.mod h1:BhOgwM1LC+BD46DjTaQyYQVZs1CikwI5Pl/6qzKUexc=
gitlink.org.cn/jcce-pcm/pcm-participant-octopus v0.0.0-20230714030856-601935bc30e2 h1:RcGSqhsod6VXLksSLqNjV0q/SCeoUv6CbThKmV9NTZE=
gitlink.org.cn/jcce-pcm/pcm-participant-octopus v0.0.0-20230714030856-601935bc30e2/go.mod h1:uyvpVqG1jHDXX+ubXI0RBwnWXzVykD/mliqGQIDvRoo=
gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20230904012700-2e8e98c5fd2f h1:SSmRAO+lCf7/r2sJ35akkCP61+lYTCNhPZXf59LJPa0=
gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20230904012700-2e8e98c5fd2f/go.mod h1:JRFx7CjtUDyjJGyLWuInhr4rKfqcNY66Fxi+jq+Y+sc=
gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20230904093908-860f0b2b4eb4 h1:uflRHFdG0fXwqwfHc8LVgs3DG0n4cIKBW+X7F9XgNXE=
gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20230904093908-860f0b2b4eb4/go.mod h1:JRFx7CjtUDyjJGyLWuInhr4rKfqcNY66Fxi+jq+Y+sc=
gitlink.org.cn/jcce-pcm/pcm-participant-slurm v0.0.0-20230714030125-a52fa198ddf4 h1:r2hBP5G/bbkPpDTPk3ENnQxD82vkoYMSeNHYhNAVRX4=
gitlink.org.cn/jcce-pcm/pcm-participant-slurm v0.0.0-20230714030125-a52fa198ddf4/go.mod h1:zRdVJiv4r4jgBli2xpYGmV0n6Gmz8fkZ5pJaNK2MbTU=
gitlink.org.cn/jcce-pcm/utils v0.0.2 h1:Stif8W9C9TOCS2hw4g+OlOywDrsVYNrkiyKfBrWkT0w=