instance_snapshot.go 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. import (
  16. "time"
  17. "yunion.io/x/onecloud/pkg/apis"
  18. )
  19. type SimpleSnapshot struct {
  20. // 快照Id
  21. Id string `json:"id"`
  22. // 快照名称
  23. Name string `json:"name"`
  24. // 存储Id
  25. StorageId string `json:"storage_id"`
  26. // 磁盘类型
  27. DiskType string `json:"disk_type"`
  28. // 区域Id
  29. CloudregionId string `json:"cloudregion_id"`
  30. // 快照大小, MiB
  31. Size int `json:"size"`
  32. // 磁盘大小, MiB
  33. VirtualSize int `json:"virtual_size"`
  34. // 快照状态
  35. Status string `json:"status"`
  36. // 存储类型
  37. StorageType string `json:"storage_type"`
  38. // 密钥
  39. EncryptKeyId string `json:"encrypt_key_id"`
  40. // 创建时间
  41. CreatedAt time.Time `json:"created_at"`
  42. }
  43. type InstanceSnapshotDetails struct {
  44. apis.VirtualResourceDetails
  45. ManagedResourceInfo
  46. SInstanceSnapshot
  47. apis.EncryptedResourceDetails
  48. // 云主机状态
  49. GuestStatus string `json:"guest_status"`
  50. // 云主机名称
  51. Guest string `json:"guest"`
  52. // 存储类型
  53. StorageType string `json:"storage_type"`
  54. // 快照列表
  55. Snapshots []SimpleSnapshot `json:"snapshots"`
  56. Properties map[string]string `json:"properties"`
  57. // 主机快照大小, B
  58. Size int `json:"size"`
  59. // 主机快照大小, MiB
  60. SizeMb int `json:"size_mb"`
  61. // 主机磁盘大小, MiB
  62. VirtualSizeMb int `json:"virtual_size_mb"`
  63. }
  64. type InstanceSnapshotListInput struct {
  65. apis.VirtualResourceListInput
  66. apis.ExternalizedResourceBaseListInput
  67. apis.MultiArchResourceBaseListInput
  68. ManagedResourceListInput
  69. ServerFilterListInput
  70. // 操作系统类型
  71. OsType []string `json:"os_type"`
  72. // 包含内存快照
  73. WithMemory *bool `json:"with_memory"`
  74. // 按磁盘快照数量排序
  75. // pattern:asc|desc
  76. OrderByDiskSnapshotCount string `json:"order_by_disk_snapshot_count"`
  77. // 按虚拟机名称排序
  78. // pattern:asc|desc
  79. OrderByGuest string `json:"order_by_guest"`
  80. }