cachedimage.go 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. "yunion.io/x/onecloud/pkg/util/tagutils"
  18. )
  19. type CachedImageUncacheImageInput struct {
  20. // 存储缓存名Id
  21. // required: true
  22. StoragecacheId string `json:"storagecache_id"`
  23. // 是否强制清除缓存
  24. // default: false
  25. IsForce bool `json:"is_force"`
  26. }
  27. type SStorageCacheFilters struct {
  28. StorageType []string `json:"storage_type"`
  29. HostType []string `json:"host_type"`
  30. HostTags tagutils.STagFilters `json:"host_tags"`
  31. StorageTags tagutils.STagFilters `json:"storage_tags"`
  32. }
  33. type CachedImageManagerCacheImageInput struct {
  34. ImageId string `json:"image_id"`
  35. AutoCache bool `json:"auto_cache"`
  36. SStorageCacheFilters
  37. }
  38. type CachedimageUsage struct {
  39. // 此镜像被使用次数
  40. // example: 0
  41. CachedCount int `json:"cached_count"`
  42. }
  43. type CachedimageDetails struct {
  44. apis.SharableVirtualResourceDetails
  45. SCachedimage
  46. // 镜像状态, 和info里面的status一致
  47. // example: active
  48. Status string `json:"status"`
  49. // 操作系统类型
  50. // example: FreeBSD
  51. OsType string `json:"os_type"`
  52. // 操作系统发行版
  53. // example: FreeBSD
  54. OsDistribution string `json:"os_distribution"`
  55. // 操作系统版本
  56. // example: 11
  57. OsVersion string `json:"os_version"`
  58. // 虚拟化类型
  59. Hypervisor string `json:"hypervisor"`
  60. // 此镜像被使用次数
  61. // example: 0
  62. CachedimageUsage
  63. }
  64. type CachedImageSetClassMetadataInput struct {
  65. ClassMetadata map[string]string `json:"class_metadata"`
  66. }
  67. type CachedimageListInput struct {
  68. apis.SharableVirtualResourceListInput
  69. apis.ExternalizedResourceBaseListInput
  70. CloudproviderResourceListInput
  71. CloudregionResourceListInput
  72. ZoneResourceInput
  73. // 镜像类型,可能值为: system(公有云公共镜像), customized(自定义镜像)
  74. // example: system
  75. ImageType []string `json:"image_type"`
  76. // filter by host schedtag
  77. HostSchedtagId string `json:"host_schedtag_id"`
  78. // valid cachedimage
  79. Valid bool `json:"valid"`
  80. // enum: ["public", "private"]
  81. CloudEnv string `json:"cloud_env"`
  82. }