File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -740,11 +740,21 @@ public Map log() throws IOException {
740740 return retrieveMap ("log/tail" );
741741 }
742742
743+ public Map config (String entry , Optional <String > value , Optional <Boolean > setBool ) throws IOException {
744+ String valArg = value .isPresent () ? "&arg=" + value .get () : "" ;
745+ String setBoolArg = setBool .isPresent () ? "&arg=" + setBool .get () : "" ;
746+ return retrieveMap ("config?arg=" + entry + valArg + setBoolArg );
747+ }
748+
743749 public class Config {
744750 public Map show () throws IOException {
745751 return (Map )retrieveAndParse ("config/show" );
746752 }
747753
754+ public Map profileApply (String profile , boolean dryRun ) throws IOException {
755+ return (Map )retrieveAndParse ("config/profile/apply?arg=" +profile + "&dry-run" + dryRun );
756+ }
757+
748758 public void replace (NamedStreamable file ) throws IOException {
749759 Multipart m = new Multipart (protocol +"://" + host + ":" + port + version +"config/replace?stream-channels=true" , "UTF-8" );
750760 m .addFilePart ("file" , Paths .get ("" ), file );
Original file line number Diff line number Diff line change @@ -761,6 +761,10 @@ public void diagTest() throws IOException {
761761// Object log = ipfs.log();
762762 String sys = ipfs .diag .sys ();
763763 String cmds = ipfs .diag .cmds ();
764+
765+ //String profile = "default";
766+ //ipfs.config.profileApply(profile, true);
767+ //Map entry = ipfs.config("Addresses.API", Optional.of("/ip4/127.0.0.1/tcp/5001"), Optional.empty());
764768 }
765769
766770 @ Test
You can’t perform that action at this time.
0 commit comments