startjava commented on issue #18095:
URL: https://github.com/apache/pulsar/issues/18095#issuecomment-1282522303
```
@RequestMapping("read")
public String read() throws IOException, PulsarAdminException {
List<String> tenantList = pulsarAdmin.tenants().getTenants();
if (tenantList.size() != 0) {
for (int i = 0; i < tenantList.size(); i++) {
String tenantName = tenantList.get(i);
System.out.println("tenantName:" + tenantName);
System.out.println("begin");
TenantInfo tenantInfo =
pulsarAdmin.tenants().getTenantInfo(tenantName);
System.out.println(" end");
{
Set<String> allowedClusters =
tenantInfo.getAllowedClusters();
Iterator<String> iterator = allowedClusters.iterator();
while (iterator.hasNext()) {
System.out.println(" allowedClusters:" +
iterator.next());
}
}
{
Set<String> adminRoles = tenantInfo.getAdminRoles();
Iterator<String> iterator = adminRoles.iterator();
while (iterator.hasNext()) {
System.out.println(" adminRoles:" +
iterator.next());
}
}
}
} else {
System.out.println("没有任何租户!");
}
return "read";
}
```
run result :
tenantName:ghy-tenant
begin
not print String "end" . beacuse tenant delete ... get tenantinfo exception.
--
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]