vpcs_const.go 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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/cloudmux/pkg/apis/compute"
  17. "yunion.io/x/onecloud/pkg/apis"
  18. )
  19. const (
  20. VPC_STATUS_PENDING = compute.VPC_STATUS_PENDING
  21. VPC_STATUS_AVAILABLE = compute.VPC_STATUS_AVAILABLE
  22. VPC_STATUS_UNAVAILABLE = compute.VPC_STATUS_UNAVAILABLE
  23. VPC_STATUS_FAILED = compute.VPC_STATUS_FAILED
  24. VPC_STATUS_START_DELETE = "start_delete"
  25. VPC_STATUS_DELETING = compute.VPC_STATUS_DELETING
  26. VPC_STATUS_DELETE_FAILED = "delete_failed"
  27. VPC_STATUS_DELETED = "deleted"
  28. VPC_STATUS_UNKNOWN = compute.VPC_STATUS_UNKNOWN
  29. MAX_VPC_PER_REGION = 3
  30. DEFAULT_VPC_ID = compute.DEFAULT_VPC_ID
  31. NORMAL_VPC_ID = compute.NORMAL_VPC_ID // 没有关联VPC的安全组,统一使用normal
  32. CLASSIC_VPC_NAME = "-"
  33. )
  34. type UsableResourceListInput struct {
  35. // filter by network usability of the resource
  36. Usable *bool `json:"usable"`
  37. }
  38. type UsableVpcResourceListInput struct {
  39. // filter by Vpc usability of the resource
  40. UsableVpc *bool `json:"usable_vpc"`
  41. }
  42. type VpcListInput struct {
  43. apis.EnabledStatusInfrasResourceBaseListInput
  44. apis.ExternalizedResourceBaseListInput
  45. ManagedResourceListInput
  46. RegionalFilterListInput
  47. GlobalVpcResourceListInput
  48. DnsZoneFilterListBase
  49. InterVpcNetworkFilterListBase
  50. // 过滤可以加入指定vpc互联的vpc
  51. UsableForInterVpcNetworkId string `json:"usable_for_inter_vpc_network_id"`
  52. UsableResourceListInput
  53. UsableVpcResourceListInput
  54. // 过滤vpc底下有指定zone的ip子网
  55. ZoneId string `json:"zone_id"`
  56. // filter by globalvpc
  57. Globalvpc string `json:"globalvpc"`
  58. // 是否是默认VPC
  59. // example: true
  60. IsDefault *bool `json:"is_default"`
  61. // CIDR地址段
  62. // example: 192.168.222.0/24
  63. CidrBlock []string `json:"cidr_block"`
  64. // IPv6地址段
  65. CidrBlock6 []string `json:"cidr_block6"`
  66. // enmu: eip, none
  67. ExternalAccessMode string `json:"external_access_mode"`
  68. // 按子网数量排序
  69. // pattern:asc|desc
  70. OrderByNetworkCount string `json:"order_by_network_count"`
  71. // 按二层网络数量排序
  72. // pattern:asc|desc
  73. OrderByWireCount string `json:""order_by_wire_count`
  74. }
  75. const (
  76. VPC_PROVIDER_OVN = "ovn"
  77. )