From 9a87a6251902b98aba7953e2e22b4b35f433d214 Mon Sep 17 00:00:00 2001 From: zhouqunjie Date: Tue, 5 Sep 2023 09:52:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: cca78dded7684afa7b80b771aa6fc8a7c74b4d94 --- api/desc/pcm.api | 56 ++- api/desc/vm/pcm-vm.api | 716 ++++++++++++++++++--------------- api/internal/handler/routes.go | 47 +++ api/internal/types/types.go | 122 ++++++ go.mod | 2 +- go.sum | 4 +- 6 files changed, 605 insertions(+), 342 deletions(-) diff --git a/api/desc/pcm.api b/api/desc/pcm.api index c6404fc8..6c418e8f 100644 --- a/api/desc/pcm.api +++ b/api/desc/pcm.api @@ -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) } //智算二级接口 @@ -113,16 +139,16 @@ service pcm { // ListAlgorithms 查询创建算法列表 @handler ListAlgorithms //get /ai/ListAlgorithms (ListAlgorithmsReq) returns (ListAlgorithmsResp) - get /ai/ListAlgorithms/:projectId (ListAlgorithmsReq) returns (ListAlgorithmsResp) + get /ai/ListAlgorithms/:projectId (ListAlgorithmsReq) returns (ListAlgorithmsResp) // DeleteAlgorithm 删除算法 @handler DeleteAlgorithm - delete /ai/DeleteAlgorithm/:projectId/:algorithmId (DeleteAlgorithmReq) returns (DeleteAlgorithmResp) + delete /ai/DeleteAlgorithm/:projectId/:algorithmId (DeleteAlgorithmReq) returns (DeleteAlgorithmResp) // CreateTrainingJob 创建训练作业 @handler CreateTrainingJobHandler post /ai/CreateTrainingJob/:projectId (CreateTrainingJobReq) returns (CreateTrainingJobResp) // ShowAlgorithmByUuid 展示算法详情 @handler ShowAlgorithmByUuid - get /ai/ShowAlgorithmByUuid/:projectId/:algorithmId (ShowAlgorithmByUuidReq) returns (ShowAlgorithmByUuidResp) + get /ai/ShowAlgorithmByUuid/:projectId/:algorithmId (ShowAlgorithmByUuidReq) returns (ShowAlgorithmByUuidResp) // creat export task 创建导出任务 @handler CreateExportTaskHandler @@ -147,7 +173,7 @@ service pcm { get /ai/ShowService/:projectId/:serviceId (ShowServiceReq) returns (ShowServiceResp) // Delete service 删除服务 @handler DeleteServiceHandler - delete /ai/DeleteService/:projectId/:serviceId (DeleteServiceReq) returns (DeleteServiceResp) + delete /ai/DeleteService/:projectId/:serviceId (DeleteServiceReq) returns (DeleteServiceResp) // ListClusters查询专属资源池列表 @handler ListClustersHandler get /ai/ListClusters (ListClustersReq) returns (ListClustersResp) @@ -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 @@ -232,23 +262,23 @@ service pcm { @handler DeleteNetworkHandler delete /vm/deleteNetwork (DeleteNetworkReq) returns (DeleteNetworkResp) @handler CreateNetworkHandler - post /vm/createNetwork (CreateNetworkReq) returns (CreateNetworkResp) + post /vm/createNetwork (CreateNetworkReq) returns (CreateNetworkResp) @handler CreateSubnetHandler - post /vm/createSubnet (CreateSubnetReq) returns (CreateSubnetResp) + post /vm/createSubnet (CreateSubnetReq) returns (CreateSubnetResp) @handler ListVolumesDetailHandler - get /vm/listVolumesDetail (ListVolumesDetailReq) returns (ListVolumesDetailResp) + get /vm/listVolumesDetail (ListVolumesDetailReq) returns (ListVolumesDetailResp) @handler DeleteVolumeHandler delete /vm/deleteVolume (DeleteVolumeReq) returns (DeleteVolumeResp) @handler CreateVolumeHandler - post /vm/createVolume (CreateVolumeReq) returns (CreateVolumeResp) + post /vm/createVolume (CreateVolumeReq) returns (CreateVolumeResp) @handler ListFlavorsDetailHandler - get /vm/listFlavorsDetail (ListFlavorsDetailReq) returns (ListFlavorsDetailResp) + get /vm/listFlavorsDetail (ListFlavorsDetailReq) returns (ListFlavorsDetailResp) @handler CreateServerHandler - post /vm/createServer (CreateServerReq) returns (CreateServerResp) + post /vm/createServer (CreateServerReq) returns (CreateServerResp) @handler ListVolumeTypesHandler - get /vm/listVolumeTypes (ListVolumeTypesReq) returns (ListVolumeTypesResp) + get /vm/listVolumeTypes (ListVolumeTypesReq) returns (ListVolumeTypesResp) @handler CreateImageHandler - post /vm/createImage (CreateImageReq) returns (CreateImageResp) + post /vm/createImage (CreateImageReq) returns (CreateImageResp) @handler UploadImageHandler - put /vm/uploadImage (UploadOsImageReq) returns (UploadOsImageResp) + put /vm/uploadImage (UploadOsImageReq) returns (UploadOsImageResp) } \ No newline at end of file diff --git a/api/desc/vm/pcm-vm.api b/api/desc/vm/pcm-vm.api index fe308a20..19ae2911 100644 --- a/api/desc/vm/pcm-vm.api +++ b/api/desc/vm/pcm-vm.api @@ -7,113 +7,183 @@ 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 { - Limit int32 `form:"limit,optional"` - OffSet int32 `form:"offSet,optional"` + Limit int32 `form:"limit,optional"` + OffSet int32 `form:"offSet,optional"` } ListServersResp { - TotalNumber uint32 `json:"totalNumber" copier:"TotalNumber"` - Servers []Servers `json:"servers" copier:"Servers"` - servers_links []Servers_links `json:"serversLinks" copier:"Servers_links"` + TotalNumber uint32 `json:"totalNumber" copier:"TotalNumber"` + Servers []Servers `json:"servers" copier:"Servers"` + servers_links []Servers_links `json:"serversLinks" copier:"Servers_links"` Code int32 `json:"code,omitempty"` - Msg string `json:"msg,omitempty"` + Msg string `json:"msg,omitempty"` ErrorMsg string `json:"errorMsg,omitempty"` } Servers { - Id string `json:"id" copier:"Id"` - Name string `json:"name" copier:"Name"` - Links []Links `json:"links " copier:"Links "` + Id string `json:"id" copier:"Id"` + Name string `json:"name" copier:"Name"` + Links []Links `json:"links " copier:"Links "` } - Links { - Href string `json:"href " copier:"Href"` - Rel string `json:"rel" copier:"Rel"` + Links { + Href string `json:"href " copier:"Href"` + Rel string `json:"rel" copier:"Rel"` } - Servers_links{ - Href string `json:"href " copier:"Href"` - Rel string `json:"rel" copier:"Rel"` - } -) - -type( - ListServersDetailedReq{ - - } - ListServersDetailedResp{ - ServersDetailed []ServersDetailed `json:"servers" copier:"ServersDetailed"` - Code int32 `json:"code,omitempty"` - Msg string `json:"msg,omitempty"` - ErrorMsg string `json:"errorMsg,omitempty"` - } - - ServersDetailed{ - created string `json:"created" copier:"created"` - id string `json:"id" copier:"id"` - key_name string `json:"key_name" copier:"key_name"` - locked bool `json:"locked" copier:"locked"` - name string `json:"name" copier:"name"` - progress uint32 `json:"progress" copier:"progress"` - status string `json:"status" copier:"status"` - tenant_id string `json:"tenant_id" copier:"tenant_id"` - updated string `json:"updated" copier:"updated"` - user_id string `json:"user_id" copier:"user_id"` + Servers_links { + Href string `json:"href " copier:"Href"` + Rel string `json:"rel" copier:"Rel"` } ) type ( - DeleteServerReq{ - ServerId string `form:"server_id" copier:"ServerId"` + ListServersDetailedReq { + + } + ListServersDetailedResp { + ServersDetailed []ServersDetailed `json:"servers" copier:"ServersDetailed"` + Code int32 `json:"code,omitempty"` + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` } - DeleteServerResp{ + ServersDetailed { + created string `json:"created" copier:"created"` + id string `json:"id" copier:"id"` + key_name string `json:"key_name" copier:"key_name"` + locked bool `json:"locked" copier:"locked"` + name string `json:"name" copier:"name"` + progress uint32 `json:"progress" copier:"progress"` + status string `json:"status" copier:"status"` + tenant_id string `json:"tenant_id" copier:"tenant_id"` + updated string `json:"updated" copier:"updated"` + user_id string `json:"user_id" copier:"user_id"` + } +) + +type ( + DeleteServerReq { + ServerId string `form:"server_id" copier:"ServerId"` + } + + DeleteServerResp { Code int32 `json:"code,omitempty"` - Msg string `json:"msg,omitempty"` + Msg string `json:"msg,omitempty"` ErrorMsg string `json:"errorMsg,omitempty"` } ) type ( - CreateServerReq{ - Server Server `json:"server" copier:"Server"` + CreateServerReq { + Server Server `json:"server" copier:"Server"` } - CreateServerResp{ - Server ServerResp `json:"server" copier:"Server"` + CreateServerResp { + Server ServerResp `json:"server" copier:"Server"` Code int32 `json:"code,omitempty"` - Msg string `json:"msg,omitempty"` + Msg string `json:"msg,omitempty"` ErrorMsg string `json:"errorMsg,omitempty"` } Server { - Name string `json:"name" copier:"Name"` - FlavorRef string `json:"flavorRef" copier:"FlavorRef"` - ImageRef string `json:"imageRef" copier:"ImageRef"` - Networks []CreNetwork `json:"networks" copier:"Networks"` + Name string `json:"name" copier:"Name"` + FlavorRef string `json:"flavorRef" copier:"FlavorRef"` + ImageRef string `json:"imageRef" copier:"ImageRef"` + Networks []CreNetwork `json:"networks" copier:"Networks"` //AdminPass string `json:"adminPass" copier:"AdminPass"` BlockDeviceMappingV2 []Block_device_mapping_v2 `json:"block_device_mapping_v2" copier:"BlockDeviceMappingV2"` } CreNetwork { - Uuid string `json:"uuid" copier:"Uuid"` + Uuid string `json:"uuid" copier:"Uuid"` } ServerResp { - Id string `json:"id" copier:"Id"` - Links []Links `json:"links" copier:"Links"` - OSDCFDiskConfig string `json:"OS_DCF_diskConfig" copier:"OSDCFDiskConfig"` - SecurityGroups []Security_groups `json:"security_groups" copier:"SecurityGroups"` - AdminPass string `json:"adminPass" copier:"AdminPass"` - + Id string `json:"id" copier:"Id"` + Links []Links `json:"links" copier:"Links"` + 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"` + Name string `json:"name" copier:"Name"` } Block_device_mapping_v2 { - SourceType string `json:"source_type" copier:"SourceType"` - Uuid string `json:"uuid" copier:"Uuid"` - BootIndex string `json:"boot_index" copier:"BootIndex"` - DestinationType string `json:"destination_type" copier:"DestinationType"` - DeleteOnTermination bool `json:"delete_on_termination" copier:"DeleteOnTermination"` + SourceType string `json:"source_type" copier:"SourceType"` + Uuid string `json:"uuid" copier:"Uuid"` + BootIndex string `json:"boot_index" copier:"BootIndex"` + DestinationType string `json:"destination_type" copier:"DestinationType"` + DeleteOnTermination bool `json:"delete_on_termination" copier:"DeleteOnTermination"` } ) @@ -122,7 +192,7 @@ type ( /******************find images end*************************/ type ( ListImagesReq { - Limit int32 `form:"limit,optional"` + Limit int32 `form:"limit,optional"` // Marker string `json:"marker" copier:"Marker"` // Name string `json:"name" copier:"Name"` @@ -141,350 +211,344 @@ type ( // Sort string `json:"sort" copier:"Sort"` } ListImagesResp { - First string `json:"first" copier:"First"` - Next string `json:"next" copier:"Next"` - Schema string `json:"schema" copier:"Schema"` - Images []Images `json:"images" copier:"Images"` + First string `json:"first" copier:"First"` + Next string `json:"next" copier:"Next"` + Schema string `json:"schema" copier:"Schema"` + Images []Images `json:"images" copier:"Images"` Code int32 `json:"code,omitempty"` - Msg string `json:"msg,omitempty"` + Msg string `json:"msg,omitempty"` ErrorMsg string `json:"errorMsg,omitempty"` } Images { - Status string `json:"status" copier:"Status"` - Name string `json:"name" copier:"Name"` - Tags []Tags `json:"tags" copier:"Tags"` - Container_format string `json:"container_format" copier:"Container_format"` - Created_at string `json:"created_at" copier:"Created_at"` - Disk_format string `json:"disk_format" copier:"Disk_format"` - Updated_at string `json:"updated_at" copier:"Updated_at"` - Visibility string `json:"visibility" copier:"Visibility"` - Self string `json:"self" copier:"Self"` - min_disk uint32 `json:"min_disk" copier:"Min_disk"` - Protected bool `json:"protected" copier:"Protected"` - Id string `json:"id" copier:"Id"` - File string `json:"file" copier:"File"` - Checksum string `json:"checksum" copier:"Checksum"` - Os_hash_algo string `json:"os_hash_algo" copier:"Os_hash_algo"` - Os_hash_value string `json:"os_hash_value" copier:"Os_hash_value"` - Os_hidden string `json:"os_hidden" copier:"Os_hidden"` - Owner string `json:"owner" copier:"Owner"` - Size uint32 `json:"size" copier:"Size"` - Min_ram uint32 `json:"min_ram" copier:"Min_ram"` - Schema string `json:"schema" copier:"Schema"` - Virtual_size int32 `json:"virtual_size" copier:"Virtual_size"` + Status string `json:"status" copier:"Status"` + Name string `json:"name" copier:"Name"` + Tags []Tags `json:"tags" copier:"Tags"` + Container_format string `json:"container_format" copier:"Container_format"` + Created_at string `json:"created_at" copier:"Created_at"` + Disk_format string `json:"disk_format" copier:"Disk_format"` + Updated_at string `json:"updated_at" copier:"Updated_at"` + Visibility string `json:"visibility" copier:"Visibility"` + Self string `json:"self" copier:"Self"` + min_disk uint32 `json:"min_disk" copier:"Min_disk"` + Protected bool `json:"protected" copier:"Protected"` + Id string `json:"id" copier:"Id"` + File string `json:"file" copier:"File"` + Checksum string `json:"checksum" copier:"Checksum"` + Os_hash_algo string `json:"os_hash_algo" copier:"Os_hash_algo"` + Os_hash_value string `json:"os_hash_value" copier:"Os_hash_value"` + Os_hidden string `json:"os_hidden" copier:"Os_hidden"` + Owner string `json:"owner" copier:"Owner"` + Size uint32 `json:"size" copier:"Size"` + Min_ram uint32 `json:"min_ram" copier:"Min_ram"` + Schema string `json:"schema" copier:"Schema"` + Virtual_size int32 `json:"virtual_size" copier:"Virtual_size"` } Tags { } ) -type( - CreateImageReq{ - Container_format string `json:"container_format" copier:"Container_format"` - Disk_format string `json:"disk_format" copier:"Disk_format"` - Min_disk int32 `json:"min_disk" copier:"Min_disk"` - Min_ram int32 `json:"min_ram" copier:"Min_ram"` - Name string `json:"name" copier:"Name"` - Protected bool `json:"protected" copier:"Protected"` +type ( + CreateImageReq { + Container_format string `json:"container_format" copier:"Container_format"` + Disk_format string `json:"disk_format" copier:"Disk_format"` + Min_disk int32 `json:"min_disk" copier:"Min_disk"` + Min_ram int32 `json:"min_ram" copier:"Min_ram"` + Name string `json:"name" copier:"Name"` + Protected bool `json:"protected" copier:"Protected"` //Tags []Tags `json:"tags" copier:"Tags"` - Visibility string `json:"visibility" copier:"Visibility"` + Visibility string `json:"visibility" copier:"Visibility"` } CreateImageResp { - Location string `json:"location" copier:"Location"` - Created_at string `json:"created_at" copier:"Created_at"` - Container_format string `json:"Container_format" copier:"Container_format"` - Disk_format string `json:"disk_format" copier:"Disk_format"` - File string `json:"file" copier:"File"` - Id string `json:"id" copier:"Id"` - Min_disk int32 `json:"min_disk" copier:"Min_disk"` - Min_ram int32 `json:"min_ram" copier:"Min_ram"` - Status string `json:"status" copier:"Status"` - Visibility string `json:"visibility" copier:"Visibility"` + Location string `json:"location" copier:"Location"` + Created_at string `json:"created_at" copier:"Created_at"` + Container_format string `json:"Container_format" copier:"Container_format"` + Disk_format string `json:"disk_format" copier:"Disk_format"` + File string `json:"file" copier:"File"` + Id string `json:"id" copier:"Id"` + Min_disk int32 `json:"min_disk" copier:"Min_disk"` + Min_ram int32 `json:"min_ram" copier:"Min_ram"` + Status string `json:"status" copier:"Status"` + Visibility string `json:"visibility" copier:"Visibility"` Code int32 `json:"code,omitempty" copier:"Code"` - Msg string `json:"msg,omitempty" copier:"Msg"` + Msg string `json:"msg,omitempty" copier:"Msg"` ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` } - ) -type( - UploadOsImageReq{ - ImageId string `form:"image_id" copier:"ImageId"` +type ( + UploadOsImageReq { + ImageId string `form:"image_id" copier:"ImageId"` } UploadOsImageResp { Code int32 `json:"code,omitempty" copier:"Code"` - Msg string `json:"msg,omitempty" copier:"Msg"` + Msg string `json:"msg,omitempty" copier:"Msg"` ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` } ) -type( - DeleteImageReq{ - ImageId string `form:"image_id" copier:"ImageId"` - } - DeleteImageResp { - Code int32 `json:"code,omitempty"` - Msg string `json:"msg,omitempty"` - ErrorMsg string `json:"errorMsg,omitempty"` - } - -) -/******************find images end*************************/ - -/******************find Networks end*************************/ -type( - ListNetworksReq{ - - } - ListNetworksResp{ - Networks []Network `json:"networks" copier:"Networks"` - Code int32 `json:"code,omitempty"` - Msg string `json:"msg,omitempty"` - ErrorMsg string `json:"errorMsg,omitempty"` - } - Network { - AdminStateUp bool `json:"admin_state_up" copier:"AdminStateUp"` - AvailabilityZoneHints []string `json:"availability_zone_hints" copier:"AvailabilityZoneHints"` - AvailabilityZones []string `json:"availability_zones" copier:"AvailabilityZones"` - CreatedAt string `json:"created_at" copier:"CreatedAt"` - DnsDomain string `json:"dns_domain" copier:"DnsDomain"` - Id string `json:"id" copier:"Id"` - Ipv4AddressScope string `json:"ipv4_address_scope" copier:"Ipv4AddressScope"` - Ipv6AddressScope string `json:"ipv6_address_scope" copier:"Ipv6AddressScope"` - L2Adjacency bool `json:"l2_adjacency" copier:"L2Adjacency"` - Mtu int64 `json:"mtu" copier:"Mtu"` - Name string `json:"name" copier:"Name"` - PortSecurityEnabled bool `json:"port_security_enabled" copier:"PortSecurityEnabled"` - ProjectId string `json:"project_id" copier:"ProjectId"` - QosPolicyId string `json:"qos_policy_id" copier:"QosPolicyId"` - RevisionNumber string `json:"revision_number" copier:"RevisionNumber"` - Shared bool `json:"shared" copier:"Shared"` - RouterExternal bool `json:"router_external" copier:"RouterExternal"` - Status string `json:"status" copier:"Status"` - Subnets []string `json:"subnets" copier:"Subnets"` - Tags []string `json:"tags" copier:"Tags"` - TenantId string `json:"tenant_id" copier:"TenantId"` - UpdatedAt string `json:"updated_at" copier:"UpdatedAt"` - VlanTransparent bool `json:"vlan_transparent" copier:"VlanTransparent"` - Description string `json:"description" copier:"Description"` - IsDefault bool `json:"is_default" copier:"IsDefault"` - } -) -type( - DeleteNetworkReq{ - NetworkId string `form:"network_id" copier:"NetworkId"` - } - DeleteNetworkResp { - Code int32 `json:"code,omitempty" copier:"Code"` - Msg string `json:"msg,omitempty" copier:"Msg"` - ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` - } - -) -type( - CreateNetworkReq{ - Network CreateNetwork `json:"network" copier:"Network"` - } - CreateNetworkResp{ - Network Network `json:"network" copier:"Network"` - Code int32 `json:"code,omitempty" copier:"Code"` - Msg string `json:"msg,omitempty" copier:"Msg"` - ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` - } - CreateNetwork { - AdminStateUp bool `json:"admin_state_up" copier:"AdminStateUp"` - Name string `json:"name" copier:"Name"` - Shared bool `json:"shared" copier:"Shared"` - } -) - type ( - CreateSubnetReq{ - Subnet Subnet `json:"subnet" copier:"Subnet"` + DeleteImageReq { + ImageId string `form:"image_id" copier:"ImageId"` } - CreateSubnetResp{ - Subnet SubnetResp `json:"subnet" copier:"Subnet"` + DeleteImageResp { + Code int32 `json:"code,omitempty"` + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + } +) +/******************find images end*************************/ + +/******************find Networks end*************************/ +type ( + ListNetworksReq { + + } + ListNetworksResp { + Networks []Network `json:"networks" copier:"Networks"` + Code int32 `json:"code,omitempty"` + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + } + Network { + AdminStateUp bool `json:"admin_state_up" copier:"AdminStateUp"` + AvailabilityZoneHints []string `json:"availability_zone_hints" copier:"AvailabilityZoneHints"` + AvailabilityZones []string `json:"availability_zones" copier:"AvailabilityZones"` + CreatedAt string `json:"created_at" copier:"CreatedAt"` + DnsDomain string `json:"dns_domain" copier:"DnsDomain"` + Id string `json:"id" copier:"Id"` + Ipv4AddressScope string `json:"ipv4_address_scope" copier:"Ipv4AddressScope"` + Ipv6AddressScope string `json:"ipv6_address_scope" copier:"Ipv6AddressScope"` + L2Adjacency bool `json:"l2_adjacency" copier:"L2Adjacency"` + Mtu int64 `json:"mtu" copier:"Mtu"` + Name string `json:"name" copier:"Name"` + PortSecurityEnabled bool `json:"port_security_enabled" copier:"PortSecurityEnabled"` + ProjectId string `json:"project_id" copier:"ProjectId"` + QosPolicyId string `json:"qos_policy_id" copier:"QosPolicyId"` + RevisionNumber string `json:"revision_number" copier:"RevisionNumber"` + Shared bool `json:"shared" copier:"Shared"` + RouterExternal bool `json:"router_external" copier:"RouterExternal"` + Status string `json:"status" copier:"Status"` + Subnets []string `json:"subnets" copier:"Subnets"` + Tags []string `json:"tags" copier:"Tags"` + TenantId string `json:"tenant_id" copier:"TenantId"` + UpdatedAt string `json:"updated_at" copier:"UpdatedAt"` + VlanTransparent bool `json:"vlan_transparent" copier:"VlanTransparent"` + Description string `json:"description" copier:"Description"` + IsDefault bool `json:"is_default" copier:"IsDefault"` + } +) +type ( + DeleteNetworkReq { + NetworkId string `form:"network_id" copier:"NetworkId"` + } + DeleteNetworkResp { Code int32 `json:"code,omitempty" copier:"Code"` - Msg string `json:"msg,omitempty" copier:"Msg"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) +type ( + CreateNetworkReq { + Network CreateNetwork `json:"network" copier:"Network"` + } + CreateNetworkResp { + Network Network `json:"network" copier:"Network"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } + CreateNetwork { + AdminStateUp bool `json:"admin_state_up" copier:"AdminStateUp"` + Name string `json:"name" copier:"Name"` + Shared bool `json:"shared" copier:"Shared"` + } +) + +type ( + CreateSubnetReq { + Subnet Subnet `json:"subnet" copier:"Subnet"` + } + CreateSubnetResp { + Subnet SubnetResp `json:"subnet" copier:"Subnet"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` } Subnet { - NetworkId string `json:"network_id" copier:"NetworkId"` - Name string `json:"name" copier:"Name"` - Cidr string `json:"cidr" copier:"Cidr"` - Ip_version int32 `json:"ip_version" copier:"IpVersion"` - Gateway_ip string `json:"gateway_ip" copier:"GatewayIp"` - Enable_dhcp bool `json:"enable_dhcp" copier:"EnableDhcp"` + NetworkId string `json:"network_id" copier:"NetworkId"` + Name string `json:"name" copier:"Name"` + Cidr string `json:"cidr" copier:"Cidr"` + Ip_version int32 `json:"ip_version" copier:"IpVersion"` + Gateway_ip string `json:"gateway_ip" copier:"GatewayIp"` + Enable_dhcp bool `json:"enable_dhcp" copier:"EnableDhcp"` Allocation_pools []Allocation_pools `json:"allocation_pools" copier:"AllocationPools"` Dns_nameservers []string `json:"dns_nameservers" copier:"DnsNameservers"` - Host_routes []string `json:"host_routes" copier:"HostRoutes"` + Host_routes []string `json:"host_routes" copier:"HostRoutes"` } SubnetResp { - Name string `json:"name" copier:"Name"` - Cidr string `json:"cidr" copier:"Cidr"` - Ip_version int32 `json:"ip_version" copier:"Ip_version"` - Gateway_ip string `json:"gateway_ip" copier:"Gateway_ip"` - Enable_dhcp bool `json:"enable_dhcp" copier:"Enable_dhcp"` + Name string `json:"name" copier:"Name"` + Cidr string `json:"cidr" copier:"Cidr"` + Ip_version int32 `json:"ip_version" copier:"Ip_version"` + Gateway_ip string `json:"gateway_ip" copier:"Gateway_ip"` + Enable_dhcp bool `json:"enable_dhcp" copier:"Enable_dhcp"` Allocation_pools []Allocation_pools `json:"allocation_pools" copier:"Allocation_pools"` Dns_nameservers []string `json:"dns_nameservers" copier:"Dns_nameservers"` - Host_routes []string `json:"host_routes" copier:"Host_routes"` - Network_id string `json:"network_id" copier:"Network_id"` - Segment_id string `json:"segment_id" copier:"Segment_id"` - Project_id string `json:"project_id" copier:"Project_id"` - Tenant_id string `json:"tenant_id" copier:"Tenant_id"` - Dns_publish_fixed_ip string `json:"Dns_publish_fixed_ip" copier:"Dns_publish_fixed_ip"` - Id string `json:"id" copier:"Id"` - Created_at string `json:"created_at" copier:"Created_at"` - Description string `json:"description" copier:"Description"` - Ipv6_address_mode string `json:"ipv6_address_mode" copier:"Ipv6_address_mode"` - Ipv6_ra_mode string `json:"ipv6_ra_mode" copier:"Ipv6_ra_mode"` - Revision_number string `json:"revision_number" copier:"Revision_number"` - Service_types []string `json:"service_types" copier:"Service_types"` - Subnetpool_id string `json:"subnetpool_id" copier:"Subnetpool_id"` - Tags []string `json:"tags" copier:"Tags"` - Updated_at string `json:"updated_at" copier:"Updated_at"` + Host_routes []string `json:"host_routes" copier:"Host_routes"` + Network_id string `json:"network_id" copier:"Network_id"` + Segment_id string `json:"segment_id" copier:"Segment_id"` + Project_id string `json:"project_id" copier:"Project_id"` + Tenant_id string `json:"tenant_id" copier:"Tenant_id"` + Dns_publish_fixed_ip string `json:"Dns_publish_fixed_ip" copier:"Dns_publish_fixed_ip"` + Id string `json:"id" copier:"Id"` + Created_at string `json:"created_at" copier:"Created_at"` + Description string `json:"description" copier:"Description"` + Ipv6_address_mode string `json:"ipv6_address_mode" copier:"Ipv6_address_mode"` + Ipv6_ra_mode string `json:"ipv6_ra_mode" copier:"Ipv6_ra_mode"` + Revision_number string `json:"revision_number" copier:"Revision_number"` + Service_types []string `json:"service_types" copier:"Service_types"` + Subnetpool_id string `json:"subnetpool_id" copier:"Subnetpool_id"` + Tags []string `json:"tags" copier:"Tags"` + Updated_at string `json:"updated_at" copier:"Updated_at"` } - Allocation_pools{ - Start string `json:"start" copier:"Start"` - End string `json:"end" copier:"End"` + Allocation_pools { + Start string `json:"start" copier:"Start"` + End string `json:"end" copier:"End"` } ) /******************find Networks end*************************/ /******************find ListVolumesDetail start*************************/ -type( - ListVolumesDetailReq{ +type ( + ListVolumesDetailReq { } - ListVolumesDetailResp{ - VolumeDetail []VolumeDetail `json:"volumes" copier:"VolumeDetail"` + ListVolumesDetailResp { + VolumeDetail []VolumeDetail `json:"volumes" copier:"VolumeDetail"` Code int32 `json:"code,omitempty"` - Msg string `json:"msg,omitempty"` + Msg string `json:"msg,omitempty"` ErrorMsg string `json:"errorMsg,omitempty"` } - VolumeDetail{ - created_at string `json:"created_at" copier:"created_at"` - id string `json:"id" copier:"id"` - availability_zone string `json:"availability_zone" copier:"availability_zone"` - encrypted bool `json:"encrypted" copier:"encrypted"` - name string `json:"name" copier:"name"` - size int32 `json:"size" copier:"size"` - status string `json:"status" copier:"status"` - tenant_id string `json:"tenant_id" copier:"tenant_id"` - updated string `json:"Updated" copier:"updated"` - user_id string `json:"User_id" copier:"user_id"` - description string `json:"description" copier:"description"` - multiattach bool `json:"multiattach" copier:"multiattach"` - bootable bool `json:"bootable" copier:"bootable"` - volume_type string `json:"volume_type" copier:"volume_type"` - count int32 `json:"count" copier:"Count"` - shared_targets bool `json:"shared_targets" copier:"shared_targets"` - consumes_quota bool `json:"consumes_quota" copier:"consumes_quota"` + VolumeDetail { + created_at string `json:"created_at" copier:"created_at"` + id string `json:"id" copier:"id"` + availability_zone string `json:"availability_zone" copier:"availability_zone"` + encrypted bool `json:"encrypted" copier:"encrypted"` + name string `json:"name" copier:"name"` + size int32 `json:"size" copier:"size"` + status string `json:"status" copier:"status"` + tenant_id string `json:"tenant_id" copier:"tenant_id"` + updated string `json:"Updated" copier:"updated"` + user_id string `json:"User_id" copier:"user_id"` + description string `json:"description" copier:"description"` + multiattach bool `json:"multiattach" copier:"multiattach"` + bootable bool `json:"bootable" copier:"bootable"` + volume_type string `json:"volume_type" copier:"volume_type"` + count int32 `json:"count" copier:"Count"` + shared_targets bool `json:"shared_targets" copier:"shared_targets"` + consumes_quota bool `json:"consumes_quota" copier:"consumes_quota"` } ) -type( - DeleteVolumeReq{ - VolumeId string `form:"volume_id" copier:"VolumeId"` - cascade bool `json:"cascade" copier:"cascade"` - force bool `json:"force" copier:"force"` +type ( + DeleteVolumeReq { + VolumeId string `form:"volume_id" copier:"VolumeId"` + cascade bool `json:"cascade" copier:"cascade"` + force bool `json:"force" copier:"force"` } DeleteVolumeResp { Code int32 `json:"code,omitempty" copier:"Code"` - Msg string `json:"msg,omitempty" copier:"Msg"` + Msg string `json:"msg,omitempty" copier:"Msg"` ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` } ) -type( - CreateVolumeReq{ - Volume Volume `json:"volume" copier:"Volume"` +type ( + CreateVolumeReq { + Volume Volume `json:"volume" copier:"Volume"` } CreateVolumeResp { - Volume VolumeResp `json:"volume" copier:"Volume"` + Volume VolumeResp `json:"volume" copier:"Volume"` Code int32 `json:"code,omitempty" copier:"Code"` - Msg string `json:"msg,omitempty" copier:"Msg"` + Msg string `json:"msg,omitempty" copier:"Msg"` ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` } Volume { - Size int32 `json:"size" copier:"Size"` - AvailabilityZone string `json:"availability_zone" copier:"AvailabilityZone"` - Description string `json:"description" copier:"Description"` - Name string `json:"name" copier:"Name"` - VolumeType string `json:"volume_type" copier:"VolumeType"` + Size int32 `json:"size" copier:"Size"` + AvailabilityZone string `json:"availability_zone" copier:"AvailabilityZone"` + Description string `json:"description" copier:"Description"` + Name string `json:"name" copier:"Name"` + VolumeType string `json:"volume_type" copier:"VolumeType"` } - VolumeResp{ - CreatedAt string `json:"created_at" copier:"CreatedAt"` - Id string `json:"id" copier:"Id"` - AvailabilityZone string `json:"availability_zone" copier:"AvailabilityZone"` - Encrypted bool `json:"encrypted" copier:"Encrypted"` - Name string `json:"name" copier:"Name"` - Size int32 `json:"size" copier:"Size"` - Status string `json:"status" copier:"Status"` - TenantId string `json:"tenant_id" copier:"TenantId"` - Updated string `json:"updated" copier:"Updated"` - UserId string `json:"user_id" copier:"UserId"` - Description string `json:"description" copier:"Description"` - Multiattach bool `json:"multiattach" copier:"Multiattach"` - Bootable bool `json:"bootable" copier:"Bootable"` - VolumeType string `json:"volume_type" copier:"VolumeType"` - Count int32 `json:"count" copier:"Count"` - SharedTargets bool `json:"shared_targets" copier:"SharedTargets"` - ConsumesQuota bool `json:"consumes_quota" copier:"ConsumesQuota"` + VolumeResp { + CreatedAt string `json:"created_at" copier:"CreatedAt"` + Id string `json:"id" copier:"Id"` + AvailabilityZone string `json:"availability_zone" copier:"AvailabilityZone"` + Encrypted bool `json:"encrypted" copier:"Encrypted"` + Name string `json:"name" copier:"Name"` + Size int32 `json:"size" copier:"Size"` + Status string `json:"status" copier:"Status"` + TenantId string `json:"tenant_id" copier:"TenantId"` + Updated string `json:"updated" copier:"Updated"` + UserId string `json:"user_id" copier:"UserId"` + Description string `json:"description" copier:"Description"` + Multiattach bool `json:"multiattach" copier:"Multiattach"` + Bootable bool `json:"bootable" copier:"Bootable"` + VolumeType string `json:"volume_type" copier:"VolumeType"` + Count int32 `json:"count" copier:"Count"` + SharedTargets bool `json:"shared_targets" copier:"SharedTargets"` + ConsumesQuota bool `json:"consumes_quota" copier:"ConsumesQuota"` } ) -type( - ListVolumeTypesReq{ +type ( + ListVolumeTypesReq { } - ListVolumeTypesResp{ - VolumeTypes []Volume_types `json:"volume_types" copier:"VolumeTypes"` + ListVolumeTypesResp { + VolumeTypes []Volume_types `json:"volume_types" copier:"VolumeTypes"` Code int32 `json:"code,omitempty" copier:"Code"` - Msg string `json:"msg,omitempty" copier:"Msg"` + Msg string `json:"msg,omitempty" copier:"Msg"` ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` } - Volume_types{ - Description string `json:"description" copier:"Description"` - Id string `json:"id" copier:"Id"` - IsPublic bool `json:"is_public" copier:"IsPublic"` - Name string `json:"name" copier:"Name"` - OsVolumeTypeAccessIsPublic bool `json:"os_volume_type_access_is_public" copier:"OsVolumeTypeAccessIsPublic"` - QosSpecsId string `json:"qos_specs_id" copier:"QosSpecsId"` - ExtraSpecs Extra_specs `json:"extra_specs" copier:"ExtraSpecs"` + Volume_types { + Description string `json:"description" copier:"Description"` + Id string `json:"id" copier:"Id"` + IsPublic bool `json:"is_public" copier:"IsPublic"` + Name string `json:"name" copier:"Name"` + OsVolumeTypeAccessIsPublic bool `json:"os_volume_type_access_is_public" copier:"OsVolumeTypeAccessIsPublic"` + QosSpecsId string `json:"qos_specs_id" copier:"QosSpecsId"` + ExtraSpecs Extra_specs `json:"extra_specs" copier:"ExtraSpecs"` } Extra_specs { - Capabilities string `json:"capabilities" copier:"Capabilities"` + Capabilities string `json:"capabilities" copier:"Capabilities"` } - ) /******************find ListVolumesDetail end*************************/ -type( - ListFlavorsDetailReq{ +type ( + ListFlavorsDetailReq { } - ListFlavorsDetailResp{ - Flavor []Flavors `json:"flavors" copier:"Flavor"` + ListFlavorsDetailResp { + Flavor []Flavors `json:"flavors" copier:"Flavor"` Code int32 `json:"code,omitempty"` - Msg string `json:"msg,omitempty"` + Msg string `json:"msg,omitempty"` ErrorMsg string `json:"errorMsg,omitempty"` } - Flavors{ - name string `json:"name" copier:"name"` - description string `json:"description" copier:"description"` - id string `json:"id" copier:"id"` - disk int32 `json:"disk" copier:"disk"` - ephemeral uint32 `json:"ephemeral" copier:"ephemeral"` - original_name string `json:"original_name" copier:"original_name"` - ram int32 `json:"ram" copier:"ram"` - swap int32 `json:"swap" copier:"swap"` - vcpus int32 `json:"vcpus" copier:"vcpus"` - 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"` + Flavors { + name string `json:"name" copier:"name"` + description string `json:"description" copier:"description"` + id string `json:"id" copier:"id"` + disk int32 `json:"disk" copier:"disk"` + ephemeral uint32 `json:"ephemeral" copier:"ephemeral"` + original_name string `json:"original_name" copier:"original_name"` + ram int32 `json:"ram" copier:"ram"` + swap int32 `json:"swap" copier:"swap"` + vcpus int32 `json:"vcpus" copier:"vcpus"` + 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"` } - - ) \ No newline at end of file diff --git a/api/internal/handler/routes.go b/api/internal/handler/routes.go index 07003774..af2c099c 100644 --- a/api/internal/handler/routes.go +++ b/api/internal/handler/routes.go @@ -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", diff --git a/api/internal/types/types.go b/api/internal/types/types.go index b71d1fcd..cee39f34 100644 --- a/api/internal/types/types.go +++ b/api/internal/types/types.go @@ -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"` +} diff --git a/go.mod b/go.mod index 40a54a06..bdeea3f8 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index df6fdc5e..31ea0124 100644 --- a/go.sum +++ b/go.sum @@ -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=