This is an automated email from the ASF dual-hosted git repository.
liuhongyu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/shenyu-client-python.git
The following commit(s) were added to refs/heads/main by this push:
new 37193e9 add namespace_id param in the register_discovery_config api
(#26)
37193e9 is described below
commit 37193e9c8c122ad12b715f7cd4b12c4331aa2d0b
Author: DamonXue <[email protected]>
AuthorDate: Thu Jan 2 21:44:14 2025 +0800
add namespace_id param in the register_discovery_config api (#26)
---
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))