Documentation ¶
Index ¶
- func DasClientBuilder() *http_client.HcHttpClientBuilder
- func GenReqDefForChangeSqlSwitch() *def.HttpRequestDef
- func GenReqDefForCreateSpaceAnalysisTask() *def.HttpRequestDef
- func GenReqDefForDeleteDbUser() *def.HttpRequestDef
- func GenReqDefForDeleteProcess() *def.HttpRequestDef
- func GenReqDefForExportSlowQueryLogs() *def.HttpRequestDef
- func GenReqDefForExportSqlStatements() *def.HttpRequestDef
- func GenReqDefForListApiVersions() *def.HttpRequestDef
- func GenReqDefForListDbUsers() *def.HttpRequestDef
- func GenReqDefForListInnodbLocks() *def.HttpRequestDef
- func GenReqDefForListMetadataLocks() *def.HttpRequestDef
- func GenReqDefForListProcesses() *def.HttpRequestDef
- func GenReqDefForListSpaceAnalysis() *def.HttpRequestDef
- func GenReqDefForRegisterDbUser() *def.HttpRequestDef
- func GenReqDefForShowApiVersion() *def.HttpRequestDef
- func GenReqDefForShowDbUser() *def.HttpRequestDef
- func GenReqDefForShowQuotas() *def.HttpRequestDef
- func GenReqDefForShowSqlExecutionPlan() *def.HttpRequestDef
- func GenReqDefForShowSqlExplain() *def.HttpRequestDef
- func GenReqDefForShowSqlSwitchStatus() *def.HttpRequestDef
- func GenReqDefForUpdateDbUser() *def.HttpRequestDef
- type DasClient
- func (c *DasClient) ChangeSqlSwitch(request *model.ChangeSqlSwitchRequest) (*model.ChangeSqlSwitchResponse, error)
- func (c *DasClient) CreateSpaceAnalysisTask(request *model.CreateSpaceAnalysisTaskRequest) (*model.CreateSpaceAnalysisTaskResponse, error)
- func (c *DasClient) DeleteDbUser(request *model.DeleteDbUserRequest) (*model.DeleteDbUserResponse, error)
- func (c *DasClient) DeleteProcess(request *model.DeleteProcessRequest) (*model.DeleteProcessResponse, error)
- func (c *DasClient) ExportSlowQueryLogs(request *model.ExportSlowQueryLogsRequest) (*model.ExportSlowQueryLogsResponse, error)
- func (c *DasClient) ExportSqlStatements(request *model.ExportSqlStatementsRequest) (*model.ExportSqlStatementsResponse, error)
- func (c *DasClient) ListApiVersions(request *model.ListApiVersionsRequest) (*model.ListApiVersionsResponse, error)
- func (c *DasClient) ListDbUsers(request *model.ListDbUsersRequest) (*model.ListDbUsersResponse, error)
- func (c *DasClient) ListInnodbLocks(request *model.ListInnodbLocksRequest) (*model.ListInnodbLocksResponse, error)
- func (c *DasClient) ListMetadataLocks(request *model.ListMetadataLocksRequest) (*model.ListMetadataLocksResponse, error)
- func (c *DasClient) ListProcesses(request *model.ListProcessesRequest) (*model.ListProcessesResponse, error)
- func (c *DasClient) ListSpaceAnalysis(request *model.ListSpaceAnalysisRequest) (*model.ListSpaceAnalysisResponse, error)
- func (c *DasClient) RegisterDbUser(request *model.RegisterDbUserRequest) (*model.RegisterDbUserResponse, error)
- func (c *DasClient) ShowApiVersion(request *model.ShowApiVersionRequest) (*model.ShowApiVersionResponse, error)
- func (c *DasClient) ShowDbUser(request *model.ShowDbUserRequest) (*model.ShowDbUserResponse, error)
- func (c *DasClient) ShowQuotas(request *model.ShowQuotasRequest) (*model.ShowQuotasResponse, error)
- func (c *DasClient) ShowSqlExecutionPlan(request *model.ShowSqlExecutionPlanRequest) (*model.ShowSqlExecutionPlanResponse, error)
- func (c *DasClient) ShowSqlExplain(request *model.ShowSqlExplainRequest) (*model.ShowSqlExplainResponse, error)
- func (c *DasClient) ShowSqlSwitchStatus(request *model.ShowSqlSwitchStatusRequest) (*model.ShowSqlSwitchStatusResponse, error)
- func (c *DasClient) UpdateDbUser(request *model.UpdateDbUserRequest) (*model.UpdateDbUserResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DasClientBuilder ¶
func DasClientBuilder() *http_client.HcHttpClientBuilder
func GenReqDefForChangeSqlSwitch ¶
func GenReqDefForChangeSqlSwitch() *def.HttpRequestDef
func GenReqDefForCreateSpaceAnalysisTask ¶
func GenReqDefForCreateSpaceAnalysisTask() *def.HttpRequestDef
func GenReqDefForDeleteDbUser ¶
func GenReqDefForDeleteDbUser() *def.HttpRequestDef
func GenReqDefForDeleteProcess ¶
func GenReqDefForDeleteProcess() *def.HttpRequestDef
func GenReqDefForExportSlowQueryLogs ¶
func GenReqDefForExportSlowQueryLogs() *def.HttpRequestDef
func GenReqDefForExportSqlStatements ¶
func GenReqDefForExportSqlStatements() *def.HttpRequestDef
func GenReqDefForListApiVersions ¶
func GenReqDefForListApiVersions() *def.HttpRequestDef
func GenReqDefForListDbUsers ¶
func GenReqDefForListDbUsers() *def.HttpRequestDef
func GenReqDefForListInnodbLocks ¶
func GenReqDefForListInnodbLocks() *def.HttpRequestDef
func GenReqDefForListMetadataLocks ¶
func GenReqDefForListMetadataLocks() *def.HttpRequestDef
func GenReqDefForListProcesses ¶
func GenReqDefForListProcesses() *def.HttpRequestDef
func GenReqDefForListSpaceAnalysis ¶
func GenReqDefForListSpaceAnalysis() *def.HttpRequestDef
func GenReqDefForRegisterDbUser ¶
func GenReqDefForRegisterDbUser() *def.HttpRequestDef
func GenReqDefForShowApiVersion ¶
func GenReqDefForShowApiVersion() *def.HttpRequestDef
func GenReqDefForShowDbUser ¶
func GenReqDefForShowDbUser() *def.HttpRequestDef
func GenReqDefForShowQuotas ¶
func GenReqDefForShowQuotas() *def.HttpRequestDef
func GenReqDefForShowSqlExecutionPlan ¶
func GenReqDefForShowSqlExecutionPlan() *def.HttpRequestDef
func GenReqDefForShowSqlExplain ¶ added in v0.0.81
func GenReqDefForShowSqlExplain() *def.HttpRequestDef
func GenReqDefForShowSqlSwitchStatus ¶
func GenReqDefForShowSqlSwitchStatus() *def.HttpRequestDef
func GenReqDefForUpdateDbUser ¶
func GenReqDefForUpdateDbUser() *def.HttpRequestDef
Types ¶
type DasClient ¶
type DasClient struct {
HcClient *http_client.HcHttpClient
}
func NewDasClient ¶
func NewDasClient(hcClient *http_client.HcHttpClient) *DasClient
func (*DasClient) ChangeSqlSwitch ¶
func (c *DasClient) ChangeSqlSwitch(request *model.ChangeSqlSwitchRequest) (*model.ChangeSqlSwitchResponse, error)
开启/关闭全量SQL、慢SQL开关
打开或者关闭DAS收集全量SQL开关,开启后,实例的性能损耗在5%以内。开启全量SQL后,本服务会对SQL的文本内容进行存储,以便进行分析。用户可自行设置全量SQL的保存时间范围,到期后会自动删除;如果未设置,数据默认保留7天。 打开或者关闭DAS收集慢SQL开关。开启慢SQL后,本服务会对慢SQL的文本内容进行存储,以便进行分析。用户可自行设置慢SQL的保存时间范围,到期后会自动删除;如果未设置,数据默认保留7天。该功能仅支持付费实例。
详细说明请参考华为云API Explorer。 Please refer to Huawei cloud API Explorer for details.
func (*DasClient) CreateSpaceAnalysisTask ¶
func (c *DasClient) CreateSpaceAnalysisTask(request *model.CreateSpaceAnalysisTaskRequest) (*model.CreateSpaceAnalysisTaskResponse, error)
创建空间分析任务
创建空间分析任务,如触发重新分析,支持MySQL和GaussDB(for MySQL)引擎
详细说明请参考华为云API Explorer。 Please refer to Huawei cloud API Explorer for details.
func (*DasClient) DeleteDbUser ¶
func (c *DasClient) DeleteDbUser(request *model.DeleteDbUserRequest) (*model.DeleteDbUserResponse, error)
删除数据库用户
删除注册在DAS里的数据库用户。此接口只是将注册的数据库用户在DAS系统里删除,不会真正删除数据库用户对象。 目前仅支持MySQL实例。
详细说明请参考华为云API Explorer。 Please refer to Huawei cloud API Explorer for details.
func (*DasClient) DeleteProcess ¶
func (c *DasClient) DeleteProcess(request *model.DeleteProcessRequest) (*model.DeleteProcessResponse, error)
查杀会话
查杀会话。支持按照用户、数据库、会话列表查杀会话,三个条件至少指定一个。 目前仅支持MySQL实例。
详细说明请参考华为云API Explorer。 Please refer to Huawei cloud API Explorer for details.
func (*DasClient) ExportSlowQueryLogs ¶
func (c *DasClient) ExportSlowQueryLogs(request *model.ExportSlowQueryLogsRequest) (*model.ExportSlowQueryLogsResponse, error)
导出慢SQL数据
DAS收集慢SQL开关打开后,一次性导出指定时间范围内的慢SQL数据,支持分页滚动获取。该功能仅支持付费实例。
详细说明请参考华为云API Explorer。 Please refer to Huawei cloud API Explorer for details.
func (*DasClient) ExportSqlStatements ¶
func (c *DasClient) ExportSqlStatements(request *model.ExportSqlStatementsRequest) (*model.ExportSqlStatementsResponse, error)
导出全量SQL
全量SQL开关打开后,一次性导出指定时间范围内的全量SQL数据,支持分页滚动获取。该功能仅支持付费实例。
详细说明请参考华为云API Explorer。 Please refer to Huawei cloud API Explorer for details.
func (*DasClient) ListApiVersions ¶
func (c *DasClient) ListApiVersions(request *model.ListApiVersionsRequest) (*model.ListApiVersionsResponse, error)
查询API版本列表
查询API版本列表
详细说明请参考华为云API Explorer。 Please refer to Huawei cloud API Explorer for details.
func (*DasClient) ListDbUsers ¶
func (c *DasClient) ListDbUsers(request *model.ListDbUsersRequest) (*model.ListDbUsersResponse, error)
查询数据库用户列表
查询注册在DAS里的数据库用户列表,后续调用其他接口时(如查询实例会话列表接口)需要用到此接口返回的db_user_id。此接口不会返回数据库实例上的数据库用户对象。 目前仅支持MySQL实例。
详细说明请参考华为云API Explorer。 Please refer to Huawei cloud API Explorer for details.
func (*DasClient) ListInnodbLocks ¶
func (c *DasClient) ListInnodbLocks(request *model.ListInnodbLocksRequest) (*model.ListInnodbLocksResponse, error)
查询InnoDB锁等待列表
查询InnoDB锁等待列表。 目前仅支持MySQL实例。
详细说明请参考华为云API Explorer。 Please refer to Huawei cloud API Explorer for details.
func (*DasClient) ListMetadataLocks ¶
func (c *DasClient) ListMetadataLocks(request *model.ListMetadataLocksRequest) (*model.ListMetadataLocksResponse, error)
查询元数据锁列表
查询元数据锁列表。 目前仅支持MySQL实例。
详细说明请参考华为云API Explorer。 Please refer to Huawei cloud API Explorer for details.
func (*DasClient) ListProcesses ¶
func (c *DasClient) ListProcesses(request *model.ListProcessesRequest) (*model.ListProcessesResponse, error)
查询实例会话列表
支持根据数据库、用户查询实例会话列表。 目前仅支持MySQL实例。
详细说明请参考华为云API Explorer。 Please refer to Huawei cloud API Explorer for details.
func (*DasClient) ListSpaceAnalysis ¶
func (c *DasClient) ListSpaceAnalysis(request *model.ListSpaceAnalysisRequest) (*model.ListSpaceAnalysisResponse, error)
获取空间分析数据列表
获取空间分析数据列表。实例级别数据来源于文件系统,库级别和表级别数据来源于information_schema.tables表。空间&元数据分析最多分析10000张表,若缺少库表空间数据,可能是因为数据库实例表个数过多或者账号未保存密码。如果为保存密码,请使用用户管理接口或页面录入数据库账号。支持MySQL和GaussDB(for MySQL)引擎
详细说明请参考华为云API Explorer。 Please refer to Huawei cloud API Explorer for details.
func (*DasClient) RegisterDbUser ¶
func (c *DasClient) RegisterDbUser(request *model.RegisterDbUserRequest) (*model.RegisterDbUserResponse, error)
注册数据库用户
此接口是将数据库用户和密码注册进DAS系统,同时会返回一个数据库用户ID ,后续调用其他接口时(如查询实例会话列表接口)需要用到此数据库用户ID。密码为加密存储,且仅用于DAS API相关功能。此接口不会在数据库实例上创建数据库用户对象。请确保输入的用户名和密码是已经存在并且是正确的。 目前仅支持MySQL实例。
详细说明请参考华为云API Explorer。 Please refer to Huawei cloud API Explorer for details.
func (*DasClient) ShowApiVersion ¶
func (c *DasClient) ShowApiVersion(request *model.ShowApiVersionRequest) (*model.ShowApiVersionResponse, error)
查询指定的API版本信息
查询指定的API版本信息
详细说明请参考华为云API Explorer。 Please refer to Huawei cloud API Explorer for details.
func (*DasClient) ShowDbUser ¶
func (c *DasClient) ShowDbUser(request *model.ShowDbUserRequest) (*model.ShowDbUserResponse, error)
查询数据库用户信息
查询注册在DAS里的数据库用户信息。此接口不能查询数据库实例上的数据库用户对象。 目前仅支持MySQL实例。
详细说明请参考华为云API Explorer。 Please refer to Huawei cloud API Explorer for details.
func (*DasClient) ShowQuotas ¶
func (c *DasClient) ShowQuotas(request *model.ShowQuotasRequest) (*model.ShowQuotasResponse, error)
查询云DBA配额
查询云DBA配额
详细说明请参考华为云API Explorer。 Please refer to Huawei cloud API Explorer for details.
func (*DasClient) ShowSqlExecutionPlan ¶
func (c *DasClient) ShowSqlExecutionPlan(request *model.ShowSqlExecutionPlanRequest) (*model.ShowSqlExecutionPlanResponse, error)
查询SQL执行计划
查询SQL执行计划。 目前仅支持MySQL实例。
详细说明请参考华为云API Explorer。 Please refer to Huawei cloud API Explorer for details.
func (*DasClient) ShowSqlExplain ¶ added in v0.0.81
func (c *DasClient) ShowSqlExplain(request *model.ShowSqlExplainRequest) (*model.ShowSqlExplainResponse, error)
查询SQL执行计划
查询SQL执行计划。 目前仅支持MySQL实例。 补充GET请求,处理超长SQL
详细说明请参考华为云API Explorer。 Please refer to Huawei cloud API Explorer for details.
func (*DasClient) ShowSqlSwitchStatus ¶
func (c *DasClient) ShowSqlSwitchStatus(request *model.ShowSqlSwitchStatusRequest) (*model.ShowSqlSwitchStatusResponse, error)
查询全量SQL和慢SQL的开关状态。
查询DAS收集全量SQL和慢SQL的开关状态。该功能仅支持付费实例。
详细说明请参考华为云API Explorer。 Please refer to Huawei cloud API Explorer for details.
func (*DasClient) UpdateDbUser ¶
func (c *DasClient) UpdateDbUser(request *model.UpdateDbUserRequest) (*model.UpdateDbUserResponse, error)
修改数据库用户
修改注册在DAS里的数据库用户名和密码。此接口不会修改数据库实例上的数据库用户对象的用户名和密码。请确保输入的用户名和密码是已经存在并且是正确的。 目前仅支持MySQL实例。
详细说明请参考华为云API Explorer。 Please refer to Huawei cloud API Explorer for details.