yunion.io/x/cloudmux@v0.3.10-0-alpha.1/pkg/multicloud/huawei/dbinstance_parameter.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 huawei
    16  
    17  type SDBInstanceParameter struct {
    18  	instance *SDBInstance
    19  
    20  	Name            string
    21  	Value           string
    22  	RestartRequired bool
    23  	Readonly        bool
    24  	ValueRange      string
    25  	Type            string
    26  	Description     string
    27  }
    28  
    29  func (region *SRegion) GetDBInstanceParameters(dbinstanceId string) ([]SDBInstanceParameter, error) {
    30  	params := map[string]string{
    31  		"instance_id": dbinstanceId,
    32  	}
    33  	paramters := []SDBInstanceParameter{}
    34  	err := doListAll(region.ecsClient.DBInstance.ListParameters, params, &paramters)
    35  	if err != nil {
    36  		return nil, err
    37  	}
    38  	return paramters, nil
    39  }
    40  
    41  func (param *SDBInstanceParameter) GetGlobalId() string {
    42  	return param.Name
    43  }
    44  
    45  func (param *SDBInstanceParameter) GetKey() string {
    46  	return param.Name
    47  }
    48  
    49  func (param *SDBInstanceParameter) GetValue() string {
    50  	return param.Value
    51  }
    52  
    53  func (param *SDBInstanceParameter) GetDescription() string {
    54  	return param.Description
    55  }