SUSE / salt-netapi-client

Java bindings for the Salt API
MIT License
85 stars 95 forks source link

how could I get salt_returns (mysql ) when I use salt-netapi-client run method #271

Closed zhuhaolin162 closed 5 years ago

zhuhaolin162 commented 5 years ago

mysql> select * from jids;

I use this method public CompletionStage<Map<String, Object>> run(String username, String password, AuthModule eauth, String client, Target target, String function, List args, Map<String, Object> kwargs) { Map<String, Object> props = new HashMap(); props.put("username", username); props.put("password", password); props.put("eauth", eauth.getValue()); props.put("client", client); props.putAll(target.getProps()); props.put("fun", function); props.put("arg", args); props.put("kwarg", kwargs); List<Map<String, Object>> list = Collections.singletonList(props); String payload = this.gson.toJson(list); CompletionStage<Map<String, Object>> result = this.asyncHttpClient.post(this.uri.resolve("run"), payload, JsonParser.RUN_RESULTS).thenApply((s) -> { return (Map)((List)s.getResult()).get(0); }); return result; }

mysql record | 20190417053250972304 | {"tgt_type": "ipcidr", "jid": "20190417053250972304", "tgt": "192.168.6.138", "cmd": "publish", "ret": "",

I found ret is "" , how could I set ret "mysql" by using java method run