openstack C端实现
Former-commit-id: 1b06963640128ac9c65b621ce96830d1aef14c42
This commit is contained in:
parent
1e70b9e3e9
commit
ca27385099
|
@ -5,6 +5,7 @@ import (
|
||||||
"hpc/pcm-hpc.api"
|
"hpc/pcm-hpc.api"
|
||||||
"ai/pcm-ai.api"
|
"ai/pcm-ai.api"
|
||||||
"storage/pcm-storage.api"
|
"storage/pcm-storage.api"
|
||||||
|
"vm/pcm-vm.api"
|
||||||
)
|
)
|
||||||
|
|
||||||
info(
|
info(
|
||||||
|
@ -213,3 +214,39 @@ service pcm {
|
||||||
@handler uploadDataSetHandler
|
@handler uploadDataSetHandler
|
||||||
post /dataSet/upload () returns ()
|
post /dataSet/upload () returns ()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//openstack 接口
|
||||||
|
@server(
|
||||||
|
prefix: pcm/v1
|
||||||
|
group : vm
|
||||||
|
)
|
||||||
|
service pcm {
|
||||||
|
@handler ListServerHandler
|
||||||
|
get /vm/listServer (ListServersReq) returns (ListServersResp)
|
||||||
|
@handler ListServersDetailedHandler
|
||||||
|
get /vm/listServersDetailed (ListServersDetailedReq) returns (ListServersDetailedResp)
|
||||||
|
@handler DeleteServerHandler
|
||||||
|
delete /vm/deleteServer (DeleteServerReq) returns (DeleteServerResp)
|
||||||
|
@handler ListImagesHandler
|
||||||
|
get /vm/listImages (ListImagesReq) returns (ListImagesResp)
|
||||||
|
@handler DeleteImageHandler
|
||||||
|
delete /vm/deleteImage (DeleteImageReq) returns (DeleteImageResp)
|
||||||
|
@handler ListNetworksHandler
|
||||||
|
get /vm/listNetworks (ListNetworksReq) returns (ListNetworksResp)
|
||||||
|
@handler DeleteNetworkHandler
|
||||||
|
delete /vm/deleteNetwork (DeleteNetworkReq) returns (DeleteNetworkResp)
|
||||||
|
@handler CreateNetworkHandler
|
||||||
|
post /vm/createNetwork (CreateNetworkReq) returns (CreateNetworkResp)
|
||||||
|
@handler CreateSubnetHandler
|
||||||
|
post /vm/createSubnet (CreateSubnetReq) returns (CreateSubnetResp)
|
||||||
|
@handler ListVolumesDetailHandler
|
||||||
|
get /vm/listVolumesDetail (ListVolumesDetailReq) returns (ListVolumesDetailResp)
|
||||||
|
@handler DeleteVolumeHandler
|
||||||
|
delete /vm/deleteVolume (DeleteVolumeReq) returns (DeleteVolumeResp)
|
||||||
|
@handler CreateVolumeHandler
|
||||||
|
post /vm/createVolume (CreateVolumeReq) returns (CreateVolumeResp)
|
||||||
|
@handler ListFlavorsDetailHandler
|
||||||
|
get /vm/listFlavorsDetail (ListFlavorsDetailReq) returns (ListFlavorsDetailResp)
|
||||||
|
@handler CreateServerHandler
|
||||||
|
post /vm/createServer (CreateServerReq) returns (CreateServerResp)
|
||||||
|
}
|
|
@ -0,0 +1,438 @@
|
||||||
|
syntax = "v1"
|
||||||
|
|
||||||
|
info(
|
||||||
|
title: "VM core"
|
||||||
|
desc: "VM core微服务"
|
||||||
|
author: "wanqgi"
|
||||||
|
email: "1364512070@qq.com"
|
||||||
|
)
|
||||||
|
|
||||||
|
/****************** servers start*************************/
|
||||||
|
|
||||||
|
type (
|
||||||
|
ListServersReq {
|
||||||
|
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"`
|
||||||
|
Code int32 `json:"code,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 "`
|
||||||
|
}
|
||||||
|
|
||||||
|
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"`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
type (
|
||||||
|
DeleteServerReq{
|
||||||
|
ServerId string `form:"server_id" copier:"ServerId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
DeleteServerResp{
|
||||||
|
Code int32 `json:"code,omitempty"`
|
||||||
|
Msg string `json:"msg,omitempty"`
|
||||||
|
ErrorMsg string `json:"errorMsg,omitempty"`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
type (
|
||||||
|
CreateServerReq{
|
||||||
|
Server Server `json:"server" copier:"Server"`
|
||||||
|
}
|
||||||
|
CreateServerResp{
|
||||||
|
Server ServerResp `json:"server" copier:"Server"`
|
||||||
|
Code int32 `json:"code,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"`
|
||||||
|
//AdminPass string `json:"adminPass" copier:"AdminPass"`
|
||||||
|
}
|
||||||
|
CreNetwork {
|
||||||
|
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"`
|
||||||
|
|
||||||
|
}
|
||||||
|
Security_groups {
|
||||||
|
Name string `json:"name" copier:"Name"`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
/****************** servers end*************************/
|
||||||
|
|
||||||
|
/******************find images end*************************/
|
||||||
|
type (
|
||||||
|
ListImagesReq {
|
||||||
|
Limit int32 `form:"limit,optional"`
|
||||||
|
|
||||||
|
// Marker string `json:"marker" copier:"Marker"`
|
||||||
|
// Name string `json:"name" copier:"Name"`
|
||||||
|
// Owner string `json:"owner" copier:"Owner"`
|
||||||
|
// Protected bool `json:"protected" copier:"Protected"`
|
||||||
|
// Status int32 `json:"status" copier:"Status"`
|
||||||
|
// Visibility int32 `json:"visibility" copier:"Visibility"`
|
||||||
|
// Os_hidden bool `json:"os_hidden" copier:"Os_hidden"`
|
||||||
|
// Member_status string `json:"member_status" copier:"Member_status"`
|
||||||
|
// Size_max string `json:"size_max" copier:"Size_max"`
|
||||||
|
// Size_min string `json:"size_min" copier:"Size_min"`
|
||||||
|
// Created_at string `json:"created_at" copier:"Created_at"`
|
||||||
|
// Updated_at string `json:"updated_at" copier:"Updated_at"`
|
||||||
|
// Sort_dir string `json:"sort_dir" copier:"Sort_dir"`
|
||||||
|
// Sort_key string `json:"sort_key" copier:"Sort_key"`
|
||||||
|
// 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"`
|
||||||
|
Code int32 `json:"code,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"`
|
||||||
|
}
|
||||||
|
Tags {
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
type(
|
||||||
|
CreateImageReq{
|
||||||
|
Container_format string `json:"container_format" copier:"Container_format"`
|
||||||
|
Disk_format string `json:"disk_format" copier:"Disk_format"`
|
||||||
|
Id string `json:"id" copier:"Id"`
|
||||||
|
Min_disk string `json:"min_disk" copier:"Min_disk"`
|
||||||
|
Min_ram string `json:"min_ram" copier:"Min_ram"`
|
||||||
|
Name string `json:"name" copier:"Name"`
|
||||||
|
Protected string `json:"protected" copier:"Protected"`
|
||||||
|
Tags []Tags `json:"tags" copier:"Tags"`
|
||||||
|
visibility string `json:"visibility" copier:"visibility"`
|
||||||
|
}
|
||||||
|
CreateImageResq {
|
||||||
|
Location string `json:"location" copier:"Location"`
|
||||||
|
}
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
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"`
|
||||||
|
}
|
||||||
|
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"`
|
||||||
|
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"`
|
||||||
|
}
|
||||||
|
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"`
|
||||||
|
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"`
|
||||||
|
}
|
||||||
|
Allocation_pools{
|
||||||
|
Start string `json:"start" copier:"Start"`
|
||||||
|
End string `json:"end" copier:"End"`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
/******************find Networks end*************************/
|
||||||
|
|
||||||
|
/******************find ListVolumesDetail start*************************/
|
||||||
|
type(
|
||||||
|
ListVolumesDetailReq{
|
||||||
|
|
||||||
|
}
|
||||||
|
ListVolumesDetailResp{
|
||||||
|
VolumeDetail []VolumeDetail `json:"volumes" copier:"VolumeDetail"`
|
||||||
|
Code int32 `json:"code,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"`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
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"`
|
||||||
|
ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
type(
|
||||||
|
CreateVolumeReq{
|
||||||
|
Volume Volume `json:"volume" copier:"Volume"`
|
||||||
|
}
|
||||||
|
CreateVolumeResp {
|
||||||
|
Volume VolumeResp `json:"volume" copier:"Volume"`
|
||||||
|
Code int32 `json:"code,omitempty" copier:"Code"`
|
||||||
|
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"`
|
||||||
|
}
|
||||||
|
|
||||||
|
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"`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
/******************find ListVolumesDetail end*************************/
|
||||||
|
|
||||||
|
type(
|
||||||
|
ListFlavorsDetailReq{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ListFlavorsDetailResp{
|
||||||
|
Flavor []Flavors `json:"flavors" copier:"Flavor"`
|
||||||
|
Code int32 `json:"code,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"`
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
)
|
|
@ -4,10 +4,10 @@ NacosConfig:
|
||||||
ServerConfigs:
|
ServerConfigs:
|
||||||
# - IpAddr: 127.0.0.1
|
# - IpAddr: 127.0.0.1
|
||||||
# Port: 8848
|
# Port: 8848
|
||||||
- IpAddr: nacos.jcce.dev
|
- IpAddr: 119.45.100.73
|
||||||
Port: 8848
|
Port: 8848
|
||||||
ClientConfig:
|
ClientConfig:
|
||||||
NamespaceId: test
|
NamespaceId: zhouqj
|
||||||
TimeoutMs: 5000
|
TimeoutMs: 5000
|
||||||
NotLoadCacheAtStart: true
|
NotLoadCacheAtStart: true
|
||||||
LogDir:
|
LogDir:
|
||||||
|
|
|
@ -31,6 +31,7 @@ type Config struct {
|
||||||
THRpcConf zrpc.RpcClientConf
|
THRpcConf zrpc.RpcClientConf
|
||||||
ModelArtsRpcConf zrpc.RpcClientConf
|
ModelArtsRpcConf zrpc.RpcClientConf
|
||||||
CephRpcConf zrpc.RpcClientConf
|
CephRpcConf zrpc.RpcClientConf
|
||||||
|
OpenstackRpcConf zrpc.RpcClientConf
|
||||||
OctopusRpcConf zrpc.RpcClientConf
|
OctopusRpcConf zrpc.RpcClientConf
|
||||||
NexusUrl string
|
NexusUrl string
|
||||||
JccScheduleUrl string
|
JccScheduleUrl string
|
||||||
|
|
|
@ -9,6 +9,7 @@ import (
|
||||||
hpc "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/hpc"
|
hpc "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/hpc"
|
||||||
image "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/image"
|
image "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/image"
|
||||||
storage "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/storage"
|
storage "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/storage"
|
||||||
|
vm "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/vm"
|
||||||
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/rest"
|
"github.com/zeromicro/go-zero/rest"
|
||||||
|
@ -319,4 +320,80 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||||
},
|
},
|
||||||
rest.WithPrefix("/pcm/v1"),
|
rest.WithPrefix("/pcm/v1"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
server.AddRoutes(
|
||||||
|
[]rest.Route{
|
||||||
|
{
|
||||||
|
Method: http.MethodGet,
|
||||||
|
Path: "/vm/listServer",
|
||||||
|
Handler: vm.ListServerHandler(serverCtx),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodGet,
|
||||||
|
Path: "/vm/listServersDetailed",
|
||||||
|
Handler: vm.ListServersDetailedHandler(serverCtx),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodDelete,
|
||||||
|
Path: "/vm/deleteServer",
|
||||||
|
Handler: vm.DeleteServerHandler(serverCtx),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodGet,
|
||||||
|
Path: "/vm/listImages",
|
||||||
|
Handler: vm.ListImagesHandler(serverCtx),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodDelete,
|
||||||
|
Path: "/vm/deleteImage",
|
||||||
|
Handler: vm.DeleteImageHandler(serverCtx),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodGet,
|
||||||
|
Path: "/vm/listNetworks",
|
||||||
|
Handler: vm.ListNetworksHandler(serverCtx),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodDelete,
|
||||||
|
Path: "/vm/deleteNetwork",
|
||||||
|
Handler: vm.DeleteNetworkHandler(serverCtx),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodPost,
|
||||||
|
Path: "/vm/createNetwork",
|
||||||
|
Handler: vm.CreateNetworkHandler(serverCtx),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodPost,
|
||||||
|
Path: "/vm/createSubnet",
|
||||||
|
Handler: vm.CreateSubnetHandler(serverCtx),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodGet,
|
||||||
|
Path: "/vm/listVolumesDetail",
|
||||||
|
Handler: vm.ListVolumesDetailHandler(serverCtx),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodDelete,
|
||||||
|
Path: "/vm/deleteVolume",
|
||||||
|
Handler: vm.DeleteVolumeHandler(serverCtx),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodPost,
|
||||||
|
Path: "/vm/createVolume",
|
||||||
|
Handler: vm.CreateVolumeHandler(serverCtx),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodGet,
|
||||||
|
Path: "/vm/listFlavorsDetail",
|
||||||
|
Handler: vm.ListFlavorsDetailHandler(serverCtx),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodPost,
|
||||||
|
Path: "/vm/createServer",
|
||||||
|
Handler: vm.CreateServerHandler(serverCtx),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rest.WithPrefix("/pcm/v1"),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/logic/vm"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func CreateNetworkHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
var req types.CreateNetworkReq
|
||||||
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
l := vm.NewCreateNetworkLogic(r.Context(), svcCtx)
|
||||||
|
resp, err := l.CreateNetwork(&req)
|
||||||
|
if err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
} else {
|
||||||
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/logic/vm"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func CreateServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
var req types.CreateServerReq
|
||||||
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
l := vm.NewCreateServerLogic(r.Context(), svcCtx)
|
||||||
|
resp, err := l.CreateServer(&req)
|
||||||
|
if err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
} else {
|
||||||
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/logic/vm"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func CreateSubnetHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
var req types.CreateSubnetReq
|
||||||
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
l := vm.NewCreateSubnetLogic(r.Context(), svcCtx)
|
||||||
|
resp, err := l.CreateSubnet(&req)
|
||||||
|
if err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
} else {
|
||||||
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/logic/vm"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func CreateVolumeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
var req types.CreateVolumeReq
|
||||||
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
l := vm.NewCreateVolumeLogic(r.Context(), svcCtx)
|
||||||
|
resp, err := l.CreateVolume(&req)
|
||||||
|
if err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
} else {
|
||||||
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/logic/vm"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func DeleteImageHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
var req types.DeleteImageReq
|
||||||
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
l := vm.NewDeleteImageLogic(r.Context(), svcCtx)
|
||||||
|
resp, err := l.DeleteImage(&req)
|
||||||
|
if err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
} else {
|
||||||
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/logic/vm"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func DeleteNetworkHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
var req types.DeleteNetworkReq
|
||||||
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
l := vm.NewDeleteNetworkLogic(r.Context(), svcCtx)
|
||||||
|
resp, err := l.DeleteNetwork(&req)
|
||||||
|
if err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
} else {
|
||||||
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/logic/vm"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func DeleteServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
var req types.DeleteServerReq
|
||||||
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
l := vm.NewDeleteServerLogic(r.Context(), svcCtx)
|
||||||
|
resp, err := l.DeleteServer(&req)
|
||||||
|
if err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
} else {
|
||||||
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/logic/vm"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func DeleteVolumeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
var req types.DeleteVolumeReq
|
||||||
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
l := vm.NewDeleteVolumeLogic(r.Context(), svcCtx)
|
||||||
|
resp, err := l.DeleteVolume(&req)
|
||||||
|
if err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
} else {
|
||||||
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/logic/vm"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func ListFlavorsDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
var req types.ListFlavorsDetailReq
|
||||||
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
l := vm.NewListFlavorsDetailLogic(r.Context(), svcCtx)
|
||||||
|
resp, err := l.ListFlavorsDetail(&req)
|
||||||
|
if err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
} else {
|
||||||
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/logic/vm"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func ListImagesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
var req types.ListImagesReq
|
||||||
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
l := vm.NewListImagesLogic(r.Context(), svcCtx)
|
||||||
|
resp, err := l.ListImages(&req)
|
||||||
|
if err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
} else {
|
||||||
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/logic/vm"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func ListNetworksHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
var req types.ListNetworksReq
|
||||||
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
l := vm.NewListNetworksLogic(r.Context(), svcCtx)
|
||||||
|
resp, err := l.ListNetworks(&req)
|
||||||
|
if err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
} else {
|
||||||
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/logic/vm"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func ListServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
var req types.ListServersReq
|
||||||
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
l := vm.NewListServerLogic(r.Context(), svcCtx)
|
||||||
|
resp, err := l.ListServer(&req)
|
||||||
|
if err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
} else {
|
||||||
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/logic/vm"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func ListServersDetailedHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
var req types.ListServersDetailedReq
|
||||||
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
l := vm.NewListServersDetailedLogic(r.Context(), svcCtx)
|
||||||
|
resp, err := l.ListServersDetailed(&req)
|
||||||
|
if err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
} else {
|
||||||
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/logic/vm"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func ListVolumesDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
var req types.ListVolumesDetailReq
|
||||||
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
l := vm.NewListVolumesDetailLogic(r.Context(), svcCtx)
|
||||||
|
resp, err := l.ListVolumesDetail(&req)
|
||||||
|
if err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
} else {
|
||||||
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/jinzhu/copier"
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/result"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/tool"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/xerr"
|
||||||
|
"k8s.io/apimachinery/pkg/util/json"
|
||||||
|
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CreateNetworkLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCreateNetworkLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateNetworkLogic {
|
||||||
|
return &CreateNetworkLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *CreateNetworkLogic) CreateNetwork(req *types.CreateNetworkReq) (resp *types.CreateNetworkResp, err error) {
|
||||||
|
// todo: add your logic here and delete this line
|
||||||
|
CreateNetworkReq := &openstack.CreateNetworkReq{}
|
||||||
|
err = copier.CopyWithOption(CreateNetworkReq, req, copier.Option{Converters: tool.Converters})
|
||||||
|
CreateNetworkResp, err := l.svcCtx.OpenstackRpc.CreateNetwork(l.ctx, CreateNetworkReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get Servers list"), "Failed to get db Servers list err : %v ,req:%+v", err, req)
|
||||||
|
}
|
||||||
|
marshal, err := json.Marshal(&CreateNetworkResp)
|
||||||
|
if err != nil {
|
||||||
|
return nil, result.NewDefaultError(err.Error())
|
||||||
|
}
|
||||||
|
json.Unmarshal(marshal, &resp)
|
||||||
|
err = copier.CopyWithOption(&resp, &CreateNetworkResp, copier.Option{Converters: tool.Converters})
|
||||||
|
return resp, err
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/jinzhu/copier"
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/result"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/tool"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/xerr"
|
||||||
|
"k8s.io/apimachinery/pkg/util/json"
|
||||||
|
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CreateServerLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCreateServerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateServerLogic {
|
||||||
|
return &CreateServerLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *CreateServerLogic) CreateServer(req *types.CreateServerReq) (resp *types.CreateServerResp, err error) {
|
||||||
|
// todo: add your logic here and delete this line
|
||||||
|
CreateServerReq := &openstack.CreateServerReq{}
|
||||||
|
err = copier.CopyWithOption(CreateServerReq, req, copier.Option{Converters: tool.Converters})
|
||||||
|
CreateServerResp, err := l.svcCtx.OpenstackRpc.CreateServer(l.ctx, CreateServerReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get Servers list"), "Failed to get db Servers list err : %v ,req:%+v", err, req)
|
||||||
|
}
|
||||||
|
marshal, err := json.Marshal(&CreateServerResp)
|
||||||
|
if err != nil {
|
||||||
|
return nil, result.NewDefaultError(err.Error())
|
||||||
|
}
|
||||||
|
json.Unmarshal(marshal, &resp)
|
||||||
|
err = copier.CopyWithOption(&resp, &CreateServerResp, copier.Option{Converters: tool.Converters})
|
||||||
|
return resp, err
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/jinzhu/copier"
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/result"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/tool"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/xerr"
|
||||||
|
"k8s.io/apimachinery/pkg/util/json"
|
||||||
|
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CreateSubnetLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCreateSubnetLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateSubnetLogic {
|
||||||
|
return &CreateSubnetLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *CreateSubnetLogic) CreateSubnet(req *types.CreateSubnetReq) (resp *types.CreateSubnetResp, err error) {
|
||||||
|
// todo: add your logic here and delete this line
|
||||||
|
CreateSubnetReq := &openstack.CreateSubnetReq{}
|
||||||
|
err = copier.CopyWithOption(CreateSubnetReq, req, copier.Option{Converters: tool.Converters})
|
||||||
|
CreateSubnetResp, err := l.svcCtx.OpenstackRpc.CreateSubnet(l.ctx, CreateSubnetReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get Servers list"), "Failed to get db Servers list err : %v ,req:%+v", err, req)
|
||||||
|
}
|
||||||
|
marshal, err := json.Marshal(&CreateSubnetResp)
|
||||||
|
if err != nil {
|
||||||
|
return nil, result.NewDefaultError(err.Error())
|
||||||
|
}
|
||||||
|
json.Unmarshal(marshal, &resp)
|
||||||
|
err = copier.CopyWithOption(&resp, &CreateSubnetResp, copier.Option{Converters: tool.Converters})
|
||||||
|
return resp, err
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/jinzhu/copier"
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/result"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/tool"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/xerr"
|
||||||
|
"k8s.io/apimachinery/pkg/util/json"
|
||||||
|
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CreateVolumeLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCreateVolumeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateVolumeLogic {
|
||||||
|
return &CreateVolumeLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *CreateVolumeLogic) CreateVolume(req *types.CreateVolumeReq) (resp *types.CreateVolumeResp, err error) {
|
||||||
|
// todo: add your logic here and delete this line
|
||||||
|
CreateVolumeReq := &openstack.CreateVolumeReq{}
|
||||||
|
err = copier.CopyWithOption(CreateVolumeReq, req, copier.Option{Converters: tool.Converters})
|
||||||
|
CreateVolumeResp, err := l.svcCtx.OpenstackRpc.CreateVolume(l.ctx, CreateVolumeReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get Servers list"), "Failed to get db Servers list err : %v ,req:%+v", err, req)
|
||||||
|
}
|
||||||
|
marshal, err := json.Marshal(&CreateVolumeResp)
|
||||||
|
if err != nil {
|
||||||
|
return nil, result.NewDefaultError(err.Error())
|
||||||
|
}
|
||||||
|
json.Unmarshal(marshal, &resp)
|
||||||
|
err = copier.CopyWithOption(&resp, &CreateVolumeResp, copier.Option{Converters: tool.Converters})
|
||||||
|
return resp, err
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/jinzhu/copier"
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/result"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/tool"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/xerr"
|
||||||
|
"k8s.io/apimachinery/pkg/util/json"
|
||||||
|
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DeleteImageLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDeleteImageLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteImageLogic {
|
||||||
|
return &DeleteImageLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *DeleteImageLogic) DeleteImage(req *types.DeleteImageReq) (resp *types.DeleteImageResp, err error) {
|
||||||
|
// todo: add your logic here and delete this line
|
||||||
|
DeleteImageReq := &openstack.DeleteImageReq{}
|
||||||
|
err = copier.CopyWithOption(DeleteImageReq, req, copier.Option{Converters: tool.Converters})
|
||||||
|
DeleteImageResp, err := l.svcCtx.OpenstackRpc.DeleteImage(l.ctx, DeleteImageReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get Servers list"), "Failed to get db Servers list err : %v ,req:%+v", err, req)
|
||||||
|
}
|
||||||
|
marshal, err := json.Marshal(&DeleteImageResp)
|
||||||
|
if err != nil {
|
||||||
|
return nil, result.NewDefaultError(err.Error())
|
||||||
|
}
|
||||||
|
json.Unmarshal(marshal, &resp)
|
||||||
|
err = copier.CopyWithOption(&resp, &DeleteImageResp, copier.Option{Converters: tool.Converters})
|
||||||
|
return resp, err
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/jinzhu/copier"
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/result"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/tool"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/xerr"
|
||||||
|
"k8s.io/apimachinery/pkg/util/json"
|
||||||
|
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DeleteNetworkLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDeleteNetworkLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteNetworkLogic {
|
||||||
|
return &DeleteNetworkLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *DeleteNetworkLogic) DeleteNetwork(req *types.DeleteNetworkReq) (resp *types.DeleteNetworkResp, err error) {
|
||||||
|
// todo: add your logic here and delete this line
|
||||||
|
DeleteNetworkReq := &openstack.DeleteNetworkReq{}
|
||||||
|
err = copier.CopyWithOption(DeleteNetworkReq, req, copier.Option{Converters: tool.Converters})
|
||||||
|
DeleteNetworkResp, err := l.svcCtx.OpenstackRpc.DeleteNetwork(l.ctx, DeleteNetworkReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to delete network "), "Failed to delete network err : %v ,req:%+v", err, req)
|
||||||
|
}
|
||||||
|
marshal, err := json.Marshal(&DeleteNetworkResp)
|
||||||
|
if err != nil {
|
||||||
|
return nil, result.NewDefaultError(err.Error())
|
||||||
|
}
|
||||||
|
json.Unmarshal(marshal, &resp)
|
||||||
|
err = copier.CopyWithOption(&resp, &DeleteNetworkResp, copier.Option{Converters: tool.Converters})
|
||||||
|
return resp, err
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/jinzhu/copier"
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/result"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/tool"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/xerr"
|
||||||
|
"k8s.io/apimachinery/pkg/util/json"
|
||||||
|
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DeleteServerLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDeleteServerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteServerLogic {
|
||||||
|
return &DeleteServerLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *DeleteServerLogic) DeleteServer(req *types.DeleteServerReq) (resp *types.DeleteServerResp, err error) {
|
||||||
|
// todo: add your logic here and delete this line
|
||||||
|
DeleteServerReq := &openstack.DeleteServerReq{}
|
||||||
|
err = copier.CopyWithOption(DeleteServerReq, req, copier.Option{Converters: tool.Converters})
|
||||||
|
DeleteServerResp, err := l.svcCtx.OpenstackRpc.DeleteServer(l.ctx, DeleteServerReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get Servers list"), "Failed to get db Servers list err : %v ,req:%+v", err, req)
|
||||||
|
}
|
||||||
|
marshal, err := json.Marshal(&DeleteServerResp)
|
||||||
|
if err != nil {
|
||||||
|
return nil, result.NewDefaultError(err.Error())
|
||||||
|
}
|
||||||
|
json.Unmarshal(marshal, &resp)
|
||||||
|
err = copier.CopyWithOption(&resp, &DeleteServerResp, copier.Option{Converters: tool.Converters})
|
||||||
|
return resp, err
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/jinzhu/copier"
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/result"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/tool"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/xerr"
|
||||||
|
"k8s.io/apimachinery/pkg/util/json"
|
||||||
|
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DeleteVolumeLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDeleteVolumeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteVolumeLogic {
|
||||||
|
return &DeleteVolumeLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *DeleteVolumeLogic) DeleteVolume(req *types.DeleteVolumeReq) (resp *types.DeleteVolumeResp, err error) {
|
||||||
|
// todo: add your logic here and delete this line
|
||||||
|
DeleteVolumeReq := &openstack.DeleteVolumeReq{}
|
||||||
|
err = copier.CopyWithOption(DeleteVolumeReq, req, copier.Option{Converters: tool.Converters})
|
||||||
|
DeleteVolumeResp, err := l.svcCtx.OpenstackRpc.DeleteVolume(l.ctx, DeleteVolumeReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get Servers list"), "Failed to get db Servers list err : %v ,req:%+v", err, req)
|
||||||
|
}
|
||||||
|
marshal, err := json.Marshal(&DeleteVolumeResp)
|
||||||
|
if err != nil {
|
||||||
|
return nil, result.NewDefaultError(err.Error())
|
||||||
|
}
|
||||||
|
json.Unmarshal(marshal, &resp)
|
||||||
|
err = copier.CopyWithOption(&resp, &DeleteVolumeResp, copier.Option{Converters: tool.Converters})
|
||||||
|
return resp, err
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/jinzhu/copier"
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/result"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/tool"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/xerr"
|
||||||
|
"k8s.io/apimachinery/pkg/util/json"
|
||||||
|
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ListFlavorsDetailLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewListFlavorsDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListFlavorsDetailLogic {
|
||||||
|
return &ListFlavorsDetailLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *ListFlavorsDetailLogic) ListFlavorsDetail(req *types.ListFlavorsDetailReq) (resp *types.ListFlavorsDetailResp, err error) {
|
||||||
|
// todo: add your logic here and delete this line
|
||||||
|
ListFlavorsDetailReq := &openstack.ListFlavorsDetailReq{}
|
||||||
|
err = copier.CopyWithOption(ListFlavorsDetailReq, req, copier.Option{Converters: tool.Converters})
|
||||||
|
ListFlavorsDetailResp, err := l.svcCtx.OpenstackRpc.ListFlavorsDetail(l.ctx, ListFlavorsDetailReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get Servers list"), "Failed to get db Servers list err : %v ,req:%+v", err, req)
|
||||||
|
}
|
||||||
|
marshal, err := json.Marshal(&ListFlavorsDetailResp)
|
||||||
|
if err != nil {
|
||||||
|
return nil, result.NewDefaultError(err.Error())
|
||||||
|
}
|
||||||
|
json.Unmarshal(marshal, &resp)
|
||||||
|
err = copier.CopyWithOption(&resp, &ListFlavorsDetailResp, copier.Option{Converters: tool.Converters})
|
||||||
|
return resp, err
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/jinzhu/copier"
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/result"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/tool"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/xerr"
|
||||||
|
"k8s.io/apimachinery/pkg/util/json"
|
||||||
|
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ListImagesLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewListImagesLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListImagesLogic {
|
||||||
|
return &ListImagesLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *ListImagesLogic) ListImages(req *types.ListImagesReq) (resp *types.ListImagesResp, err error) {
|
||||||
|
// todo: add your logic here and delete this line
|
||||||
|
ListImagesReq := &openstack.ListImagesReq{}
|
||||||
|
err = copier.CopyWithOption(ListImagesReq, req, copier.Option{Converters: tool.Converters})
|
||||||
|
ListImagesResp, err := l.svcCtx.OpenstackRpc.LisImages(l.ctx, ListImagesReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get Servers list"), "Failed to get db Servers list err : %v ,req:%+v", err, req)
|
||||||
|
}
|
||||||
|
marshal, err := json.Marshal(&ListImagesResp)
|
||||||
|
if err != nil {
|
||||||
|
return nil, result.NewDefaultError(err.Error())
|
||||||
|
}
|
||||||
|
json.Unmarshal(marshal, &resp)
|
||||||
|
err = copier.CopyWithOption(&resp, &ListImagesResp, copier.Option{Converters: tool.Converters})
|
||||||
|
return resp, err
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/jinzhu/copier"
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/result"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/tool"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/xerr"
|
||||||
|
"k8s.io/apimachinery/pkg/util/json"
|
||||||
|
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ListNetworksLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewListNetworksLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListNetworksLogic {
|
||||||
|
return &ListNetworksLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *ListNetworksLogic) ListNetworks(req *types.ListNetworksReq) (resp *types.ListNetworksResp, err error) {
|
||||||
|
// todo: add your logic here and delete this line
|
||||||
|
ListNetworksReq := &openstack.ListNetworksReq{}
|
||||||
|
err = copier.CopyWithOption(ListNetworksReq, req, copier.Option{Converters: tool.Converters})
|
||||||
|
ListNetworksResp, err := l.svcCtx.OpenstackRpc.ListNetworks(l.ctx, ListNetworksReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get Servers list"), "Failed to get db Servers list err : %v ,req:%+v", err, req)
|
||||||
|
}
|
||||||
|
marshal, err := json.Marshal(&ListNetworksResp)
|
||||||
|
if err != nil {
|
||||||
|
return nil, result.NewDefaultError(err.Error())
|
||||||
|
}
|
||||||
|
json.Unmarshal(marshal, &resp)
|
||||||
|
err = copier.CopyWithOption(&resp, &ListNetworksResp, copier.Option{Converters: tool.Converters})
|
||||||
|
return resp, err
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/jinzhu/copier"
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/result"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/tool"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/xerr"
|
||||||
|
"k8s.io/apimachinery/pkg/util/json"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ListServerLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewListServerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListServerLogic {
|
||||||
|
return &ListServerLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *ListServerLogic) ListServer(req *types.ListServersReq) (resp *types.ListServersResp, err error) {
|
||||||
|
// todo: add your logic here and delete this line
|
||||||
|
ListServersReq := &openstack.ListServersReq{}
|
||||||
|
err = copier.CopyWithOption(ListServersReq, req, copier.Option{Converters: tool.Converters})
|
||||||
|
ListServersResp, err := l.svcCtx.OpenstackRpc.ListServers(l.ctx, ListServersReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get Servers list"), "Failed to get db Servers list err : %v ,req:%+v", err, req)
|
||||||
|
}
|
||||||
|
marshal, err := json.Marshal(&ListServersResp)
|
||||||
|
if err != nil {
|
||||||
|
return nil, result.NewDefaultError(err.Error())
|
||||||
|
}
|
||||||
|
json.Unmarshal(marshal, &resp)
|
||||||
|
err = copier.CopyWithOption(&resp, &ListServersResp, copier.Option{Converters: tool.Converters})
|
||||||
|
return resp, err
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/jinzhu/copier"
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/result"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/tool"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/xerr"
|
||||||
|
"k8s.io/apimachinery/pkg/util/json"
|
||||||
|
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ListServersDetailedLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewListServersDetailedLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListServersDetailedLogic {
|
||||||
|
return &ListServersDetailedLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *ListServersDetailedLogic) ListServersDetailed(req *types.ListServersDetailedReq) (resp *types.ListServersDetailedResp, err error) {
|
||||||
|
// todo: add your logic here and delete this line
|
||||||
|
ListServersDetailedReq := &openstack.ListServersDetailedReq{}
|
||||||
|
err = copier.CopyWithOption(ListServersDetailedReq, req, copier.Option{Converters: tool.Converters})
|
||||||
|
ListServersDetailedResp, err := l.svcCtx.OpenstackRpc.ListServersDetailed(l.ctx, ListServersDetailedReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get Servers list"), "Failed to get db Servers list err : %v ,req:%+v", err, req)
|
||||||
|
}
|
||||||
|
marshal, err := json.Marshal(&ListServersDetailedResp)
|
||||||
|
if err != nil {
|
||||||
|
return nil, result.NewDefaultError(err.Error())
|
||||||
|
}
|
||||||
|
json.Unmarshal(marshal, &resp)
|
||||||
|
err = copier.CopyWithOption(&resp, &ListServersDetailedResp, copier.Option{Converters: tool.Converters})
|
||||||
|
return resp, err
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package vm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/jinzhu/copier"
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/result"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/tool"
|
||||||
|
"gitlink.org.cn/jcce-pcm/utils/xerr"
|
||||||
|
"k8s.io/apimachinery/pkg/util/json"
|
||||||
|
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ListVolumesDetailLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewListVolumesDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListVolumesDetailLogic {
|
||||||
|
return &ListVolumesDetailLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *ListVolumesDetailLogic) ListVolumesDetail(req *types.ListVolumesDetailReq) (resp *types.ListVolumesDetailResp, err error) {
|
||||||
|
// todo: add your logic here and delete this line
|
||||||
|
ListVolumesDetailReq := &openstack.ListVolumesDetailReq{}
|
||||||
|
err = copier.CopyWithOption(ListVolumesDetailReq, req, copier.Option{Converters: tool.Converters})
|
||||||
|
ListVolumesDetailResp, err := l.svcCtx.OpenstackRpc.ListVolumesDetail(l.ctx, ListVolumesDetailReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get Volumes list"), "Failed to get db Volumes list err : %v ,req:%+v", err, req)
|
||||||
|
}
|
||||||
|
marshal, err := json.Marshal(&ListVolumesDetailResp)
|
||||||
|
if err != nil {
|
||||||
|
return nil, result.NewDefaultError(err.Error())
|
||||||
|
}
|
||||||
|
json.Unmarshal(marshal, &resp)
|
||||||
|
err = copier.CopyWithOption(&resp, &ListVolumesDetailResp, copier.Option{Converters: tool.Converters})
|
||||||
|
return resp, err
|
||||||
|
|
||||||
|
}
|
|
@ -16,6 +16,7 @@ import (
|
||||||
"gitlink.org.cn/jcce-pcm/pcm-participant-ceph/cephclient"
|
"gitlink.org.cn/jcce-pcm/pcm-participant-ceph/cephclient"
|
||||||
"gitlink.org.cn/jcce-pcm/pcm-participant-modelarts/modelartsclient"
|
"gitlink.org.cn/jcce-pcm/pcm-participant-modelarts/modelartsclient"
|
||||||
"gitlink.org.cn/jcce-pcm/pcm-participant-octopus/octopusclient"
|
"gitlink.org.cn/jcce-pcm/pcm-participant-octopus/octopusclient"
|
||||||
|
"gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstackclient"
|
||||||
"gitlink.org.cn/jcce-pcm/pcm-participant-slurm/hpcthclient"
|
"gitlink.org.cn/jcce-pcm/pcm-participant-slurm/hpcthclient"
|
||||||
"gitlink.org.cn/jcce-pcm/utils/tool"
|
"gitlink.org.cn/jcce-pcm/utils/tool"
|
||||||
"gorm.io/driver/mysql"
|
"gorm.io/driver/mysql"
|
||||||
|
@ -36,6 +37,7 @@ type ServiceContext struct {
|
||||||
THRpc hpcthclient.HpcTH
|
THRpc hpcthclient.HpcTH
|
||||||
OctopusRpc octopusclient.Octopus
|
OctopusRpc octopusclient.Octopus
|
||||||
CephRpc cephclient.Ceph
|
CephRpc cephclient.Ceph
|
||||||
|
OpenstackRpc openstackclient.Openstack
|
||||||
DockerClient *client.Client
|
DockerClient *client.Client
|
||||||
Downloader *s3manager.Downloader
|
Downloader *s3manager.Downloader
|
||||||
Uploader *s3manager.Uploader
|
Uploader *s3manager.Uploader
|
||||||
|
@ -84,6 +86,7 @@ func NewServiceContext(c config.Config) *ServiceContext {
|
||||||
CephRpc: cephclient.NewCeph(zrpc.MustNewClient(c.CephRpcConf)),
|
CephRpc: cephclient.NewCeph(zrpc.MustNewClient(c.CephRpcConf)),
|
||||||
ACRpc: hpcacclient.NewHpcAC(zrpc.MustNewClient(c.ACRpcConf)),
|
ACRpc: hpcacclient.NewHpcAC(zrpc.MustNewClient(c.ACRpcConf)),
|
||||||
OctopusRpc: octopusclient.NewOctopus(zrpc.MustNewClient(c.OctopusRpcConf)),
|
OctopusRpc: octopusclient.NewOctopus(zrpc.MustNewClient(c.OctopusRpcConf)),
|
||||||
|
OpenstackRpc: openstackclient.NewOpenstack(zrpc.MustNewClient(c.OpenstackRpcConf)),
|
||||||
DockerClient: dockerClient,
|
DockerClient: dockerClient,
|
||||||
Downloader: downloader,
|
Downloader: downloader,
|
||||||
Uploader: uploader,
|
Uploader: uploader,
|
||||||
|
|
|
@ -2101,3 +2101,392 @@ type CheckReq struct {
|
||||||
type CheckResp struct {
|
type CheckResp struct {
|
||||||
Exist bool `json:"exist"`
|
Exist bool `json:"exist"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ListServersReq struct {
|
||||||
|
Limit int32 `form:"limit,optional"`
|
||||||
|
OffSet int32 `form:"offSet,optional"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListServersResp struct {
|
||||||
|
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"`
|
||||||
|
ErrorMsg string `json:"errorMsg,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Servers struct {
|
||||||
|
Id string `json:"id" copier:"Id"`
|
||||||
|
Name string `json:"name" copier:"Name"`
|
||||||
|
Links []Links `json:"links " copier:"Links "`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Links struct {
|
||||||
|
Href string `json:"href " copier:"Href"`
|
||||||
|
Rel string `json:"rel" copier:"Rel"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Servers_links struct {
|
||||||
|
Href string `json:"href " copier:"Href"`
|
||||||
|
Rel string `json:"rel" copier:"Rel"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListServersDetailedReq struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListServersDetailedResp struct {
|
||||||
|
ServersDetailed []ServersDetailed `json:"servers" copier:"ServersDetailed"`
|
||||||
|
Code int32 `json:"code,omitempty"`
|
||||||
|
Msg string `json:"msg,omitempty"`
|
||||||
|
ErrorMsg string `json:"errorMsg,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ServersDetailed struct {
|
||||||
|
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 struct {
|
||||||
|
ServerId string `form:"server_id" copier:"ServerId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteServerResp struct {
|
||||||
|
Code int32 `json:"code,omitempty"`
|
||||||
|
Msg string `json:"msg,omitempty"`
|
||||||
|
ErrorMsg string `json:"errorMsg,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateServerReq struct {
|
||||||
|
Server Server `json:"server" copier:"Server"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateServerResp struct {
|
||||||
|
Server ServerResp `json:"server" copier:"Server"`
|
||||||
|
Code int32 `json:"code,omitempty"`
|
||||||
|
Msg string `json:"msg,omitempty"`
|
||||||
|
ErrorMsg string `json:"errorMsg,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Server struct {
|
||||||
|
Name string `json:"name" copier:"Name"`
|
||||||
|
FlavorRef string `json:"flavorRef" copier:"FlavorRef"`
|
||||||
|
ImageRef string `json:"imageRef" copier:"ImageRef"`
|
||||||
|
Networks []CreNetwork `json:"networks" copier:"Networks"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreNetwork struct {
|
||||||
|
Uuid string `json:"uuid" copier:"Uuid"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ServerResp struct {
|
||||||
|
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"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Security_groups struct {
|
||||||
|
Name string `json:"name" copier:"Name"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListImagesReq struct {
|
||||||
|
Limit int32 `form:"limit,optional"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListImagesResp struct {
|
||||||
|
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"`
|
||||||
|
ErrorMsg string `json:"errorMsg,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Images struct {
|
||||||
|
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"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Tags struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateImageReq struct {
|
||||||
|
Container_format string `json:"container_format" copier:"Container_format"`
|
||||||
|
Disk_format string `json:"disk_format" copier:"Disk_format"`
|
||||||
|
Id string `json:"id" copier:"Id"`
|
||||||
|
Min_disk string `json:"min_disk" copier:"Min_disk"`
|
||||||
|
Min_ram string `json:"min_ram" copier:"Min_ram"`
|
||||||
|
Name string `json:"name" copier:"Name"`
|
||||||
|
Protected string `json:"protected" copier:"Protected"`
|
||||||
|
Tags []Tags `json:"tags" copier:"Tags"`
|
||||||
|
Visibility string `json:"visibility" copier:"visibility"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateImageResq struct {
|
||||||
|
Location string `json:"location" copier:"Location"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteImageReq struct {
|
||||||
|
ImageId string `form:"image_id" copier:"ImageId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteImageResp struct {
|
||||||
|
Code int32 `json:"code,omitempty"`
|
||||||
|
Msg string `json:"msg,omitempty"`
|
||||||
|
ErrorMsg string `json:"errorMsg,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListNetworksReq struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListNetworksResp struct {
|
||||||
|
Networks []Network `json:"networks" copier:"Networks"`
|
||||||
|
Code int32 `json:"code,omitempty"`
|
||||||
|
Msg string `json:"msg,omitempty"`
|
||||||
|
ErrorMsg string `json:"errorMsg,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Network struct {
|
||||||
|
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 struct {
|
||||||
|
NetworkId string `form:"network_id" copier:"NetworkId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteNetworkResp struct {
|
||||||
|
Code int32 `json:"code,omitempty" copier:"Code"`
|
||||||
|
Msg string `json:"msg,omitempty" copier:"Msg"`
|
||||||
|
ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateNetworkReq struct {
|
||||||
|
Network CreateNetwork `json:"network" copier:"Network"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateNetworkResp struct {
|
||||||
|
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"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateNetwork struct {
|
||||||
|
AdminStateUp bool `json:"admin_state_up" copier:"AdminStateUp"`
|
||||||
|
Name string `json:"name" copier:"Name"`
|
||||||
|
Shared bool `json:"shared" copier:"Shared"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateSubnetReq struct {
|
||||||
|
Subnet Subnet `json:"subnet" copier:"Subnet"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateSubnetResp struct {
|
||||||
|
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"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Subnet struct {
|
||||||
|
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"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type SubnetResp struct {
|
||||||
|
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"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Allocation_pools struct {
|
||||||
|
Start string `json:"start" copier:"Start"`
|
||||||
|
End string `json:"end" copier:"End"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListVolumesDetailReq struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListVolumesDetailResp struct {
|
||||||
|
VolumeDetail []VolumeDetail `json:"volumes" copier:"VolumeDetail"`
|
||||||
|
Code int32 `json:"code,omitempty"`
|
||||||
|
Msg string `json:"msg,omitempty"`
|
||||||
|
ErrorMsg string `json:"errorMsg,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type VolumeDetail struct {
|
||||||
|
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 struct {
|
||||||
|
VolumeId string `form:"volume_id" copier:"VolumeId"`
|
||||||
|
Cascade bool `json:"cascade" copier:"cascade"`
|
||||||
|
Force bool `json:"force" copier:"force"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteVolumeResp struct {
|
||||||
|
Code int32 `json:"code,omitempty" copier:"Code"`
|
||||||
|
Msg string `json:"msg,omitempty" copier:"Msg"`
|
||||||
|
ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateVolumeReq struct {
|
||||||
|
Volume Volume `json:"volume" copier:"Volume"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateVolumeResp struct {
|
||||||
|
Volume VolumeResp `json:"volume" copier:"Volume"`
|
||||||
|
Code int32 `json:"code,omitempty" copier:"Code"`
|
||||||
|
Msg string `json:"msg,omitempty" copier:"Msg"`
|
||||||
|
ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Volume struct {
|
||||||
|
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"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type VolumeResp struct {
|
||||||
|
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 ListFlavorsDetailReq struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListFlavorsDetailResp struct {
|
||||||
|
Flavor []Flavors `json:"flavors" copier:"Flavor"`
|
||||||
|
Code int32 `json:"code,omitempty"`
|
||||||
|
Msg string `json:"msg,omitempty"`
|
||||||
|
ErrorMsg string `json:"errorMsg,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Flavors struct {
|
||||||
|
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"`
|
||||||
|
}
|
||||||
|
|
21
go.mod
21
go.mod
|
@ -14,11 +14,12 @@ require (
|
||||||
github.com/robfig/cron/v3 v3.0.1
|
github.com/robfig/cron/v3 v3.0.1
|
||||||
github.com/shopspring/decimal v1.3.1
|
github.com/shopspring/decimal v1.3.1
|
||||||
github.com/zeromicro/go-queue v1.1.8
|
github.com/zeromicro/go-queue v1.1.8
|
||||||
github.com/zeromicro/go-zero v1.5.4
|
github.com/zeromicro/go-zero v1.5.5
|
||||||
gitlink.org.cn/jcce-pcm/pcm-participant-ac v0.0.0-20230814074259-99e24e1194d1
|
gitlink.org.cn/jcce-pcm/pcm-participant-ac v0.0.0-20230814074259-99e24e1194d1
|
||||||
gitlink.org.cn/jcce-pcm/pcm-participant-ceph v0.0.0-20230817103341-2459e5bfc835
|
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-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-octopus v0.0.0-20230714030856-601935bc30e2
|
||||||
|
gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20230831020641-98c737b3e61e
|
||||||
gitlink.org.cn/jcce-pcm/pcm-participant-slurm v0.0.0-20230714030125-a52fa198ddf4
|
gitlink.org.cn/jcce-pcm/pcm-participant-slurm v0.0.0-20230714030125-a52fa198ddf4
|
||||||
gitlink.org.cn/jcce-pcm/utils v0.0.2
|
gitlink.org.cn/jcce-pcm/utils v0.0.2
|
||||||
gonum.org/v1/gonum v0.11.0
|
gonum.org/v1/gonum v0.11.0
|
||||||
|
@ -89,8 +90,8 @@ require (
|
||||||
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
|
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
|
||||||
github.com/pierrec/lz4/v4 v4.1.17 // indirect
|
github.com/pierrec/lz4/v4 v4.1.17 // indirect
|
||||||
github.com/prometheus/client_golang v1.16.0 // indirect
|
github.com/prometheus/client_golang v1.16.0 // indirect
|
||||||
github.com/prometheus/client_model v0.3.0 // indirect
|
github.com/prometheus/client_model v0.4.0 // indirect
|
||||||
github.com/prometheus/common v0.42.0 // indirect
|
github.com/prometheus/common v0.44.0 // indirect
|
||||||
github.com/prometheus/procfs v0.10.1 // indirect
|
github.com/prometheus/procfs v0.10.1 // indirect
|
||||||
github.com/segmentio/kafka-go v0.4.38 // indirect
|
github.com/segmentio/kafka-go v0.4.38 // indirect
|
||||||
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
||||||
|
@ -109,16 +110,16 @@ require (
|
||||||
go.opentelemetry.io/otel/trace v1.14.0 // indirect
|
go.opentelemetry.io/otel/trace v1.14.0 // indirect
|
||||||
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
|
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
|
||||||
go.uber.org/atomic v1.10.0 // indirect
|
go.uber.org/atomic v1.10.0 // indirect
|
||||||
go.uber.org/automaxprocs v1.5.2 // indirect
|
go.uber.org/automaxprocs v1.5.3 // indirect
|
||||||
go.uber.org/multierr v1.9.0 // indirect
|
go.uber.org/multierr v1.9.0 // indirect
|
||||||
go.uber.org/zap v1.24.0 // indirect
|
go.uber.org/zap v1.24.0 // indirect
|
||||||
golang.org/x/mod v0.9.0 // indirect
|
golang.org/x/mod v0.9.0 // indirect
|
||||||
golang.org/x/net v0.12.0 // indirect
|
golang.org/x/net v0.14.0 // indirect
|
||||||
golang.org/x/oauth2 v0.7.0 // indirect
|
golang.org/x/oauth2 v0.8.0 // indirect
|
||||||
golang.org/x/sync v0.2.0 // indirect
|
golang.org/x/sync v0.2.0 // indirect
|
||||||
golang.org/x/sys v0.10.0 // indirect
|
golang.org/x/sys v0.11.0 // indirect
|
||||||
golang.org/x/term v0.10.0 // indirect
|
golang.org/x/term v0.11.0 // indirect
|
||||||
golang.org/x/text v0.11.0 // indirect
|
golang.org/x/text v0.12.0 // indirect
|
||||||
golang.org/x/time v0.3.0 // indirect
|
golang.org/x/time v0.3.0 // indirect
|
||||||
golang.org/x/tools v0.7.0 // indirect
|
golang.org/x/tools v0.7.0 // indirect
|
||||||
google.golang.org/appengine v1.6.7 // indirect
|
google.golang.org/appengine v1.6.7 // indirect
|
||||||
|
@ -126,7 +127,7 @@ require (
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect
|
google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
|
||||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||||
gopkg.in/ini.v1 v1.66.2 // indirect
|
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
|
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
|
|
|
@ -7,7 +7,7 @@ NacosConfig:
|
||||||
- IpAddr: nacos.jcce.dev
|
- IpAddr: nacos.jcce.dev
|
||||||
Port: 8848
|
Port: 8848
|
||||||
ClientConfig:
|
ClientConfig:
|
||||||
NamespaceId: test
|
NamespaceId: zhouqj
|
||||||
TimeoutMs: 5000
|
TimeoutMs: 5000
|
||||||
NotLoadCacheAtStart: true
|
NotLoadCacheAtStart: true
|
||||||
LogDir:
|
LogDir:
|
||||||
|
|
Loading…
Reference in New Issue