natstable.go 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 qcloud
  15. import (
  16. "strings"
  17. api "yunion.io/x/cloudmux/pkg/apis/compute"
  18. "yunion.io/x/cloudmux/pkg/cloudprovider"
  19. "yunion.io/x/cloudmux/pkg/multicloud"
  20. )
  21. type SSTable struct {
  22. multicloud.SResourceBase
  23. QcloudTags
  24. nat *SNatGateway
  25. CreatedTime string
  26. Description string
  27. NatGatewayId string
  28. NatGatewaySnatId string
  29. PrivateIpAddress string
  30. PublicIpAddresses []string
  31. ResourceId string
  32. ResourceType string
  33. VpcId string
  34. }
  35. func (stable *SSTable) GetName() string {
  36. return stable.NatGatewaySnatId
  37. }
  38. func (stable *SSTable) GetId() string {
  39. return stable.NatGatewaySnatId
  40. }
  41. func (stable *SSTable) GetGlobalId() string {
  42. return stable.NatGatewaySnatId
  43. }
  44. func (stable *SSTable) GetStatus() string {
  45. return api.NAT_STAUTS_AVAILABLE
  46. }
  47. func (stable *SSTable) GetIP() string {
  48. return strings.Join(stable.PublicIpAddresses, ",")
  49. }
  50. func (stable *SSTable) GetSourceCIDR() string {
  51. return stable.PrivateIpAddress
  52. }
  53. func (stable *SSTable) GetNetworkId() string {
  54. return stable.ResourceId
  55. }
  56. func (stable *SSTable) Delete() error {
  57. return cloudprovider.ErrNotImplemented
  58. }