Skip to content

Commit 01781ef

Browse files
committed
API to set multiple global config parameters
Signed-off-by: Leo Ma <[email protected]>
1 parent 2aca01b commit 01781ef

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/main/java/com/cisco/trex/ClientBase.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ public TRexClientResult<GlobalConfig> getGlobalConfig(int portIdx) {
563563
* Change global configuration parameter
564564
*
565565
* @param name parameter name
566-
* @param value parameter value in data types of dboule, boolean depending on the parameter type
566+
* @param value parameter value in data types of double, boolean depending on the parameter type
567567
* @return StubResult
568568
*/
569569
public TRexClientResult<StubResult> setGlobalConfig(String name, Object value) {
@@ -572,6 +572,19 @@ public TRexClientResult<StubResult> setGlobalConfig(String name, Object value) {
572572
return callMethod("set_global_cfg", payload, StubResult.class);
573573
}
574574

575+
/**
576+
* Change single or multiple global configuration parameter(s)
577+
*
578+
* @param parameters a map contains parameter name and value pairs, parameter value is in data types of double,
579+
* boolean depending on the parameter type.
580+
* @return StubResult
581+
*/
582+
public TRexClientResult<StubResult> setGlobalConfig(Map<String, Object> parameters) {
583+
Map<String, Object> payload = new HashMap<>();
584+
parameters.forEach((key, value) -> payload.put(key, value));
585+
return callMethod("set_global_cfg", payload, StubResult.class);
586+
}
587+
575588
protected Map<String, Object> createPayload(int portIndex) {
576589
Map<String, Object> payload = new HashMap<>();
577590
payload.put(PORT_ID, portIndex);

0 commit comments

Comments
 (0)