hoststorage.go 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 HoststorageDetails struct {
  20. HostJointResourceDetails
  21. SHoststorage
  22. // 存储名称
  23. Storage string `json:"storage"`
  24. // 存储大小
  25. Capacity int64 `json:"capacity"`
  26. // 存储配置信息
  27. StorageConf jsonutils.JSONObject `json:"storage_conf"`
  28. // 已使用存储大小
  29. UsedCapacity int64 `json:"used_capacity"`
  30. // 浪费存储大小(异常磁盘总大小)
  31. WasteCapacity int64 `json:"waste_capacity"`
  32. // 可用存储大小
  33. FreeCapacity int64 `json:"free_capacity"`
  34. // 存储类型
  35. // example: local
  36. StorageType string `json:"storage_type"`
  37. // 介质类型
  38. // example: ssd
  39. MediumType string `json:"medium_type"`
  40. // 是否启用
  41. Enabled bool `json:"enabled"`
  42. // 超售比
  43. Cmtbound float32 `json:"cmtbound"`
  44. // 镜像缓存路径
  45. ImagecachePath string `json:"imagecache_path"`
  46. // 存储缓存Id
  47. StoragecacheId string `json:"storagecache_id"`
  48. GuestDiskCount int `json:"guest_disk_count,allowempty"`
  49. }
  50. type HoststorageListInput struct {
  51. HostJointsListInput
  52. StorageFilterListInput
  53. }
  54. type HostStorageCreateInput struct {
  55. apis.JoinResourceBaseCreateInput
  56. StorageId string `json:"storage_id"`
  57. HostId string `json:"host_id"`
  58. MountPoint string `json:"mount_point"`
  59. }