@@ -71,7 +71,8 @@ var sendCmd = &cobra.Command{
7171 }
7272
7373 // show the data that was just loaded as input
74- log .Debug ().Any ("input" , inputData ).Send ()
74+ // inputRaw, _ := json.MarshalIndent(inputData, "", " ")
75+ log .Debug ().Int ("endpoint_count" , len (inputData )).Send ()
7576
7677 for _ , host := range args {
7778 var (
@@ -83,6 +84,7 @@ var sendCmd = &cobra.Command{
8384 for _ , dataObject := range inputData {
8485 // skip on to the next thing if it's does not exist
8586 if dataObject == nil {
87+ log .Warn ().Str ("host" , host ).Msg ("skipping request to host" )
8688 continue
8789 }
8890
@@ -93,16 +95,23 @@ var sendCmd = &cobra.Command{
9395
9496 host , err = urlx .Sanitize (host )
9597 if err != nil {
96- log .Warn ().Err (err ).Str ("host" , host ).Msg ("could not sanitize host" )
98+ log .Warn ().
99+ Err (err ).
100+ Str ("host" , host ).
101+ Msg ("could not sanitize host" )
97102 }
98103
99104 // convert to JSON to send data
100105 body , err = json .MarshalIndent (dataObject , "" , " " )
101106 if err != nil {
102- log .Error ().Err (err ).Msg ("failed to marshal request data" )
107+ log .Error ().
108+ Err (err ).
109+ Msg ("failed to marshal request data" )
103110 continue
104111 }
112+ log .Debug ().Str ("host" , host ).RawJSON ("data" , body ).Send ()
105113
114+ // make request to remote host
106115 err = smdClient .Add (body , headers )
107116 if err != nil {
108117 // try updating instead
@@ -112,12 +121,16 @@ var sendCmd = &cobra.Command{
112121 if err != nil {
113122 log .Error ().
114123 Err (err ).
115- Msgf ("failed to forcibly update Redfish endpoint with ID %s" , smdClient .Xname )
124+ Str ("host" , host ).
125+ Str ("ID" , smdClient .Xname ).
126+ Msgf ("failed to forcibly update Redfish endpoint" )
116127 }
117128 } else {
118129 log .Error ().
119130 Err (err ).
120- Msgf ("failed to add Redfish endpoint with ID %s" , smdClient .Xname )
131+ Str ("host" , host ).
132+ Str ("ID" , smdClient .Xname ).
133+ Msgf ("failed to add Redfish endpoint" )
121134 }
122135 }
123136 }
0 commit comments