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