|
1 | 1 | package com.cisco.trex; |
2 | 2 |
|
| 3 | +import com.cisco.trex.model.GlobalConfig; |
3 | 4 | import com.cisco.trex.stateless.TRexCommand; |
4 | 5 | import com.cisco.trex.stateless.TRexTransport; |
5 | 6 | import com.cisco.trex.stateless.exception.TRexConnectionException; |
@@ -548,6 +549,29 @@ public SystemInfo getSystemInfo() { |
548 | 549 | return GSON.fromJson(getResultFromResponse(json), SystemInfo.class); |
549 | 550 | } |
550 | 551 |
|
| 552 | + /** |
| 553 | + * Get global configuration parameters |
| 554 | + * |
| 555 | + * @return GlobalConfig |
| 556 | + */ |
| 557 | + public TRexClientResult<GlobalConfig> getGlobalConfig(int portIdx) { |
| 558 | + Map<String, Object> payload = new HashMap<>(); |
| 559 | + return callMethod("get_global_cfg", null, GlobalConfig.class); |
| 560 | + } |
| 561 | + |
| 562 | + /** |
| 563 | + * Change global configuration parameter |
| 564 | + * |
| 565 | + * @param name parameter name |
| 566 | + * @param value parameter value in data types of dboule, boolean depending on the parameter type |
| 567 | + * @return StubResult |
| 568 | + */ |
| 569 | + public TRexClientResult<StubResult> setGlobalConfig(String name, Object value) { |
| 570 | + Map<String, Object> payload = new HashMap<>(); |
| 571 | + payload.put(name, value); |
| 572 | + return callMethod("set_global_cfg", payload, StubResult.class); |
| 573 | + } |
| 574 | + |
551 | 575 | protected Map<String, Object> createPayload(int portIndex) { |
552 | 576 | Map<String, Object> payload = new HashMap<>(); |
553 | 577 | payload.put(PORT_ID, portIndex); |
|
0 commit comments