filesystem.go 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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/cloudmux/pkg/apis/compute"
  18. "yunion.io/x/onecloud/pkg/apis"
  19. billing_api "yunion.io/x/onecloud/pkg/apis/billing"
  20. )
  21. const (
  22. // 可用
  23. NAS_STATUS_AVAILABLE = compute.NAS_STATUS_AVAILABLE
  24. // 不可用
  25. NAS_STATUS_UNAVAILABLE = compute.NAS_STATUS_UNAVAILABLE
  26. // 扩容中
  27. NAS_STATUS_EXTENDING = compute.NAS_STATUS_EXTENDING
  28. // 创建中
  29. NAS_STATUS_CREATING = compute.NAS_STATUS_CREATING
  30. // 创建失败
  31. NAS_STATUS_CREATE_FAILED = compute.NAS_STATUS_CREATE_FAILED
  32. // 未知
  33. NAS_STATUS_UNKNOWN = compute.NAS_STATUS_UNKNOWN
  34. // 删除中
  35. NAS_STATUS_DELETING = compute.NAS_STATUS_DELETING
  36. NAS_STATUS_DELETE_FAILED = "delete_failed"
  37. NAS_UPDATE_TAGS = "update_tags"
  38. NAS_UPDATE_TAGS_FAILED = "update_tags_fail"
  39. )
  40. type FileSystemListInput struct {
  41. apis.SharableVirtualResourceListInput
  42. apis.ExternalizedResourceBaseListInput
  43. ManagedResourceListInput
  44. RegionalFilterListInput
  45. }
  46. type FileSystemCreateInput struct {
  47. apis.SharableVirtualResourceCreateInput
  48. // 协议类型
  49. // enum: ["NFS", "SMB", "CPFS"]
  50. Protocol string `json:"protocol"`
  51. // 文件系统类型
  52. // enmu: extreme, standard, cpfs
  53. FileSystemType string `json:"file_system_type"`
  54. // 容量大小
  55. Capacity int64 `json:"capacity"`
  56. // IP子网Id
  57. NetworkId string `json:"network_id"`
  58. // 存储类型
  59. // enmu: performance, capacity, standard, advance, advance_100, advance_200
  60. StorageType string `json:"storage_type"`
  61. // 可用区Id, 若不指定IP子网,此参数必填
  62. ZoneId string `json:"zone_id"`
  63. //swagger:ignore
  64. CloudregionId string `json:"cloudregion_id"`
  65. // 订阅Id, 若传入network_id此参数可忽略
  66. ManagerId string `json:"manager_id"`
  67. // 包年包月时间周期
  68. Duration string `json:"duration"`
  69. // 是否自动续费(仅包年包月时生效)
  70. // default: false
  71. AutoRenew bool `json:"auto_renew"`
  72. // 到期释放时间
  73. ReleaseAt time.Time `json:"release_at"`
  74. // 计费方式
  75. // enum: ["postpaid", "prepaid"]
  76. BillingType billing_api.TBillingType `json:"billing_type"`
  77. // swagger:ignore
  78. BillingCycle string `json:"billing_cycle"`
  79. }
  80. type FileSystemSyncstatusInput struct {
  81. }
  82. type FileSystemDetails struct {
  83. apis.SharableVirtualResourceDetails
  84. ManagedResourceInfo
  85. CloudregionResourceInfo
  86. Vpc string `json:"vpc"`
  87. Network string `json:"network"`
  88. Zone string `json:"zone"`
  89. }
  90. type FileSystemRemoteUpdateInput struct {
  91. // 是否覆盖替换所有标签
  92. ReplaceTags *bool `json:"replace_tags" help:"replace all remote tags"`
  93. }
  94. type FileSystemSetQuotaInput struct {
  95. MaxGb *int64
  96. MaxFiles *int64
  97. }