archi-contribs / snow-import-plugin

Service Now import plugin
Other
14 stars 5 forks source link

pass objects from service now to Archi #3

Closed sandeeprattan2000 closed 4 years ago

sandeeprattan2000 commented 4 years ago

Hi Herve91,

Is there a step by step document on this which can Guide us how to pass the objects from Service Now to Archi. I saw "Read Me" document but that does-not instruct how to map. Any help here is much appreciated

herve91 commented 4 years ago

Hi,

I provided the configuration file "sample_snow-import_plugin_ini_file.ini" that is self documented. Did you have a chance to have a look at it ?

Best regards Hervé

sandeeprattan2000 commented 4 years ago

Thanks for your reply Herve 91 -

this is what I am using in the ini file ... I am able to connect to service now however I am not seeing anything in Archi ... I am attaching ini and error file below - any help here is much appreciated

+++++++Ini I am using +++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++

Generic Archi elements properties archi.elements..import_mode = create_or_update_only archi.elements..id = sys_id archi.elements..name = name archi.elements..documentation = short_description archi.elements..folder = sys_class_name archi.elements..property.date = ${date:dd/MM/yyyy HH:mm/ss} archi.elements..property.company = company#name archi.elements..property.oasis_created_by = sys_created_by archi.elements..property.oasis_created_on = sys_created_on archi.elements..property.oasis_updated_by = sys_updated_by archi.elements.*.property.oasis_updated_on = sys_updated_on

ApplicationComponents

archi.elements.cmdb_ci_appl.archi_class = "ApplicationComponent" archi.elements.cmdb_ci_appl.name = u_display_name

archi.elements.cmdb_ci_appl.folder = "TestFolder"

archi.elements.cmdb_ci_appl.filter = sys_class_name=cmdb_ci_appl

archi.elements.cmdb_ci_appl.property.nom = name

archi.elements.cmdb_ci_appl.property.code_application = u_code_appli

archi.elements.cmdb_ci_appl.property.environnement = used_for

archi.elements.cmdb_ci_appl.property.groupe_support = support_group#name

archi.elements.cmdb_ci_appl.property.client = company#name

+++++++archimate-import-servicenow +++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++ 2019-08-29 13:29:10 TRACE 1301:MyImporter - --> found field = sys_id 2019-08-29 13:29:10 DEBUG 108:MySortedProperties - property archi.elements.cmdb_ci_appl.name = u_display_name 2019-08-29 13:29:10 TRACE 1301:MyImporter - --> found field = u_display_name 2019-08-29 13:29:10 DEBUG 108:MySortedProperties - property archi.elements.cmdb_ci_appl.documentation not found (defaulting to short_description) 2019-08-29 13:29:10 TRACE 1301:MyImporter - --> found field = short_description 2019-08-29 13:29:10 DEBUG 108:MySortedProperties - property archi.elements.cmdb_ci_appl.folder not found (defaulting to sys_class_name) 2019-08-29 13:29:10 TRACE 1263:MyImporter - --> found field = sys_class_name 2019-08-29 13:29:10 DEBUG 108:MySortedProperties - property archi.elements.cmdb_ci_appl.importMode not found (defaulting to create_or_update_only) 2019-08-29 13:29:10 DEBUG 108:MySortedProperties - property company = company#name 2019-08-29 13:29:10 DEBUG 431:MyImporter - Found archi.elements..property.company = company#name 2019-08-29 13:29:10 TRACE 1296:MyImporter - --> found field = company (then field name in the reference link) 2019-08-29 13:29:10 DEBUG 108:MySortedProperties - property oasis_created_on = sys_created_on 2019-08-29 13:29:10 DEBUG 431:MyImporter - Found archi.elements..property.oasis_created_on = sys_created_on 2019-08-29 13:29:10 TRACE 1301:MyImporter - --> found field = sys_created_on 2019-08-29 13:29:10 DEBUG 108:MySortedProperties - property date = ${date:dd/MM/yyyy HH:mm/ss} 2019-08-29 13:29:10 DEBUG 431:MyImporter - Found archi.elements..property.date = ${date:dd/MM/yyyy HH:mm/ss} 2019-08-29 13:29:10 TRACE 1287:MyImporter - --> found variable = ${date:dd/MM/yyyy HH:mm/ss} 2019-08-29 13:29:10 DEBUG 108:MySortedProperties - property oasis_updated_by = sys_updated_by 2019-08-29 13:29:10 DEBUG 431:MyImporter - Found archi.elements..property.oasis_updated_by = sys_updated_by 2019-08-29 13:29:10 TRACE 1301:MyImporter - --> found field = sys_updated_by 2019-08-29 13:29:10 DEBUG 108:MySortedProperties - property oasis_updated_on = sys_updated_on 2019-08-29 13:29:10 DEBUG 431:MyImporter - Found archi.elements..property.oasis_updated_on = sys_updated_on 2019-08-29 13:29:10 TRACE 1301:MyImporter - --> found field = sys_updated_on 2019-08-29 13:29:10 DEBUG 108:MySortedProperties - property oasis_created_by = sys_created_by 2019-08-29 13:29:10 DEBUG 431:MyImporter - Found archi.elements..property.oasis_created_by = sys_created_by 2019-08-29 13:29:10 TRACE 1301:MyImporter - --> found field = sys_created_by 2019-08-29 13:29:10 DEBUG 108:MySortedProperties - property archi.elements.cmdb_ci_appl.filter not found (defaulting to ) 2019-08-29 13:29:10 DEBUG 466:MyImporter - Generated URL is https://xxxxxxxxx.service-now.com/api/now/table/cmdb_ci_appl?sysparm_limit=100000&sysparm_fields=operational_status,sys_id,u_display_name,short_description,sys_class_name,company,sys_created_on,sys_updated_by,sys_updated_on ,sys_created_by&sysparm_exclude_reference_link=false&sysparm_query=operational_status=1 2019-08-29 13:29:10 INFO 634:MyImporter - 0 elements have been modified: 0 created, 0 updated, 0 removed.

herve91 commented 4 years ago

In fact, the configuration file is a way to construct the web service URL and for each response, create (or update) an Archi element.

So what you can do to debug, is to manually connect to the web service URL generated by the proxy, and check what ServiceNow returns.

If it returns zero line, then the UrL is not correct and the configuration file must be updated to change the URL. You may also get an error message that my plugin may fail to catch ...

Please let me know ...

sandeeprattan2000 commented 4 years ago

In fact, the configuration file is a way to construct the web service URL and for each response, create (or update) an Archi element.

So what you can do to debug, is to manually connect to the web service URL generated by the proxy, and check what ServiceNow returns.

If it returns zero line, then the UrL is not correct and the configuration file must be updated to change the URL. You may also get an error message that my plugin may fail to catch ...

Please let me know ...

Thanks Herve -

I checked and I am getting the response from the URL is I manually connect through the browser. one this which I figured in the ini file is PROXY

My service now link does not need proxy authentications, so I left PROXY section of ini file commented , would that cause an issue ?

herve91 commented 4 years ago

No issue. The proxy information needs to be filled in if you've got a proxy only :-)