storagecache.go 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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/jsonutils"
  17. "yunion.io/x/onecloud/pkg/apis"
  18. )
  19. type StoragecacheDetails struct {
  20. apis.StandaloneResourceDetails
  21. ManagedResourceInfo
  22. SStoragecache
  23. // 存储列表
  24. Storages []string `json:"storages"`
  25. // 缓存镜像总大小
  26. Size int64 `json:"size"`
  27. // 缓存镜像个数
  28. Count int `json:"count"`
  29. // 通过一致性哈希获取的一个管理宿主机信息
  30. Host *jsonutils.JSONDict `json:"host"`
  31. }
  32. type StoragecacheListInput struct {
  33. apis.StandaloneResourceListInput
  34. apis.ExternalizedResourceBaseListInput
  35. ManagedResourceListInput
  36. // 路径过滤
  37. Path []string `json:"path"`
  38. }
  39. type UncacheImageInput struct {
  40. // 镜像ID
  41. ImageId string `json:"image_id"`
  42. // swagger:ignore
  43. StoragecacheId string `json:"storagecache_id"`
  44. DeactivateImage *bool `json:"deactivate_image"`
  45. }
  46. type CacheImageInput struct {
  47. // swagger:ignore
  48. Image string `json:"image" yunion-deprecated-by:"image_id"`
  49. ImageId string `json:"image_id"`
  50. IsForce bool `json:"is_force"`
  51. Format string `json:"format"`
  52. // swagger:ignore
  53. Zone string `json:"zone"`
  54. // swagger:ignore
  55. OsType string `json:"os_type"`
  56. // swagger:ignore
  57. OsArch string `json:"os_arch"`
  58. // swagger:ignore
  59. OsDistribution string `json:"os_distribution"`
  60. // swagger:ignore
  61. OsFullVersion string `json:"os_full_version"`
  62. // swagger:ignore
  63. OsVersion string `json:"os_version"`
  64. // swagger:ignore
  65. ImageName string `json:"image_name"`
  66. // swagger:ignore
  67. ServerId string `json:"server_id"`
  68. // swagger:ignore
  69. ParentTaskId string `json:"parent_task_id"`
  70. // swagger:ignore
  71. SourceHostId string `json:"source_host_id"`
  72. // swagger:ignore
  73. SrcUrl string `json:"src_url"`
  74. // swagger:ignore
  75. StoragecacheId string `json:"storagecache_id"`
  76. // swagger:ignore
  77. Checksum string `json:"checksum"`
  78. // swagger:ignore
  79. SkipChecksumIfExists bool `json:"skip_checksum_if_exists"`
  80. // swagger:ignore
  81. PreCache bool `json:"pre_cache"`
  82. }
  83. type StoragecacheResourceInput struct {
  84. // 存储缓存(ID或Name)
  85. StoragecacheId string `json:"storagecache_id"`
  86. // swagger:ignore
  87. // Deprecated
  88. // filter by storagecache_id
  89. Storagecache string `json:"storagecache" yunion-deprecated-by:"storagecache_id"`
  90. }
  91. type StoragecacheResourceInfo struct {
  92. // 归属云订阅ID
  93. ManagerId string `json:"manager_id"`
  94. ManagedResourceInfo
  95. // 存储缓存名称
  96. Storagecache string `json:"storagecache"`
  97. // 关联存储名称
  98. Storages []string `json:"storages"`
  99. // 关联存储信息
  100. StorageInfo []StorageInfo `json:"storage_info"`
  101. // 关联宿主机名称
  102. Hosts []string `json:"hosts"`
  103. // 关联宿主机信息
  104. HostInfo []HostInfo `json:"host_info"`
  105. }
  106. type StorageInfo struct {
  107. Id string `json:"id"`
  108. Name string `json:"name"`
  109. StorageType string `json:"storage_type"`
  110. MediumType string `json:"medium_type"`
  111. ZoneId string `json:"zone_id"`
  112. Zone string `json:"zone"`
  113. }
  114. type StoragecacheFilterListInputBase struct {
  115. StoragecacheResourceInput
  116. // 以存储缓存名称排序
  117. // pattern:asc|desc
  118. OrderByStoragecache string `json:"order_by_storagecache"`
  119. }
  120. type StoragecacheFilterListInput struct {
  121. StoragecacheFilterListInputBase
  122. ManagedResourceListInput
  123. }