lib/v20180724/client.rb in tencentcloud-sdk-monitor-3.0.747 vs lib/v20180724/client.rb in tencentcloud-sdk-monitor-3.0.748

- old
+ new

@@ -365,10 +365,37 @@ raise e rescue StandardError => e raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) end + # 创建Prometheus告警规则分组 + + # 告警分组中可包含多条告警规则,分组内告警消息通过告警分组的通知模板发送。 + # 支持单个告警分组下分别创建启用/禁用的告警规则。 + + # @param request: Request instance for CreatePrometheusAlertGroup. + # @type request: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusAlertGroupRequest` + # @rtype: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusAlertGroupResponse` + def CreatePrometheusAlertGroup(request) + body = send_request('CreatePrometheusAlertGroup', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = CreatePrometheusAlertGroupResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + # 创建 Prometheus 告警策略(将逐步废弃,建议使用 CreatePrometheusAlertGroup 创建告警策略) # @param request: Request instance for CreatePrometheusAlertPolicy. # @type request: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusAlertPolicyRequest` # @rtype: :class:`Tencentcloud::monitor::V20180724::CreatePrometheusAlertPolicyResponse` @@ -823,10 +850,34 @@ raise e rescue StandardError => e raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) end + # 删除Prometheus告警规则分组 + + # @param request: Request instance for DeletePrometheusAlertGroups. + # @type request: :class:`Tencentcloud::monitor::V20180724::DeletePrometheusAlertGroupsRequest` + # @rtype: :class:`Tencentcloud::monitor::V20180724::DeletePrometheusAlertGroupsResponse` + def DeletePrometheusAlertGroups(request) + body = send_request('DeletePrometheusAlertGroups', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = DeletePrometheusAlertGroupsResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + # 删除2.0实例告警策略 # @param request: Request instance for DeletePrometheusAlertPolicy. # @type request: :class:`Tencentcloud::monitor::V20180724::DeletePrometheusAlertPolicyRequest` # @rtype: :class:`Tencentcloud::monitor::V20180724::DeletePrometheusAlertPolicyResponse` @@ -1907,10 +1958,34 @@ raise e rescue StandardError => e raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) end + # 查询给定prometheus下的告警分组 + + # @param request: Request instance for DescribePrometheusAlertGroups. + # @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusAlertGroupsRequest` + # @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusAlertGroupsResponse` + def DescribePrometheusAlertGroups(request) + body = send_request('DescribePrometheusAlertGroups', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = DescribePrometheusAlertGroupsResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + # 获取2.0实例告警策略列表 # @param request: Request instance for DescribePrometheusAlertPolicy. # @type request: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusAlertPolicyRequest` # @rtype: :class:`Tencentcloud::monitor::V20180724::DescribePrometheusAlertPolicyResponse` @@ -3492,9 +3567,57 @@ def UpdatePrometheusAgentStatus(request) body = send_request('UpdatePrometheusAgentStatus', request.serialize) response = JSON.parse(body) if response['Response'].key?('Error') == false model = UpdatePrometheusAgentStatusResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + + # 更新Prometheus告警规则分组 + + # @param request: Request instance for UpdatePrometheusAlertGroup. + # @type request: :class:`Tencentcloud::monitor::V20180724::UpdatePrometheusAlertGroupRequest` + # @rtype: :class:`Tencentcloud::monitor::V20180724::UpdatePrometheusAlertGroupResponse` + def UpdatePrometheusAlertGroup(request) + body = send_request('UpdatePrometheusAlertGroup', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = UpdatePrometheusAlertGroupResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + + # 批量更新告警分组状态,将分组中全部告警规则更新为目标状态 + + # @param request: Request instance for UpdatePrometheusAlertGroupState. + # @type request: :class:`Tencentcloud::monitor::V20180724::UpdatePrometheusAlertGroupStateRequest` + # @rtype: :class:`Tencentcloud::monitor::V20180724::UpdatePrometheusAlertGroupStateResponse` + def UpdatePrometheusAlertGroupState(request) + body = send_request('UpdatePrometheusAlertGroupState', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = UpdatePrometheusAlertGroupStateResponse.new model.deserialize(response['Response']) model else code = response['Response']['Error']['Code'] message = response['Response']['Error']['Message'] \ No newline at end of file