fuweng11 commented on code in PR #11978:
URL: https://github.com/apache/inlong/pull/11978#discussion_r2327550178


##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/client/AuditClient.java:
##########
@@ -83,4 +85,92 @@ public Boolean refreshCache(AuditRequest request) {
         ClientUtils.assertRespSuccess(response);
         return response.getData();
     }
+
+    // Audit Alert Rule methods
+
+    /**
+     * Create an audit alert rule
+     *
+     * @param request The audit alert rule to create
+     * @return The created audit alert rule ID
+     */
+    public Integer createAlertRule(AuditAlertRuleRequest request) {

Review Comment:
   ```suggestion
       public Integer create(AuditAlertRuleRequest request) {
   ```



##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/client/AuditClient.java:
##########
@@ -83,4 +85,92 @@ public Boolean refreshCache(AuditRequest request) {
         ClientUtils.assertRespSuccess(response);
         return response.getData();
     }
+
+    // Audit Alert Rule methods
+
+    /**
+     * Create an audit alert rule
+     *
+     * @param request The audit alert rule to create
+     * @return The created audit alert rule ID
+     */
+    public Integer createAlertRule(AuditAlertRuleRequest request) {
+        Preconditions.expectNotNull(request, "audit alert rule request cannot 
be null");
+        Preconditions.expectNotBlank(request.getInlongGroupId(), 
ErrorCodeEnum.INVALID_PARAMETER,
+                "inlong group id cannot be empty");
+        Preconditions.expectNotBlank(request.getAuditId(), 
ErrorCodeEnum.INVALID_PARAMETER,
+                "audit id cannot be empty");
+        Preconditions.expectNotBlank(request.getAlertName(), 
ErrorCodeEnum.INVALID_PARAMETER,
+                "alert name cannot be empty");
+        Preconditions.expectNotNull(request.getCondition(), 
ErrorCodeEnum.INVALID_PARAMETER,
+                "condition cannot be null");
+        Response<Integer> response = 
ClientUtils.executeHttpCall(auditApi.createAlertRule(request));
+        ClientUtils.assertRespSuccess(response);
+        return response.getData();
+    }
+
+    /**
+     * Get an audit alert rule by ID
+     *
+     * @param id The rule ID
+     * @return The audit alert rule
+     */
+    public AuditAlertRule getAlertRule(Integer id) {

Review Comment:
   ```suggestion
       public AuditAlertRule get(Integer id) {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to