lib/topological_inventory/sync/inventory_upload/payload.rb
def create_application(sources_api, source, source_type, application_type_id)
          return if source.nil?

          logger.info("Creating Topological-Inventory Application")

          new_app = SourcesApiClient::Application.new(:application_type_id => application_type_id,
                                                      :source_id => source.id)
          app = sources_api.create_application(new_app)
          logger.info("Created Application for Source: Name [#{source.name}] UID [#{source.uid}] Type [#{source_type}]")

          app
        rescue SourcesApiClient::ApiError => e
          raise "Failed to create application for Source: Name [#{source.name}] UID [#{source.uid}] Type [#{source_type}]: #{e.response_body}"
        end
# Sources sync worker writes new source to topological db only if source is assigned to topological-inventory application
Sources sync worker writes new source to topological db only if source is assigned to topological-inventory application
Sources sync worker writes new source to topological db only if source is assigned to topological - inventory application
def create_application(sources_api, source, source_type, application_type_id)
          return if source.nil?
          logger.info("Creating Topological-Inventory Application")
          new_app = SourcesApiClient::Application.new(:application_type_id => application_type_id,
                                                      :source_id => source.id)
          app = sources_api.create_application(new_app)
          logger.info("Created Application for Source: Name [#{source.name}] UID [#{source.uid}] Type [#{source_type}]")
          app
        rescue SourcesApiClient::ApiError => e
          raise "Failed to create application for Source: Name [#{source.name}] UID [#{source.uid}] Type [#{source_type}]: #{e.response_body}"
        end
def create_application ( sources_api , source , source_type , application_type_id ) return if source . nil? logger . info ( "Creating Topological-Inventory Application" ) new_app = SourcesApiClient :: Application . new ( :application_type_id => application_type_id , :source_id => source . id ) app = sources_api . create_application ( new_app ) logger . info ( "Created Application for Source: Name [#{source.name}] UID [#{source.uid}] Type [#{source_type}]" ) app rescue SourcesApiClient :: ApiError => e raise "Failed to create application for Source: Name [#{source.name}] UID [#{source.uid}] Type [#{source_type}]: #{e.response_body}" end
Sources sync worker writes new source to topological db only if source is assigned to topological-inventory application
Sources sync worker writes new source to topological db only if source is assigned to topological - inventory application
sources_api
source
source_type
application_type_id