PCM/adaptor/PCM-CORE/api/desc/vm/pcm-vm.api

491 lines
21 KiB
Plaintext

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"`
BlockDeviceMappingV2 []Block_device_mapping_v2 `json:"block_device_mapping_v2" copier:"BlockDeviceMappingV2"`
}
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"`
}
Block_device_mapping_v2 {
SourceType string `json:"source_type" copier:"SourceType"`
Uuid string `json:"uuid" copier:"Uuid"`
BootIndex string `json:"boot_index" copier:"BootIndex"`
DestinationType string `json:"destination_type" copier:"DestinationType"`
DeleteOnTermination bool `json:"delete_on_termination" copier:"DeleteOnTermination"`
}
)
/****************** 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"`
Min_disk int32 `json:"min_disk" copier:"Min_disk"`
Min_ram int32 `json:"min_ram" copier:"Min_ram"`
Name string `json:"name" copier:"Name"`
Protected bool `json:"protected" copier:"Protected"`
//Tags []Tags `json:"tags" copier:"Tags"`
Visibility string `json:"visibility" copier:"Visibility"`
}
CreateImageResp {
Location string `json:"location" copier:"Location"`
Created_at string `json:"created_at" copier:"Created_at"`
Container_format string `json:"Container_format" copier:"Container_format"`
Disk_format string `json:"disk_format" copier:"Disk_format"`
File string `json:"file" copier:"File"`
Id string `json:"id" copier:"Id"`
Min_disk int32 `json:"min_disk" copier:"Min_disk"`
Min_ram int32 `json:"min_ram" copier:"Min_ram"`
Status string `json:"status" copier:"Status"`
Visibility string `json:"visibility" copier:"Visibility"`
Code int32 `json:"code,omitempty" copier:"Code"`
Msg string `json:"msg,omitempty" copier:"Msg"`
ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"`
}
)
type(
UploadOsImageReq{
ImageId string `form:"image_id" copier:"ImageId"`
}
UploadOsImageResp {
Code int32 `json:"code,omitempty" copier:"Code"`
Msg string `json:"msg,omitempty" copier:"Msg"`
ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"`
}
)
type(
DeleteImageReq{
ImageId string `form:"image_id" copier:"ImageId"`
}
DeleteImageResp {
Code int32 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
ErrorMsg string `json:"errorMsg,omitempty"`
}
)
/******************find images end*************************/
/******************find Networks end*************************/
type(
ListNetworksReq{
}
ListNetworksResp{
Networks []Network `json:"networks" copier:"Networks"`
Code int32 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
ErrorMsg string `json:"errorMsg,omitempty"`
}
Network {
AdminStateUp bool `json:"admin_state_up" copier:"AdminStateUp"`
AvailabilityZoneHints []string `json:"availability_zone_hints" copier:"AvailabilityZoneHints"`
AvailabilityZones []string `json:"availability_zones" copier:"AvailabilityZones"`
CreatedAt string `json:"created_at" copier:"CreatedAt"`
DnsDomain string `json:"dns_domain" copier:"DnsDomain"`
Id string `json:"id" copier:"Id"`
Ipv4AddressScope string `json:"ipv4_address_scope" copier:"Ipv4AddressScope"`
Ipv6AddressScope string `json:"ipv6_address_scope" copier:"Ipv6AddressScope"`
L2Adjacency bool `json:"l2_adjacency" copier:"L2Adjacency"`
Mtu int64 `json:"mtu" copier:"Mtu"`
Name string `json:"name" copier:"Name"`
PortSecurityEnabled bool `json:"port_security_enabled" copier:"PortSecurityEnabled"`
ProjectId string `json:"project_id" copier:"ProjectId"`
QosPolicyId string `json:"qos_policy_id" copier:"QosPolicyId"`
RevisionNumber string `json:"revision_number" copier:"RevisionNumber"`
Shared bool `json:"shared" copier:"Shared"`
RouterExternal bool `json:"router_external" copier:"RouterExternal"`
Status string `json:"status" copier:"Status"`
Subnets []string `json:"subnets" copier:"Subnets"`
Tags []string `json:"tags" copier:"Tags"`
TenantId string `json:"tenant_id" copier:"TenantId"`
UpdatedAt string `json:"updated_at" copier:"UpdatedAt"`
VlanTransparent bool `json:"vlan_transparent" copier:"VlanTransparent"`
Description string `json:"description" copier:"Description"`
IsDefault bool `json:"is_default" copier:"IsDefault"`
}
)
type(
DeleteNetworkReq{
NetworkId string `form:"network_id" copier:"NetworkId"`
}
DeleteNetworkResp {
Code int32 `json:"code,omitempty" copier:"Code"`
Msg string `json:"msg,omitempty" copier:"Msg"`
ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"`
}
)
type(
CreateNetworkReq{
Network CreateNetwork `json:"network" copier:"Network"`
}
CreateNetworkResp{
Network Network `json:"network" copier:"Network"`
Code int32 `json:"code,omitempty" copier:"Code"`
Msg string `json:"msg,omitempty" copier:"Msg"`
ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"`
}
CreateNetwork {
AdminStateUp bool `json:"admin_state_up" copier:"AdminStateUp"`
Name string `json:"name" copier:"Name"`
Shared bool `json:"shared" copier:"Shared"`
}
)
type (
CreateSubnetReq{
Subnet Subnet `json:"subnet" copier:"Subnet"`
}
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"`
}
)
type(
ListVolumeTypesReq{
}
ListVolumeTypesResp{
VolumeTypes []Volume_types `json:"volume_types" copier:"VolumeTypes"`
Code int32 `json:"code,omitempty" copier:"Code"`
Msg string `json:"msg,omitempty" copier:"Msg"`
ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"`
}
Volume_types{
Description string `json:"description" copier:"Description"`
Id string `json:"id" copier:"Id"`
IsPublic bool `json:"is_public" copier:"IsPublic"`
Name string `json:"name" copier:"Name"`
OsVolumeTypeAccessIsPublic bool `json:"os_volume_type_access_is_public" copier:"OsVolumeTypeAccessIsPublic"`
QosSpecsId string `json:"qos_specs_id" copier:"QosSpecsId"`
ExtraSpecs Extra_specs `json:"extra_specs" copier:"ExtraSpecs"`
}
Extra_specs {
Capabilities string `json:"capabilities" copier:"Capabilities"`
}
)
/******************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"`
}
)