{"base_path":"/","components":null,"consumes":"","definitions":{"ChangeSqlSwitchBody":{"properties":{"datastore_type":{"description":"数据库类型。当前全量SQL支持的数据库类型包括MySQL和GaussDB(for MySQL),慢SQL支持的类型:MySQL、GaussDB(for MySQL)、PostgreSQL。","type":"string"},"retention_days":{"description":"SQL数据保存时长(天)。默认为7天,最长可保留30天,到期后数据自动删除。如果要保留30天以上,请到DAS页面进行操作。","format":"int64","type":"integer"},"status":{"description":"开关状态,取值0和1,分别代表要关闭和开启。","format":"int32","type":"integer"},"type":{"description":"开关类型。取值DAS SQL Explorer和DAS Slow Query Log,分别表示DAS收集全量SQL开关和DAS收集慢SQL开关。","type":"string"}},"required":["type","status","datastore_type"]},"ChangeSqlSwitchResp":{"properties":{"status":{"description":"开关状态。取值: Enabled:已开启, Disabled:已关闭, Switching:开关切换中","type":"string"}},"required":["status"]},"ErrorResp":{"description":"失败时返回的错误对象","properties":{"error_code":{"description":"错误码","maxLength":36,"minLength":8,"type":"string"},"error_msg":{"description":"错误描述","maxLength":512,"minLength":2,"type":"string"}},"required":["error_code","error_msg"]}},"description":null,"group_id":"7f831fc0dd494cfe86eff0b79e4f207d","host":"das.cn-north-4.myhuaweicloud.com","id":"9e9109cb65b94895a6b5afe319adbe10","info_version":"v3","method":"post","name":"ChangeSqlSwitch","parameters":{},"paths":{"/v3/{project_id}/instances/{instance_id}/sql/switch":{"post":{"description":"打开或者关闭DAS收集全量SQL开关,开启后,实例的性能损耗在5%以内。开启全量SQL后,本服务会对SQL的文本内容进行存储,以便进行分析。用户可自行设置全量SQL的保存时间范围,到期后会自动删除;如果未设置,数据默认保留7天。\n打开或者关闭DAS收集慢SQL开关。开启慢SQL后,本服务会对慢SQL的文本内容进行存储,以便进行分析。用户可自行设置慢SQL的保存时间范围,到期后会自动删除;如果未设置,数据默认保留7天。该功能仅支持付费实例。","operationId":"ChangeSqlSwitch","parameters":[{"description":"项目ID","in":"path","name":"project_id","required":true,"type":"string"},{"description":"实例ID","in":"path","name":"instance_id","required":true,"type":"string"},{"description":"用户Token。","in":"header","name":"X-Auth-Token","required":true,"type":"string"},{"description":"请求语言类型。","enum":["en-us","zh-cn"],"in":"header","name":"X-Language","required":false,"type":"string"},{"description":"请求体。","in":"body","name":"ChangeDasSwitchBody","required":true,"schema":{"$ref":"#/definitions/ChangeSqlSwitchBody"}}],"responses":{"200":{"description":"Success.","examples":{"application/json":{"status":"Enabled"}},"schema":{"$ref":"#/definitions/ChangeSqlSwitchResp"}},"400":{"description":"Client error.","schema":{"$ref":"#/definitions/ErrorResp"}},"500":{"description":"Server error.","schema":{"$ref":"#/definitions/ErrorResp"}}},"summary":"开启/关闭全量SQL、慢SQL开关","tags":["云DBA"],"x-das-is-publish":"#ChangeSqlSwitch_Placeholder#","x-is-registered":"Y","x-order":13,"x-request-examples-1":{"datastore_type":"MySQL","retention_days":8,"status":1,"type":"DAS SQL Explorer"},"x-request-examples-text-1":{"datastore_type":"MySQL","retention_days":8,"status":1,"type":"DAS SQL Explorer"},"x-request-examples-url-1":"POST https://das.cn-north-1.myhuaweicloud.com/v3/054e292c9880d4992f02c0196d3ea468/instances/da304cd5bbb944de828759bc7be3d3fein01/sql/switch","x-support-sdk":"Y"}}},"product_short":"DAS","region_id":"cn-north-4","schemes":["HTTPS"],"security_definitions":null,"summary":"开启/关闭全量SQL、慢SQL开关","tags":"云DBA","uri":null,"version":"2.0"}