elasticips_const.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. EIP_MODE_INSTANCE_PUBLICIP = compute.EIP_MODE_INSTANCE_PUBLICIP
  21. EIP_MODE_STANDALONE_EIP = compute.EIP_MODE_STANDALONE_EIP
  22. EIP_ASSOCIATE_TYPE_SERVER = compute.EIP_ASSOCIATE_TYPE_SERVER
  23. EIP_ASSOCIATE_TYPE_NAT_GATEWAY = compute.EIP_ASSOCIATE_TYPE_NAT_GATEWAY
  24. EIP_ASSOCIATE_TYPE_LOADBALANCER = compute.EIP_ASSOCIATE_TYPE_LOADBALANCER
  25. EIP_ASSOCIATE_TYPE_UNKNOWN = compute.EIP_ASSOCIATE_TYPE_UNKNOWN
  26. EIP_ASSOCIATE_TYPE_INSTANCE_GROUP = compute.EIP_ASSOCIATE_TYPE_INSTANCE_GROUP
  27. EIP_STATUS_READY = compute.EIP_STATUS_READY
  28. EIP_STATUS_UNKNOWN = compute.EIP_STATUS_UNKNOWN
  29. EIP_STATUS_ALLOCATE = compute.EIP_STATUS_ALLOCATE
  30. EIP_STATUS_ALLOCATE_FAIL = compute.EIP_STATUS_ALLOCATE_FAIL
  31. EIP_STATUS_DEALLOCATE = compute.EIP_STATUS_DEALLOCATE
  32. EIP_STATUS_DEALLOCATE_FAIL = "deallocate_fail"
  33. EIP_STATUS_ASSOCIATE = compute.EIP_STATUS_ASSOCIATE
  34. EIP_STATUS_ASSOCIATE_FAIL = "associate_fail"
  35. EIP_STATUS_DISSOCIATE = compute.EIP_STATUS_DISSOCIATE
  36. EIP_STATUS_DISSOCIATE_FAIL = "dissociate_fail"
  37. EIP_STATUS_CHANGE_BANDWIDTH = "change_bandwidth"
  38. INSTANCE_ASSOCIATE_EIP = "associate_eip"
  39. INSTANCE_ASSOCIATE_EIP_FAILED = "associate_eip_failed"
  40. INSTANCE_DISSOCIATE_EIP = "dissociate_eip"
  41. INSTANCE_DISSOCIATE_EIP_FAILED = "dissociate_eip_failed"
  42. )
  43. var (
  44. EIP_ASSOCIATE_VALID_TYPES = []string{
  45. EIP_ASSOCIATE_TYPE_SERVER,
  46. EIP_ASSOCIATE_TYPE_NAT_GATEWAY,
  47. EIP_ASSOCIATE_TYPE_INSTANCE_GROUP,
  48. EIP_ASSOCIATE_TYPE_LOADBALANCER,
  49. }
  50. )
  51. type ElasticipListInput struct {
  52. apis.VirtualResourceListInput
  53. apis.ExternalizedResourceBaseListInput
  54. ManagedResourceListInput
  55. RegionalFilterListInput
  56. UsableResourceListInput
  57. // filter usable eip for given associate type
  58. // enmu: server, natgateway
  59. UsableEipForAssociateType string `json:"usable_eip_for_associate_type"`
  60. // filter usable eip for given associate id
  61. UsableEipForAssociateId string `json:"usable_eip_for_associate_id"`
  62. NetworkFilterListBase
  63. // 标识弹性或非弹性
  64. // | Mode | 说明 |
  65. // |------------|------------|
  66. // | public_ip | 公网IP |
  67. // | elastic_ip | 弹性公公网网IP |
  68. //
  69. // example: elastic_ip
  70. Mode string `json:"mode"`
  71. // 是否已关联资源
  72. IsAssociated *bool `json:"is_associated"`
  73. // IP地址
  74. IpAddr []string `json:"ip_addr"`
  75. // 绑定资源类型
  76. AssociateType []string `json:"associate_type"`
  77. // 绑定资源名称,模糊查询
  78. AssociateName []string `json:"associate_name"`
  79. // 绑定资源Id
  80. AssociateId []string `json:"associate_id"`
  81. // 计费类型: 流量、带宽
  82. // example: bandwidth
  83. ChargeType []string `json:"charge_type"`
  84. // 目前只有华为云此字段是必需填写的
  85. BgpType []string `json:"bgp_type"`
  86. // 是否跟随主机删除而自动释放
  87. AutoDellocate *bool `json:"auto_dellocate"`
  88. // 按ip地址排序
  89. // pattern:asc|desc
  90. OrderByIp string `json:"order_by_ip"`
  91. }