guest_disk.go 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package compute
  15. type GuestDiskDetails struct {
  16. GuestJointResourceDetails
  17. SGuestdisk
  18. // 磁盘名称
  19. Disk string `json:"disk"`
  20. // 存储类型
  21. // example: local
  22. StorageType string `json:"storage_type"`
  23. // 磁盘大小, 单位Mb
  24. // example: 10240
  25. DiskSize int `json:"disk_size"`
  26. // 磁盘状态
  27. // example: ready
  28. Status string `json:"status"`
  29. // 磁盘类型
  30. // example: data
  31. DiskType string `json:"disk_type"`
  32. // 关机自动重置
  33. AutoReset bool `json:"auto_reset"`
  34. // 介质类型
  35. // example: ssd
  36. MediumType string `json:"medium_type"`
  37. }
  38. type GuestdiskListInput struct {
  39. GuestJointsListInput
  40. DiskFilterListInput
  41. Driver []string `json:"driver"`
  42. CacheMode []string `json:"cache_mode"`
  43. AioMode []string `json:"aio_mode"`
  44. }
  45. type GuestdiskUpdateInput struct {
  46. GuestJointBaseUpdateInput
  47. Driver string `json:"driver"`
  48. CacheMode string `json:"cache_mode"`
  49. AioMode string `json:"aio_mode"`
  50. Iops *int `json:"iops"`
  51. Bps *int `json:"bps"`
  52. Index *int8 `json:"index"`
  53. }
  54. type GuestdiskJsonDesc struct {
  55. DiskId string `json:"disk_id"`
  56. Driver string `json:"driver"`
  57. CacheMode string `json:"cache_mode"`
  58. AioMode string `json:"aio_mode"`
  59. Iops int `json:"iops"`
  60. Throughput int `json:"throughput"`
  61. Bps int `json:"bps"`
  62. Size int `json:"size"`
  63. TemplateId string `json:"template_id"`
  64. ImagePath string `json:"image_path"`
  65. StorageId string `json:"storage_id"`
  66. StorageType string `json:"storage_type"`
  67. Migrating bool `json:"migrating"`
  68. Path string `json:"path"`
  69. Format string `json:"format"`
  70. Index int8 `json:"index"`
  71. BootIndex *int8 `json:"boot_index"`
  72. MergeSnapshot bool `json:"merge_snapshot"`
  73. Fs string `json:"fs"`
  74. Mountpoint string `json:"mountpoint"`
  75. Dev string `json:"dev"`
  76. IsSSD bool `json:"is_ssd"`
  77. NumQueues uint8 `json:"num_queues"`
  78. AutoReset bool `json:"auto_reset"`
  79. PCIPath string `json:"pci_path"`
  80. // esxi
  81. ImageInfo struct {
  82. ImageType string `json:"image_type"`
  83. ImageExternalId string `json:"image_external_id"`
  84. StorageCacheHostIp string `json:"storage_cache_host_ip"`
  85. } `json:"image_info"`
  86. Preallocation string `json:"preallocation"`
  87. TargetStorageId string `json:"target_storage_id"`
  88. EsxiFlatFilePath string `json:"esxi_flat_file_path"`
  89. Url string `json:"url"`
  90. }