internetgateway.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 aws
  15. import (
  16. "github.com/pkg/errors"
  17. "yunion.io/x/cloudmux/pkg/cloudprovider"
  18. "yunion.io/x/cloudmux/pkg/multicloud"
  19. )
  20. type SInternetGateway struct {
  21. multicloud.SResourceBase
  22. AwsTags
  23. region *SRegion
  24. Attachments []InternetGatewayAttachment `xml:"attachmentSet>item"`
  25. InternetGatewayId string `xml:"internetGatewayId"`
  26. OwnerId string `xml:"ownerId"`
  27. }
  28. type InternetGatewayAttachment struct {
  29. State string `xml:"state"`
  30. VpcId string `xml:"vpcId"`
  31. }
  32. func (i *SInternetGateway) GetId() string {
  33. return i.InternetGatewayId
  34. }
  35. func (i *SInternetGateway) GetName() string {
  36. return i.InternetGatewayId
  37. }
  38. func (i *SInternetGateway) GetGlobalId() string {
  39. return i.GetId()
  40. }
  41. func (i *SInternetGateway) GetStatus() string {
  42. return ""
  43. }
  44. func (i *SInternetGateway) Refresh() error {
  45. return errors.Wrap(cloudprovider.ErrNotImplemented, "Refresh")
  46. }
  47. func (i *SInternetGateway) IsEmulated() bool {
  48. return false
  49. }
  50. func (self *SInternetGateway) GetDescription() string {
  51. return self.AwsTags.GetDescription()
  52. }