yunion.io/x/cloudmux@v0.3.10-0-alpha.1/pkg/multicloud/dbinstance_account_base.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  // Copyright 2019 Yunion
    16  //
    17  // Licensed under the Apache License, Version 2.0 (the "License");
    18  // you may not use this file except in compliance with the License.
    19  // You may obtain a copy of the License at
    20  //
    21  //     http://www.apache.org/licenses/LICENSE-2.0
    22  // // Unless required by applicable law or agreed to in writing, software
    23  // distributed under the License is distributed on an "AS IS" BASIS,
    24  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    25  // See the License for the specific language governing permissions and
    26  // limitations under the License.
    27  
    28  package multicloud
    29  
    30  import (
    31  	"yunion.io/x/pkg/errors"
    32  
    33  	api "yunion.io/x/cloudmux/pkg/apis/compute"
    34  	"yunion.io/x/cloudmux/pkg/cloudprovider"
    35  )
    36  
    37  type SDBInstanceAccountBase struct {
    38  }
    39  
    40  func (account *SDBInstanceAccountBase) GetIDBInstanceAccountPrivileges() ([]cloudprovider.ICloudDBInstanceAccountPrivilege, error) {
    41  	return []cloudprovider.ICloudDBInstanceAccountPrivilege{}, nil
    42  }
    43  
    44  func (account *SDBInstanceAccountBase) Delete() error {
    45  	return errors.Wrapf(cloudprovider.ErrNotImplemented, "Delete")
    46  }
    47  
    48  func (account *SDBInstanceAccountBase) GetHost() string {
    49  	return "%"
    50  }
    51  
    52  func (account *SDBInstanceAccountBase) GetStatus() string {
    53  	return api.DBINSTANCE_USER_AVAILABLE
    54  }
    55  
    56  func (account *SDBInstanceAccountBase) ResetPassword(password string) error {
    57  	return errors.Wrapf(cloudprovider.ErrNotImplemented, "ResetPassword")
    58  }
    59  
    60  func (backup *SDBInstanceAccountBase) GrantPrivilege(database, privilege string) error {
    61  	return errors.Wrapf(cloudprovider.ErrNotImplemented, "GrantPrivilege")
    62  }
    63  
    64  func (backup *SDBInstanceAccountBase) RevokePrivilege(database string) error {
    65  	return errors.Wrapf(cloudprovider.ErrNotImplemented, "RevokePrivilege")
    66  }