@@ -163,7 +163,7 @@ func CaptureBoomiDetails(endpoint string, timestamp string, pid int) {
163163
164164 ///// get atom connector details
165165 atomConnectorURL := "https://api.boomi.com/api/rest/v1/" + accountID + "/Connector/query"
166- atomConnectorRecord , err := fetchAtomConnectorDetails (boomiUserName , boomiPassword , atomConnectorURL )
166+ atomConnectorRecord , _ := fetchAtomConnectorDetails (boomiUserName , boomiPassword , atomConnectorURL )
167167
168168 //// download atom log
169169 downloadAtomLog (boomiUserName , boomiPassword , accountID )
@@ -185,7 +185,7 @@ func fetchBoomiExecutionRecords(boomiUserName, boomiPassword, boomiURL string) (
185185 resp , err := makeBoomiRequest (queryToken , boomiUserName , boomiPassword , boomiURL )
186186
187187 if err != nil {
188- return records , fmt .Errorf ("Failed to make Boomi request: %w" , err )
188+ return records , fmt .Errorf ("failed to make Boomi request: %w" , err )
189189 }
190190 logger .Log ("Response Status Code: %d" , resp .StatusCode ())
191191
@@ -199,7 +199,7 @@ func fetchBoomiExecutionRecords(boomiUserName, boomiPassword, boomiURL string) (
199199 var queryResult BoomiExecutionRecordQueryResult
200200 jsonErr := json .Unmarshal (resp .Body (), & queryResult )
201201 if jsonErr != nil {
202- return records , fmt .Errorf ("Error unmarshalling Boomi response as JSON: %w" , jsonErr )
202+ return records , fmt .Errorf ("error unmarshalling Boomi response as JSON: %w" , jsonErr )
203203 }
204204
205205 logger .Log ("Length of Boomi queryResult.Result->%d" , len (queryResult .Result ))
@@ -238,11 +238,7 @@ func fetchAtomConnectorDetails(boomiUserName, boomiPassword, boomiURL string) ([
238238 stopped := false
239239 queryToken := ""
240240 for {
241- resp , err := makeAtomConnectorsRequest (queryToken , boomiUserName , boomiPassword , boomiURL )
242-
243- if err != nil {
244- //return fmt.Errorf("Failed to make Boomi request: %w", err)
245- }
241+ resp , _ := makeAtomConnectorsRequest (queryToken , boomiUserName , boomiPassword , boomiURL )
246242 logger .Log ("Response Status Code: %d" , resp .StatusCode ())
247243
248244 // return if status code is not 200
@@ -255,7 +251,7 @@ func fetchAtomConnectorDetails(boomiUserName, boomiPassword, boomiURL string) ([
255251 var queryResult AtomConnectorRecordQueryResult
256252 jsonErr := json .Unmarshal (resp .Body (), & queryResult )
257253 if jsonErr != nil {
258- return records , fmt .Errorf ("Error unmarshalling Boomi response as JSON: %w" , jsonErr )
254+ return records , fmt .Errorf ("error unmarshalling Boomi response as JSON: %w" , jsonErr )
259255 }
260256 logger .Log ("Length of Boomi queryResult.Result->%d" , len (queryResult .Result ))
261257 if len (queryResult .Result ) <= 0 {
@@ -338,7 +334,7 @@ type BoomiExecutionOutput struct {
338334func (b * BoomiExecutionOutput ) CreateFile () (* os.File , error ) {
339335 file , err := os .Create ("boomi.out" )
340336 if err != nil {
341- return nil , fmt .Errorf ("Error while creating Boomi output file: %w" , err )
337+ return nil , fmt .Errorf ("error while creating Boomi output file: %w" , err )
342338 }
343339
344340 b .file = file
@@ -731,23 +727,6 @@ func getAtomQueryDetails(accountID string, username string, password string) Ato
731727 return atomQueryResult
732728}
733729
734- func getAtomConnectorDetails (accountID string , username string , password string ) {
735- // Create a new Resty client
736- client := resty .New ()
737- connectorURL := "https://api.boomi.com/api/rest/v1/" + accountID + "/Connector/query"
738- resp , err := client .R ().
739- SetBasicAuth (username , password ).
740- SetHeader (BoomiRequestAccept , BoomiRequestApplicationJSON ).
741- Post (connectorURL )
742-
743- if err != nil {
744- logger .Log ("error while calling atom connector details rest endpoint %s" , err .Error ())
745- }
746-
747- logger .Log ("atom connector result status code %d" , resp .StatusCode ())
748-
749- }
750-
751730// use the following URL to download the container id
752731// https://api.boomi.com/mdm/api/rest/v1/<account_id/clouds
753732// this will return a similar response like this
@@ -793,7 +772,7 @@ func downloadAtomLog(username, password, boomiAcctId string) {
793772 boomiURL := "https://api.boomi.com/api/rest/v1/" + boomiAcctId + "/AtomLog"
794773 logger .Log ("boomi atom log req string %s" , result .String ())
795774
796- resp , err := client .R ().
775+ resp , _ := client .R ().
797776 SetBasicAuth (username , password ).
798777 SetHeader (BoomiRequestContentType , BoomiRequestApplicationJSON ).
799778 SetBody (result .String ()).
@@ -884,83 +863,3 @@ func downloadAtomLog(username, password, boomiAcctId string) {
884863 }
885864
886865}
887-
888- // downloads the atom diskspace details from the Boomi server
889- func getAtomDiskSize (accountID string , atomId string , username string , password string , records []ExecutionRecord ) {
890-
891- uniqueData := make (map [string ]struct {})
892- // Create a slice to store unique values
893- var atomIDResult []string
894- // iterate through all the execution records and store the atom id
895- for _ , executionRecord := range records {
896- atomID := executionRecord .AtomID
897- if _ , exists := uniqueData [atomID ]; ! exists {
898- uniqueData [atomID ] = struct {}{} // Add to map
899- atomIDResult = append (atomIDResult , atomID ) // Add to slice
900- }
901- }
902-
903- logger .Log ("atomIDResult->%s" , atomIDResult )
904- // Create a new Resty client
905- client := resty .New ()
906-
907- /// iterate through iterate through the atomIDResult and download the atom diskspace information
908- var atomURL string
909- for _ , atmID := range atomIDResult {
910- atomURL = "https://api.boomi.com/api/rest/v1/" + accountID + "/async/AtomDiskSpace/"
911- resp , err := client .R ().
912- SetBasicAuth (username , password ).
913- SetHeader (BoomiRequestAccept , BoomiRequestApplicationJSON ).
914- SetBody (atmID ).
915- Post (atomURL )
916-
917- if err != nil {
918- logger .Log ("error while calling atom asycn rest endpoint %s" , err .Error ())
919- }
920-
921- logger .Log ("atom disk space status code %d" , resp .StatusCode ())
922- // return if status code is not 200
923- if resp .StatusCode () != 202 {
924- logger .Log ("Boomi API responded with non 202, aborting..." )
925- return
926- }
927-
928- // unmarshal the JSON response into the struct
929- var asyncToken AsyncToken
930- jsonErr := json .Unmarshal (resp .Body (), & asyncToken )
931- if jsonErr != nil {
932- return
933- }
934- logger .Log ("atom async response->%s" , jsonErr )
935-
936- /// now call the atom disk space rest endpoint
937- if asyncToken .Token != "" {
938- atomURL = "https://api.boomi.com/api/rest/v1/" + accountID + "/async/AtomDiskSpace/response/" + asyncToken .Token
939-
940- resp , err := client .R ().
941- SetBasicAuth (username , password ).
942- SetHeader (BoomiRequestAccept , BoomiRequestApplicationJSON ).
943- Get (atomURL )
944-
945- if err != nil {
946- logger .Log ("error while applying template with value %s" , err .Error ())
947- }
948-
949- // return if status code is not 200
950- if resp .StatusCode () != 200 {
951- logger .Log ("Boomi API responded with non 200, aborting..." )
952- return
953- }
954-
955- var asyncAtomDiskspaceTokenResult AsyncAtomDiskspaceTokenResult
956- jsonErr := json .Unmarshal (resp .Body (), & asyncAtomDiskspaceTokenResult )
957- if jsonErr != nil {
958- logger .Log ("error while unmarshalling response %s" , jsonErr .Error ())
959- return
960- }
961- logger .Log ("asyncAtomDiskspaceTokenResult %v" , asyncAtomDiskspaceTokenResult )
962- }
963-
964- }
965-
966- }
0 commit comments