jaykay12 commented on code in PR #4739:
URL: https://github.com/apache/solr/pull/4739#discussion_r4172610414
##########
solr/core/src/java/org/apache/solr/cli/PackageTool.java:
##########
@@ -381,6 +492,64 @@ public Options getOptions() {
@Override
public int callTool() throws Exception {
- throw new UnsupportedOperationException("This tool does not yet support
PicoCli");
+ String credentials = credentialsOptions.credentials;
+ String solrUrl = resolveSolrUrl(credentials);
+ String zkHost = resolveZkHost(solrUrl, credentials);
+ String[] args = cmdArgs == null ? new String[0] : cmdArgs;
+ PackageFlags packageFlags =
+ new PackageFlags(collections, cluster, param, update, collection,
noPrompt);
+ executePackage(solrUrl, zkHost, credentials, cmd, args, packageFlags);
+ return 0;
+ }
+
+ private String resolveSolrUrl(String credentials) throws Exception {
Review Comment:
Done for the package path - resolvers live on ConnectionOptions and are used
from runWithManagers.
Planning to pick up CreateTool.callTool() and DeleteTool.callTool() in a
follow-up PR?
##########
solr/core/src/java/org/apache/solr/cli/PackageTool.java:
##########
@@ -381,6 +492,64 @@ public Options getOptions() {
@Override
public int callTool() throws Exception {
- throw new UnsupportedOperationException("This tool does not yet support
PicoCli");
+ String credentials = credentialsOptions.credentials;
+ String solrUrl = resolveSolrUrl(credentials);
+ String zkHost = resolveZkHost(solrUrl, credentials);
+ String[] args = cmdArgs == null ? new String[0] : cmdArgs;
+ PackageFlags packageFlags =
+ new PackageFlags(collections, cluster, param, update, collection,
noPrompt);
+ executePackage(solrUrl, zkHost, credentials, cmd, args, packageFlags);
+ return 0;
+ }
+
+ private String resolveSolrUrl(String credentials) throws Exception {
Review Comment:
Done for the package path - resolvers live on ConnectionOptions and are used
from runWithManagers.
Planning to pick up CreateTool.callTool() and DeleteTool.callTool() in a
follow-up PR.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]