This is an automated email from the ASF dual-hosted git repository. xuehuilang pushed a commit to branch damonxue-patch-2 in repository https://gitbox.apache.org/repos/asf/shenyu-client-python.git
commit 4cb75dc7d2785cbc6137766eea0d1ae52b1391d0 Author: DamonXue <[email protected]> AuthorDate: Thu Jan 2 21:32:57 2025 +0800 add namespace_id param in the register_discovery_config api --- client/apache_shenyu_client/api.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/client/apache_shenyu_client/api.py b/client/apache_shenyu_client/api.py index 1f7de8f..d968188 100644 --- a/client/apache_shenyu_client/api.py +++ b/client/apache_shenyu_client/api.py @@ -281,13 +281,17 @@ class GatewayProxy(object): } register_flag = False for _url in self.register_discovery_config_suffix: - res = self._request(_url, json_data) - if not res: - continue - else: - print("[SUCCESS], register discovery config success, register data is:{}".format(str(json_data))) - register_flag = True - break + for _namespace in self.register_namespace_id: + if not _namespace: + continue + json_data["namespaceId"] = _namespace + res = self._request(_url, json_data) + if not res: + continue + else: + print("[SUCCESS], register discovery config success, register data is:{}".format(str(json_data))) + register_flag = True + break if not register_flag: print("[ERROR],register discovery config fail, app_name:{}, contextPath:{}".format(self.app_name, self.context_path))
