{"base_path":"/","components":null,"consumes":"[\"application/json;charset=UTF-8\"]","definitions":{"AutoScalingSwitchStatus":{"description":"开关状态。","properties":{"flavor_switch":{"description":"扩缩规格开关状态。\n\n取值:\n\n- ON:开启。\n- OFF:关闭。","type":"string"},"read_only_switch":{"description":"增删只读节点开关状态。\n\n取值:\n\n- ON:开启。\n- OFF:关闭。","type":"string"},"scaling_switch":{"description":"自动变配开关状态。\n\n取值:\n\n- ON:开启。\n- OFF:关闭。","type":"string"}}},"MysqlErrorResponse":{"properties":{"error_code":{"description":"错误码。","example":"DBS.200022","type":"string"},"error_msg":{"description":"错误消息。","example":"实例不存在","type":"string"}},"required":["error_code","error_msg"]},"ScalingStrategyReqInfo":{"description":"自动变配策略。","properties":{"flavor_switch":{"description":"扩缩规格开关。\n- ON:开启。\n- OFF:关闭。","type":"string"},"read_only_switch":{"description":"增删只读节点开关。自动增删只读节点功能需要先[开启数据库代理](https://support.huaweicloud.com/api-gaussdbformysql/CreateGaussMySqlProxy.html),且只能有一个代理。\n- ON:开启。\n- OFF:关闭。","type":"string"}},"required":["flavor_switch","read_only_switch"]},"UpdateAutoScalingPolicyRequestBody":{"description":"设置自动变配策略请求体","properties":{"enlarge_threshold":{"description":"CPU平均使用率(百分比数值)。\n\n取值范围:50-100。\n\nstatus为ON时必填。","type":"integer"},"max_flavor":{"description":"扩容规格上限。开启扩缩规格时必填。","type":"string"},"max_read_only_count":{"description":"只读节点数量上限。开启增删只读节点时必填。","type":"integer"},"monitor_cycle":{"description":"监测周期(单位:秒)。\n在整个观测窗口期内,若CPU平均使用率大于等于设定值,则在观测窗口结束后,进行扩容。\n\n取值范围:300、600、900、1800。\n\nstatus为ON时必填。","example":5,"type":"integer"},"read_only_weight":{"description":"只读节点读写分离权重。开启增删只读节点时必填。","type":"integer"},"reduce_enabled":{"description":"是否开启自动回缩。开启自动变配时必填。\n- true:是。\n- false:否。","type":"boolean"},"scaling_strategy":{"$ref":"#/definitions/ScalingStrategyReqInfo"},"silence_cycle":{"description":"静默周期(单位:秒)。\n两次自动扩容或自动回缩的最小间隔时间。\n\n取值范围:300、600、1800、3600、7200、10800、86400、604800。\n\nstatus为ON时必填。","example":3,"type":"integer"},"status":{"description":"自动变配开关状态。\n\n取值:\n\n- ON:开启。\n- OFF:关闭。","example":"ON","type":"string"}},"required":["status","scaling_strategy"]},"UpdateAutoScalingPolicyResp":{"properties":{"instance_id":{"description":"实例ID。","type":"string"},"instance_name":{"description":"实例名称。","type":"string"},"switch_status":{"$ref":"#/definitions/AutoScalingSwitchStatus"}}}},"description":null,"group_id":"1bf15763f8164608918d180a9b1aa137","host":"gaussdb.cn-north-4.myhuaweicloud.com","id":"670f72feb9ee410daa5cc812cdba332f","info_version":"v3","method":"put","name":"UpdateAutoScalingPolicy","parameters":{},"paths":{"/v3/{project_id}/instances/{instance_id}/auto-scaling/policy":{"put":{"description":"设置自动变配。","operationId":"UpdateAutoScalingPolicy","parameters":[{"description":"用户Token。\n\n通过调用IAM服务[获取用户Token](https://support.huaweicloud.com/api-iam/iam_30_0001.html)接口获取。\n\n请求响应成功后在响应消息头中包含的“X-Subject-Token”的值即为Token值。\n","in":"header","name":"X-Auth-Token","required":true,"type":"string","x-example":"******"},{"description":"请求语言类型。默认en-us。\n取值范围:\n- en-us\n- zh-cn","in":"header","name":"X-Language","required":false,"type":"string","x-example":"zh-cn"},{"description":"内容类型。\n\n取值:application/json。\n","in":"header","name":"Content-Type","required":true,"type":"string","x-example":"application/json"},{"description":"租户在某一Region下的project ID。 \n\n获取方法请参见[获取项目ID](https://support.huaweicloud.com/api-gaussdbformysql/gaussdbformysql_10_0004.html)。\n","in":"path","name":"project_id","required":true,"type":"string","x-example":"619d3e78f61b4be68bc5aa0b59edcf7b"},{"description":"实例ID,严格匹配UUID规则。","in":"path","name":"instance_id","required":true,"type":"string","x-example":"61a4ea66210545909d74a05c27a7179ein07"},{"description":"请求体。","in":"body","name":"UpdateAutoScalingPolicyRequestBody","required":true,"schema":{"$ref":"#/definitions/UpdateAutoScalingPolicyRequestBody"}}],"produces":["application/json"],"responses":{"200":{"description":"Success.","examples":{"application/json":{"instance_id":"61a4ea66210545909d74a05c27a7179ein07","instance_name":"gauss-test-1","switch_status":{"flavor_switch":"ON","read_only_switch":"ON","scaling_switch":"ON"}}},"schema":{"$ref":"#/definitions/UpdateAutoScalingPolicyResp"}},"400":{"description":"Client error.","schema":{"$ref":"#/definitions/MysqlErrorResponse"}},"500":{"description":"Server error.","schema":{"$ref":"#/definitions/MysqlErrorResponse"}}},"summary":"设置自动变配","tags":["实例管理"],"x-constraint":"该接口目前公测阶段,如需使用,请提交工单联系客服人员申请权限。","x-is-registered":"N","x-request-examples-1":{"enlarge_threshold":50,"max_flavor":"gaussdb.mysql.large.x86.4","max_read_only_count":2,"monitor_cycle":300,"read_only_weight":10,"reduce_enabled":false,"scaling_strategy":{"flavor_switch":"ON","read_only_switch":"ON"},"silence_cycle":300,"status":"ON"},"x-request-examples-description-1":"设置自动变配。","x-request-examples-url-1":"PUT https://{endpoint}/v3/97b026aa9cc4417888c14c84a1ad9860/instances/61a4ea66210545909d74a05c27a7179ein07/auto-scaling/policy","x-support-sdk":"Y"}}},"product_short":"GaussDB","region_id":"cn-north-4","schemes":["HTTPS"],"security_definitions":null,"summary":"设置自动变配","tags":"实例管理","uri":null,"version":"2.0"}