image.go 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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 image
  15. import (
  16. "time"
  17. "yunion.io/x/onecloud/pkg/apis"
  18. )
  19. type ImageListInput struct {
  20. apis.SharableVirtualResourceListInput
  21. apis.MultiArchResourceBaseListInput
  22. // 以镜像的格式过滤,可能值为:qcow2, iso, vmdk, vhd, raw等
  23. DiskFormats []string `json:"disk_formats"`
  24. // 列出是否支持UEFI启动的镜像
  25. Uefi *bool `json:"uefi"`
  26. // 根据已转换格式过滤, 可能值为: qcow2, vmdk, vhd, raw等
  27. SubFormats []string `json:"subFormats"`
  28. // 是否为标准镜像
  29. IsStandard *bool `json:"is_standard"`
  30. // 是否删除保护
  31. Protected *bool `json:"protected"`
  32. // 是否为主机镜像的子镜像
  33. IsGuestImage *bool `json:"is_guest_image"`
  34. // 是否为数据盘
  35. IsData *bool `json:"is_data"`
  36. // 操作系统类型,可能值为: Linux, Windows, FreeBSD 等
  37. OsTypes []string `json:"os_types"`
  38. // 操作系统精确匹配
  39. OsTypePreciseMatch bool `json:"os_type_precise_match"`
  40. // 操作系统架构, 可能值为: arm, x86 等
  41. OsArchs []string `json:"os_archs"`
  42. // 操作系统架构精确匹配
  43. OsArchPreciseMatch bool `json:"os_arch_precise_match"`
  44. // 发行版本,可能值为: CentOS, Ubuntu, Debian, ArchLinux, OpenEuler 等
  45. Distributions []string `json:"distributions"`
  46. // 发行版精确匹配
  47. DistributionPreciseMatch bool `json:"distribution_precise_match`
  48. }
  49. type GuestImageListInput struct {
  50. apis.SharableVirtualResourceListInput
  51. apis.MultiArchResourceBaseListInput
  52. // 是否删除保护
  53. Protected *bool `json:"protected"`
  54. DiskFormat []string `json:"disk_format"`
  55. }
  56. type ImageDetails struct {
  57. apis.SharableVirtualResourceDetails
  58. apis.EncryptedResourceDetails
  59. SImage
  60. // 镜像属性信息
  61. Properties map[string]string `json:"properties"`
  62. // 自动清除时间
  63. AutoDeleteAt time.Time `json:"auto_delete_at"`
  64. // 删除保护
  65. DisableDelete bool `json:"disable_delete"`
  66. //OssChecksum string `json:"oss_checksum"`
  67. }
  68. type ImageCreateInput struct {
  69. apis.SharableVirtualResourceCreateInput
  70. // 镜像大小, 单位Byte
  71. Size *int64 `json:"size"`
  72. // 镜像格式
  73. DiskFormat string `json:"disk_format"`
  74. // 最小系统盘要求
  75. MinDiskMB *int32 `json:"min_disk"`
  76. // 最小内存要求
  77. MinRamMB *int32 `json:"min_ram"`
  78. // 是否有删除保护
  79. Protected *bool `json:"protected"`
  80. // 是否是标准镜像
  81. IsStandard *bool `json:"is_standard"`
  82. // 是否是主机镜像
  83. IsGuestImage *bool `json:"is_guest_image"`
  84. // 是否是数据盘镜像
  85. IsData *bool `json:"is_data"`
  86. apis.EncryptedResourceCreateInput
  87. // 镜像属性
  88. Properties map[string]string `json:"properties"`
  89. }
  90. type ImageUpdateInput struct {
  91. apis.SharableVirtualResourceBaseUpdateInput
  92. // 最小系统盘要求
  93. MinDiskMB *int32 `json:"min_disk"`
  94. // 最小内存要求
  95. MinRamMB *int32 `json:"min_ram"`
  96. // 是否有删除保护
  97. Protected *bool `json:"protected"`
  98. // 是否是标准镜像
  99. IsStandard *bool `json:"is_standard"`
  100. // 是否是数据盘镜像
  101. IsData *bool `json:"is_data"`
  102. // 镜像属性
  103. Properties map[string]string `json:"properties"`
  104. }
  105. type ImageUpdateStatusInput struct {
  106. apis.Meta
  107. // 镜像状态
  108. Status string `json:"status"`
  109. // 更新镜像状态原因
  110. Reason string `json:"reason"`
  111. }
  112. type PerformProbeInput struct {
  113. }