From 7f036b349504cc9675c2e66ab4843c021c161eb7 Mon Sep 17 00:00:00 2001 From: "chao.he" Date: Wed, 17 Dec 2025 16:13:06 +0800 Subject: [PATCH] [plugin-premium]: GPU/VM page keeps loading when shutting down or encountering errors in Zaku cluster. Resolves: ZSTAC-80202 Change-Id: I7778676171646874706164777869707279776172 --- .../zql/BeforeApiCallExtensionPoint.java | 25 +++++++++++++++++ ...oreCallZWatchReturnWithExtensionPoint.java | 28 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 header/src/main/java/org/zstack/header/zql/BeforeApiCallExtensionPoint.java create mode 100644 header/src/main/java/org/zstack/header/zql/BeforeCallZWatchReturnWithExtensionPoint.java diff --git a/header/src/main/java/org/zstack/header/zql/BeforeApiCallExtensionPoint.java b/header/src/main/java/org/zstack/header/zql/BeforeApiCallExtensionPoint.java new file mode 100644 index 00000000000..52c39772ff3 --- /dev/null +++ b/header/src/main/java/org/zstack/header/zql/BeforeApiCallExtensionPoint.java @@ -0,0 +1,25 @@ +package org.zstack.header.zql; + +/** + * BeforeApiCallExtensionPoint is an extension point that allows plugins + * to perform custom operations before executing API calls. + * + * This provides a hook for business modules to execute pre-processing logic + * (such as health checks, validation, etc.) before API operations are performed. + */ +public interface BeforeApiCallExtensionPoint { + /** + * Check if this extension supports the given VO class + * @param voClass the VO class to check + * @return true if this extension supports the VO class, false otherwise + */ + boolean supports(Class voClass); + + /** + * Perform operations before executing API call. + * This allows business modules to trigger health checks or other pre-processing logic. + * + * @param voClass the VO class type + */ + void beforeApiCall(Class voClass); +} diff --git a/header/src/main/java/org/zstack/header/zql/BeforeCallZWatchReturnWithExtensionPoint.java b/header/src/main/java/org/zstack/header/zql/BeforeCallZWatchReturnWithExtensionPoint.java new file mode 100644 index 00000000000..a4023785b2f --- /dev/null +++ b/header/src/main/java/org/zstack/header/zql/BeforeCallZWatchReturnWithExtensionPoint.java @@ -0,0 +1,28 @@ +package org.zstack.header.zql; + +import java.util.List; + +/** + * BeforeCallZWatchReturnWithExtensionPoint is an extension point that allows plugins + * to perform custom operations before executing ZQL return with queries. + * + * This provides a hook for business modules to execute pre-processing logic + * (such as health checks, validation, etc.) before monitoring data is retrieved. + */ +public interface BeforeCallZWatchReturnWithExtensionPoint { + /** + * Check if this extension supports the given VO class + * @param voClass the VO class to check + * @return true if this extension supports the VO class, false otherwise + */ + boolean supports(Class voClass); + + /** + * Perform operations before executing ZQL return with query. + * This allows business modules to trigger health checks or other pre-processing logic. + * + * @param voClass the VO class type + * @param uuids the list of resource UUIDs to process + */ + void beforeCallZWatch(Class voClass, List uuids); +}