fakeregion.go 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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 cloudprovider
  15. import "yunion.io/x/pkg/errors"
  16. type SFakeOnPremiseRegion struct {
  17. }
  18. func (region *SFakeOnPremiseRegion) GetId() string {
  19. return "default"
  20. }
  21. func (region *SFakeOnPremiseRegion) GetName() string {
  22. return "Default"
  23. }
  24. func (region *SFakeOnPremiseRegion) GetGlobalId() string {
  25. return "default"
  26. }
  27. func (region *SFakeOnPremiseRegion) GetStatus() string {
  28. return "available"
  29. }
  30. func (region *SFakeOnPremiseRegion) GetCloudEnv() string {
  31. return ""
  32. }
  33. func (region *SFakeOnPremiseRegion) Refresh() error {
  34. return nil
  35. }
  36. func (region *SFakeOnPremiseRegion) IsEmulated() bool {
  37. return true
  38. }
  39. func (region *SFakeOnPremiseRegion) GetSysTags() map[string]string {
  40. return nil
  41. }
  42. func (region *SFakeOnPremiseRegion) GetTags() (map[string]string, error) {
  43. return nil, errors.Wrap(ErrNotImplemented, "GetTags")
  44. }
  45. func (region *SFakeOnPremiseRegion) SetTags(tags map[string]string, replace bool) error {
  46. return ErrNotImplemented
  47. }
  48. func (region *SFakeOnPremiseRegion) GetGeographicInfo() SGeographicInfo {
  49. return SGeographicInfo{}
  50. }
  51. func (region *SFakeOnPremiseRegion) GetIZones() ([]ICloudZone, error) {
  52. return nil, ErrNotSupported
  53. }
  54. func (region *SFakeOnPremiseRegion) GetIZoneById(id string) (ICloudZone, error) {
  55. return nil, ErrNotSupported
  56. }
  57. func (region *SFakeOnPremiseRegion) GetIVpcById(id string) (ICloudVpc, error) {
  58. return nil, ErrNotSupported
  59. }
  60. func (region *SFakeOnPremiseRegion) GetIVpcs() ([]ICloudVpc, error) {
  61. return nil, ErrNotSupported
  62. }
  63. func (region *SFakeOnPremiseRegion) GetIEips() ([]ICloudEIP, error) {
  64. return nil, ErrNotSupported
  65. }
  66. func (region *SFakeOnPremiseRegion) GetIEipById(id string) (ICloudEIP, error) {
  67. return nil, ErrNotSupported
  68. }
  69. func (region *SFakeOnPremiseRegion) CreateIVpc(opts *VpcCreateOptions) (ICloudVpc, error) {
  70. return nil, ErrNotSupported
  71. }
  72. func (region *SFakeOnPremiseRegion) CreateEIP(eip *SEip) (ICloudEIP, error) {
  73. return nil, ErrNotSupported
  74. }
  75. func (region *SFakeOnPremiseRegion) GetISecurityGroupById(id string) (ICloudSecurityGroup, error) {
  76. return nil, ErrNotSupported
  77. }
  78. func (region *SFakeOnPremiseRegion) CreateISecurityGroup(conf *SecurityGroupCreateInput) (ICloudSecurityGroup, error) {
  79. return nil, ErrNotSupported
  80. }
  81. func (region *SFakeOnPremiseRegion) GetILoadBalancers() ([]ICloudLoadbalancer, error) {
  82. return nil, ErrNotSupported
  83. }
  84. func (region *SFakeOnPremiseRegion) GetILoadBalancerById(loadbalancerId string) (ICloudLoadbalancer, error) {
  85. return nil, ErrNotSupported
  86. }
  87. func (region *SFakeOnPremiseRegion) GetILoadBalancerAclById(aclId string) (ICloudLoadbalancerAcl, error) {
  88. return nil, ErrNotSupported
  89. }
  90. func (region *SFakeOnPremiseRegion) GetILoadBalancerCertificateById(certId string) (ICloudLoadbalancerCertificate, error) {
  91. return nil, ErrNotSupported
  92. }
  93. func (region *SFakeOnPremiseRegion) CreateILoadBalancerCertificate(cert *SLoadbalancerCertificate) (ICloudLoadbalancerCertificate, error) {
  94. return nil, ErrNotImplemented
  95. }
  96. func (region *SFakeOnPremiseRegion) GetILoadBalancerAcls() ([]ICloudLoadbalancerAcl, error) {
  97. return nil, ErrNotSupported
  98. }
  99. func (region *SFakeOnPremiseRegion) GetILoadBalancerCertificates() ([]ICloudLoadbalancerCertificate, error) {
  100. return nil, ErrNotSupported
  101. }
  102. func (region *SFakeOnPremiseRegion) CreateILoadBalancer(loadbalancer *SLoadbalancerCreateOptions) (ICloudLoadbalancer, error) {
  103. return nil, ErrNotSupported
  104. }
  105. func (region *SFakeOnPremiseRegion) CreateILoadBalancerAcl(acl *SLoadbalancerAccessControlList) (ICloudLoadbalancerAcl, error) {
  106. return nil, ErrNotSupported
  107. }