nat.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 SNatSCreateInput struct {
  17. apis.Meta
  18. Name string `json:"name"`
  19. NatgatewayId string `json:"natgateway_id"`
  20. NetworkId string `json:"network_id"`
  21. // swagger:ignore
  22. Ip string `json:"ip"`
  23. // swagger:ignore
  24. ExternalIpId string `json:"external_ip_id" yunion-deprecated-by:"eip"`
  25. Eip string `json:"eip"`
  26. SourceCidr string `json:"source_cidr"`
  27. }
  28. type SNatDCreateInput struct {
  29. apis.Meta
  30. Name string `json:"name"`
  31. NatgatewayId string `json:"natgateway_id"`
  32. InternalIp string `json:"internal_ip"`
  33. InternalPort int `json:"internal_port"`
  34. ExternalIp string `json:"external_ip"`
  35. Eip string `json:"eip"`
  36. // swagger:ignore
  37. ExternalIpId string `json:"external_ip_id" yunion-deprecated-by:"eip"`
  38. ExternalPort int `json:"external_port"`
  39. IpProtocol string `json:"ip_protocol"`
  40. }
  41. type NatDEntryDetails struct {
  42. NatEntryDetails
  43. // SNatDEntry
  44. }
  45. type NatSEntryDetails struct {
  46. NatEntryDetails
  47. // SNatSEntry
  48. // SNAT归属网络
  49. Network SimpleNetwork `json:"network"`
  50. }
  51. type SimpleNetwork struct {
  52. Id string `json:"id"`
  53. Name string `json:"name"`
  54. GuestIpStart string `json:"guest_ip_start"`
  55. GuestIpEnd string `json:"guest_ip_end"`
  56. GuestIp6Start string `json:"guest_ip6_start"`
  57. GuestIp6End string `json:"guest_ip6_end"`
  58. }
  59. type NatgatewayDetails struct {
  60. apis.StatusInfrasResourceBaseDetails
  61. VpcResourceInfo
  62. SNatGateway
  63. Network string `json:"network"`
  64. }