yunion.io/x/cloudmux@v0.3.10-0-alpha.1/pkg/cloudprovider/fakeregion.go (about)

     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  
    15  package cloudprovider
    16  
    17  import "yunion.io/x/pkg/errors"
    18  
    19  type SFakeOnPremiseRegion struct {
    20  }
    21  
    22  func (region *SFakeOnPremiseRegion) GetILoadBalancerBackendGroups() ([]ICloudLoadbalancerBackendGroup, error) {
    23  	return nil, ErrNotSupported
    24  }
    25  
    26  func (region *SFakeOnPremiseRegion) GetId() string {
    27  	return "default"
    28  }
    29  
    30  func (region *SFakeOnPremiseRegion) GetName() string {
    31  	return "Default"
    32  }
    33  
    34  func (region *SFakeOnPremiseRegion) GetGlobalId() string {
    35  	return "default"
    36  }
    37  
    38  func (region *SFakeOnPremiseRegion) GetStatus() string {
    39  	return "available"
    40  }
    41  
    42  func (region *SFakeOnPremiseRegion) GetCloudEnv() string {
    43  	return ""
    44  }
    45  
    46  func (region *SFakeOnPremiseRegion) Refresh() error {
    47  	return nil
    48  }
    49  
    50  func (region *SFakeOnPremiseRegion) IsEmulated() bool {
    51  	return true
    52  }
    53  
    54  func (region *SFakeOnPremiseRegion) GetSysTags() map[string]string {
    55  	return nil
    56  }
    57  
    58  func (region *SFakeOnPremiseRegion) GetTags() (map[string]string, error) {
    59  	return nil, errors.Wrap(ErrNotImplemented, "GetTags")
    60  }
    61  
    62  func (region *SFakeOnPremiseRegion) SetTags(tags map[string]string, replace bool) error {
    63  	return ErrNotImplemented
    64  }
    65  
    66  func (region *SFakeOnPremiseRegion) GetGeographicInfo() SGeographicInfo {
    67  	return SGeographicInfo{}
    68  }
    69  
    70  func (region *SFakeOnPremiseRegion) GetIZones() ([]ICloudZone, error) {
    71  	return nil, ErrNotSupported
    72  }
    73  
    74  func (region *SFakeOnPremiseRegion) GetIZoneById(id string) (ICloudZone, error) {
    75  	return nil, ErrNotSupported
    76  }
    77  
    78  func (region *SFakeOnPremiseRegion) GetIVpcById(id string) (ICloudVpc, error) {
    79  	return nil, ErrNotSupported
    80  }
    81  
    82  func (region *SFakeOnPremiseRegion) GetIVpcs() ([]ICloudVpc, error) {
    83  	return nil, ErrNotSupported
    84  }
    85  
    86  func (region *SFakeOnPremiseRegion) GetIEips() ([]ICloudEIP, error) {
    87  	return nil, ErrNotSupported
    88  }
    89  
    90  func (region *SFakeOnPremiseRegion) GetIEipById(id string) (ICloudEIP, error) {
    91  	return nil, ErrNotSupported
    92  }
    93  
    94  func (region *SFakeOnPremiseRegion) CreateIVpc(opts *VpcCreateOptions) (ICloudVpc, error) {
    95  	return nil, ErrNotSupported
    96  }
    97  
    98  func (region *SFakeOnPremiseRegion) CreateEIP(eip *SEip) (ICloudEIP, error) {
    99  	return nil, ErrNotSupported
   100  }
   101  
   102  func (region *SFakeOnPremiseRegion) GetISecurityGroupById(id string) (ICloudSecurityGroup, error) {
   103  	return nil, ErrNotSupported
   104  }
   105  
   106  func (region *SFakeOnPremiseRegion) GetISecurityGroupByName(opts *SecurityGroupFilterOptions) (ICloudSecurityGroup, error) {
   107  	return nil, ErrNotSupported
   108  }
   109  
   110  func (region *SFakeOnPremiseRegion) CreateISecurityGroup(conf *SecurityGroupCreateInput) (ICloudSecurityGroup, error) {
   111  	return nil, ErrNotSupported
   112  }
   113  
   114  func (region *SFakeOnPremiseRegion) GetILoadBalancers() ([]ICloudLoadbalancer, error) {
   115  	return nil, ErrNotSupported
   116  }
   117  
   118  func (region *SFakeOnPremiseRegion) GetILoadBalancerById(loadbalancerId string) (ICloudLoadbalancer, error) {
   119  	return nil, ErrNotSupported
   120  }
   121  
   122  func (region *SFakeOnPremiseRegion) GetILoadBalancerAclById(aclId string) (ICloudLoadbalancerAcl, error) {
   123  	return nil, ErrNotSupported
   124  }
   125  
   126  func (region *SFakeOnPremiseRegion) GetILoadBalancerCertificateById(certId string) (ICloudLoadbalancerCertificate, error) {
   127  	return nil, ErrNotSupported
   128  }
   129  
   130  func (region *SFakeOnPremiseRegion) CreateILoadBalancerCertificate(cert *SLoadbalancerCertificate) (ICloudLoadbalancerCertificate, error) {
   131  	return nil, ErrNotImplemented
   132  }
   133  
   134  func (region *SFakeOnPremiseRegion) GetILoadBalancerAcls() ([]ICloudLoadbalancerAcl, error) {
   135  	return nil, ErrNotSupported
   136  }
   137  
   138  func (region *SFakeOnPremiseRegion) GetILoadBalancerCertificates() ([]ICloudLoadbalancerCertificate, error) {
   139  	return nil, ErrNotSupported
   140  }
   141  
   142  func (region *SFakeOnPremiseRegion) CreateILoadBalancer(loadbalancer *SLoadbalancer) (ICloudLoadbalancer, error) {
   143  	return nil, ErrNotSupported
   144  }
   145  
   146  func (region *SFakeOnPremiseRegion) CreateILoadBalancerAcl(acl *SLoadbalancerAccessControlList) (ICloudLoadbalancerAcl, error) {
   147  	return nil, ErrNotSupported
   148  }