@@ -26,6 +26,20 @@ type ModuleConfig struct {
2626 Dependencies []ModuleDependency `json:"dependencies,omitempty"`
2727}
2828
29+ func printModuleConfig (moduleConfig ModuleConfig ) {
30+ fmt .Println ("ModuleConfig:" )
31+ fmt .Println (" ModuleId: " , moduleConfig .ModuleId )
32+ fmt .Println (" ModuleType: " , moduleConfig .ModuleType )
33+ fmt .Println (" Options:" )
34+ for _ , kv := range moduleConfig .Options {
35+ fmt .Println (" " , kv .Key , ": " , kv .Value )
36+ }
37+ fmt .Println (" Dependencies:" )
38+ for _ , dep := range moduleConfig .Dependencies {
39+ fmt .Println (" " , dep .ModuleId , ": " , dep .Type )
40+ }
41+ }
42+
2943func (moduleConfig * ModuleConfig ) LookupOptionOk (key string ) (string , bool ) {
3044
3145 moduleConfigOptions := moduleConfig .Options
@@ -94,9 +108,19 @@ func (smilecdr *Client) PutModuleConfig(ctx context.Context, nodeId string, modu
94108 var moduleId = module .ModuleId
95109
96110 var endpoint = fmt .Sprintf ("/module-config/%s/%s/set" , nodeId , moduleId )
97- jsonBody , _ := json .Marshal (module )
111+
112+ printModuleConfig (module ) // DEBUG
113+
114+ jsonBody , error := json .Marshal (module )
115+ if error != nil {
116+ fmt .Println ("error marshalling moduleConfig:" , error )
117+ return module , error
118+ }
119+
120+ fmt .Println ("PutModuleConfig: " , string (jsonBody ))
98121
99122 resp , putErr := smilecdr .Put (ctx , endpoint , jsonBody )
123+
100124 if putErr != nil {
101125 fmt .Println ("error during Put in PutModuleConfig:" , putErr )
102126 fmt .Println ("ResponseBody:" , string (resp ))
0 commit comments