yunion.io/x/cloudmux@v0.3.10-0-alpha.1/pkg/multicloud/hcs/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 hcs
    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  	paramters := []SDBInstanceParameter{}
    31  	err := region.rdsList("configurations", nil, paramters)
    32  	if err != nil {
    33  		return nil, err
    34  	}
    35  	return paramters, nil
    36  }
    37  
    38  func (param *SDBInstanceParameter) GetGlobalId() string {
    39  	return param.Name
    40  }
    41  
    42  func (param *SDBInstanceParameter) GetKey() string {
    43  	return param.Name
    44  }
    45  
    46  func (param *SDBInstanceParameter) GetValue() string {
    47  	return param.Value
    48  }
    49  
    50  func (param *SDBInstanceParameter) GetDescription() string {
    51  	return param.Description
    52  }