snapshot.go 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. "yunion.io/x/onecloud/pkg/apis"
  17. )
  18. type SnapshotCreateInput struct {
  19. apis.VirtualResourceCreateInput
  20. apis.EncryptedResourceCreateInput
  21. // 磁盘Id
  22. // 目前仅VMware平台不支持创建快照,其余平台磁盘均支持创建快照
  23. // required: true
  24. DiskId string `json:"disk_id"`
  25. // swagger:ignore
  26. Disk string `json:"disk" yunion-deprecated-by:"disk_id"`
  27. // swagger:ignore
  28. StorageId string `json:"storage_id"`
  29. // swagger:ignore
  30. CreatedBy string `json:"created_by"`
  31. // swagger:ignore
  32. Location string `json:"location"`
  33. // swagger:ignore
  34. Size int `json:"size"`
  35. // swagger:ignore
  36. VirtualSize int `json:"virtual_size"`
  37. // swagger:ignore
  38. DiskType string `json:"disk_type"`
  39. // swagger:ignore
  40. CloudregionId string `json:"cloudregion_id"`
  41. // swagger:ignore
  42. OutOfChain bool `json:"out_of_chain"`
  43. // swagger:ignore
  44. ManagerId string `json:"manager_id"`
  45. // swagger:ignore
  46. OsArch string `json:"os_arch"`
  47. }
  48. type SnapshotListInput struct {
  49. apis.VirtualResourceListInput
  50. apis.ExternalizedResourceBaseListInput
  51. apis.MultiArchResourceBaseListInput
  52. ManagedResourceListInput
  53. RegionalFilterListInput
  54. StorageShareFilterListInput
  55. // filter snapshot that is fake deleted
  56. FakeDeleted *bool `json:"fake_deleted"`
  57. // filter by disk type
  58. DiskType string `json:"disk_type"`
  59. // filter instance snapshot
  60. IsInstanceSnapshot *bool `json:"is_instance_snapshot"`
  61. DiskFilterListInputBase
  62. StorageFilterListInputBase
  63. OutOfChain *bool `json:"out_of_chain"`
  64. OsType []string `json:"os_type"`
  65. // list server snapshots
  66. ServerId string `json:"server_id"`
  67. // 未关联任何磁盘
  68. Unused bool `json:"unused"`
  69. // 按存储过滤
  70. StorageId string `json:"storage_id"`
  71. // 按虚拟机名称排序
  72. // pattern:asc|desc
  73. OrderByGuest string `json:"order_by_guest"`
  74. // 按磁盘名称排序
  75. // pattern:asc|desc
  76. OrderByDiskName string `json:"order_by_disk_name"`
  77. }
  78. type SnapshotDetails struct {
  79. apis.VirtualResourceDetails
  80. ManagedResourceInfo
  81. CloudregionResourceInfo
  82. apis.EncryptedResourceDetails
  83. SSnapshot
  84. // 存储类型
  85. StorageType string `json:"storage_type"`
  86. // 存储名称
  87. Storage string `json:"storage"`
  88. // 磁盘状态
  89. DiskStatus string `json:"disk_status"`
  90. // 云主机名称
  91. Guest string `json:"guest"`
  92. // 云主机Id
  93. GuestId string `json:"guest_id"`
  94. // 云主机状态
  95. GuestStatus string `json:"guest_status"`
  96. // 磁盘名称
  97. DiskName string `json:"disk_name"`
  98. // 是否是子快照
  99. IsSubSnapshot bool `json:"is_sub_snapshot,allowempty"`
  100. }
  101. type SnapshotSyncstatusInput struct {
  102. }
  103. type SnapshotDeleteDiskSnapshotsInput struct {
  104. // 磁盘ID
  105. DiskId string `json:"disk_id"`
  106. }