yunion.io/x/cloudmux@v0.3.10-0-alpha.1/pkg/multicloud/huawei/elasticcache_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  import (
    18  	"fmt"
    19  
    20  	api "yunion.io/x/cloudmux/pkg/apis/compute"
    21  	"yunion.io/x/cloudmux/pkg/multicloud"
    22  )
    23  
    24  // https://support.huaweicloud.com/api-dcs/dcs-zh-api-180423027.html
    25  type SElasticcacheParameter struct {
    26  	multicloud.SElasticcacheParameterBase
    27  	HuaweiTags
    28  
    29  	cacheDB *SElasticcache
    30  
    31  	Description  string `json:"description"`
    32  	ParamID      int64  `json:"param_id"`
    33  	ParamName    string `json:"param_name"`
    34  	ParamValue   string `json:"param_value"`
    35  	DefaultValue string `json:"default_value"`
    36  	ValueType    string `json:"value_type"`
    37  	ValueRange   string `json:"value_range"`
    38  }
    39  
    40  func (self *SElasticcacheParameter) GetId() string {
    41  	return fmt.Sprintf("%d", self.ParamID)
    42  }
    43  
    44  func (self *SElasticcacheParameter) GetName() string {
    45  	return self.ParamName
    46  }
    47  
    48  func (self *SElasticcacheParameter) GetGlobalId() string {
    49  	return fmt.Sprintf("%s/%s", self.cacheDB.InstanceID, self.GetId())
    50  }
    51  
    52  func (self *SElasticcacheParameter) GetStatus() string {
    53  	return api.ELASTIC_CACHE_PARAMETER_STATUS_AVAILABLE
    54  }
    55  
    56  func (self *SElasticcacheParameter) GetParameterKey() string {
    57  	return self.ParamName
    58  }
    59  
    60  func (self *SElasticcacheParameter) GetParameterValue() string {
    61  	return self.ParamValue
    62  }
    63  
    64  func (self *SElasticcacheParameter) GetParameterValueRange() string {
    65  	return self.Description
    66  }
    67  
    68  func (self *SElasticcacheParameter) GetDescription() string {
    69  	return self.ValueRange
    70  }
    71  
    72  func (self *SElasticcacheParameter) GetModifiable() bool {
    73  	return true
    74  }
    75  
    76  func (self *SElasticcacheParameter) GetForceRestart() bool {
    77  	return false
    78  }