cloudregion.go 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 "yunion.io/x/onecloud/pkg/apis"
  16. type SCloudregionUsage struct {
  17. // 虚拟私有网络数量
  18. // example: 2
  19. VpcCount int `json:"vpc_count,allowempty"`
  20. // 可用区数量
  21. // example: 3
  22. ZoneCount int `json:"zone_count,allowempty"`
  23. // 云主机梳理
  24. // example: 2
  25. GuestCount int `json:"guest_count,allowempty"`
  26. // IP子网数量
  27. // example: 12
  28. NetworkCount int `json:"network_count,allowempty"`
  29. // 距离前天0点新增云主机数量
  30. // example: 0
  31. GuestIncrementCount int `json:"guest_increment_count,allowempty"`
  32. }
  33. type CloudregionDetails struct {
  34. apis.EnabledStatusStandaloneResourceDetails
  35. SCloudregionUsage
  36. SCloudregion
  37. // 云类型, public, private or onpremise
  38. // example: public
  39. CloudEnv string `json:"cloud_env"`
  40. }
  41. type CloudregionResourceInfo struct {
  42. // 区域的名称
  43. // example: Default
  44. Region string `json:"region"`
  45. // 区域的名称
  46. Cloudregion string `json:"cloudregion"`
  47. // 区域的Id
  48. // example: default
  49. RegionId string `json:"region_id"`
  50. // 纳管云区域的组合Id(平台+Id)
  51. // example: ZStack/59e7bc87-a6b3-4c39-8f02-c68e8243d4e4
  52. RegionExternalId string `json:"region_external_id"`
  53. // 纳管云区域的Id
  54. // example: 59e7bc87-a6b3-4c39-8f02-c68e8243d4e4
  55. RegionExtId string `json:"region_ext_id"`
  56. }
  57. type CloudregionPurgeInput struct {
  58. // 云订阅Id, 若region底下不存在任何资源,会删除当前region
  59. // required: true
  60. ManagerId string `json:"manager_id"`
  61. }