diff --git a/README.md b/README.md index 1c6c981..b405db1 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ When ran, the plugin asks for an INI file that contains all the required options - Mapping between the ServiceNow relations and the Archi relations - ... -You may download the *sample_servicenow_ini_file.ini* file to your local drive (like "My documents") and update it to your needs. The file is self documented. +You may download the *sample_snow-import_plugin_ini_file.ini* file to your local drive (like "My documents") and update it to your needs. The file is self documented. The plugin generates the REST request and connects to the ServiceNow web services to download and parse the data. The request is optimised to reduce the quantity of data downloaded (only the fields described in the ini file are downloaded). diff --git a/org.archicontribs.servicenow/META-INF/MANIFEST.MF b/org.archicontribs.servicenow/META-INF/MANIFEST.MF index 53df001..9538948 100644 --- a/org.archicontribs.servicenow/META-INF/MANIFEST.MF +++ b/org.archicontribs.servicenow/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Automatic-Module-Name: org.archicontribs.servicenow Bundle-ManifestVersion: 2 Bundle-Name: Plugin to import from ServiceNow (Oasis) Bundle-SymbolicName: org.archicontribs.servicenow;singleton:=true -Bundle-Version: 1.3 +Bundle-Version: 1.5 Bundle-Vendor: Hervé JOUIN Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/org.archicontribs.servicenow/src/org/archicontribs/servicenow/MyImporter.java b/org.archicontribs.servicenow/src/org/archicontribs/servicenow/MyImporter.java index 9d3455c..dd7236e 100644 --- a/org.archicontribs.servicenow/src/org/archicontribs/servicenow/MyImporter.java +++ b/org.archicontribs.servicenow/src/org/archicontribs/servicenow/MyImporter.java @@ -86,15 +86,27 @@ * Can now follow reference links in in properties (with a cache mechanism to reduce the calls to ServiceNow) * Can now use variables ${xxx} in ini properties * Use CIs operational status to determine if Archi elements should be created/updated or removed - * Allow to specify the import mode: full, create_only, update_only, create_or_update_only and remove_only + * Allow to specify the import mode: full, create_only, update_only, create_or_update_only and remove_only + * + * version 1.4: 26/09/2018 + * continue in case we cannot follow a link + * + * version 1.5: 26/10/2018 + * add "filter" option * * TODO: retrieve the applications and business services * TODO: use commands to allow rollback * TODO: validate that relations are permitted before creating them + * TODO: add an option to continue in case of error --> but count the number of errors and show this counter on the summary popup + * TODO: transform progressbar window: show all tables/relationships with one progress bar in front of each table/relationship + * TODO: transform progressbar window: show same look and feel that database plugin + * TOTO: add cancel button + * TODO: add variable ${on_error:xxxxxxx) ou ${on_empty:xxxxx} + * */ public class MyImporter implements ISelectedModelImporter { - static String SNowPluginVersion = "1.3"; + static String SNowPluginVersion = "1.5"; static String title = "ServiceNow import plugin v" + SNowPluginVersion; Logger logger; @@ -135,6 +147,7 @@ public void doImport(IArchimateModel model) throws IOException { String generalArchiElementsName = null; String generalArchiElementsDocumentation = null; String generalArchiElementsFolder = null; + String generalArchiElementsFilter = null; String generalArchiElementsImportMode = null; // general relations properties @@ -244,6 +257,7 @@ public void doImport(IArchimateModel model) throws IOException { generalArchiElementsName = this.iniProperties.getString("archi.elements.*.name", "sys_class_name"); generalArchiElementsDocumentation = this.iniProperties.getString("archi.elements.*.documentation", "short_description"); generalArchiElementsFolder = this.iniProperties.getString("archi.elements.*.folder", "sys_class_name"); + generalArchiElementsFilter = this.iniProperties.getString("archi.elements.*.filter", ""); generalArchiElementsImportMode = this.iniProperties.getString("archi.elements.*.import_mode", "full"); if ( !generalArchiElementsImportMode.equals("full") && !generalArchiElementsImportMode.equals("create_or_update_only") && !generalArchiElementsImportMode.equals("create_only") && !generalArchiElementsImportMode.equals("update_only") && !generalArchiElementsImportMode.equals("remove_only") ) { @SuppressWarnings("unused") @@ -382,7 +396,7 @@ public void doImport(IArchimateModel model) throws IOException { urlBuilder.append(","); urlBuilder.append(field); } - + String archiElementsImportMode = this.iniProperties.getString("archi.elements."+tableName+".importMode", generalArchiElementsImportMode); if ( !archiElementsImportMode.equals("full") && !archiElementsImportMode.equals("create_or_update_only") && !archiElementsImportMode.equals("create_only") && !archiElementsImportMode.equals("update_only") && !generalArchiElementsImportMode.equals("remove_only") ) { @SuppressWarnings("unused") @@ -431,11 +445,24 @@ public void doImport(IArchimateModel model) throws IOException { // operational_status = 1 if create or update only // operational_status = 2 if remove_only // and no filter if create, update and remove + StringBuilder sysparmQuery = new StringBuilder(); if ( generalArchiElementsImportMode.equals("create_or_update_only") || generalArchiElementsImportMode.equals("create_only") || generalArchiElementsImportMode.equals("update_only") ) - urlBuilder.append("&sysparm_query=operational_status="+this.OPERATIONAL); + sysparmQuery.append("operational_status="+this.OPERATIONAL); else if ( generalArchiElementsImportMode.equals("remove_only") ) - urlBuilder.append("&sysparm_query=operational_status="+this.NON_OPERATIONAL); - + sysparmQuery.append("operational_status="+this.NON_OPERATIONAL); + + String archiElementsFilter = this.iniProperties.getString("archi.elements."+tableName+".filter", generalArchiElementsFilter); + if ( archiElementsFilter.length() != 0 ) { + if ( sysparmQuery.length() != 0 ) + sysparmQuery.append(","); + sysparmQuery.append(archiElementsFilter); + } + + if ( sysparmQuery.length() != 0 ) { + urlBuilder.append("&sysparm_query="); + urlBuilder.append(sysparmQuery); + } + this.logger.debug(" Generated URL is " + urlBuilder.toString()); // we invoke the ServiceNow web service @@ -1162,17 +1189,25 @@ private String getJsonField(JsonNode node, String fieldName, String defaultValue else { // we invoke the ServiceNow web service this.logger.trace(" Following reference link to URL "+linkURL); - MyConnection connection = new MyConnection(this.proxyHost, this.proxyPort, this.proxyUser, this.proxyPassword); - connection.setLogger(this.logger); - String linkContent = connection.get(subFields[column], linkURL, this.serviceNowUser, this.serviceNowPassword); - JsonFactory jsonFactory = new MappingJsonFactory(); - try ( JsonParser jsonParser = jsonFactory.createJsonParser(linkContent) ) { - jsonNode = jsonParser.readValueAsTree().get("result"); - this.referenceLinkCache.put(linkURL, jsonNode); - } catch (JsonParseException err) { - this.logger.error("Failed to parse JSON got from ServiceNow.", err); - jsonNode = null; - break; + try { + MyConnection connection = new MyConnection(this.proxyHost, this.proxyPort, this.proxyUser, this.proxyPassword); + connection.setLogger(this.logger); + String linkContent = connection.get(subFields[column], linkURL, this.serviceNowUser, this.serviceNowPassword); + JsonFactory jsonFactory = new MappingJsonFactory(); + try ( JsonParser jsonParser = jsonFactory.createJsonParser(linkContent) ) { + jsonNode = jsonParser.readValueAsTree().get("result"); + this.referenceLinkCache.put(linkURL, jsonNode); + } catch (JsonParseException err) { + this.logger.error("Failed to parse JSON got from ServiceNow.", err); + jsonNode = null; + //TODO: ++error_count; + break; + } + } catch (MyException | IOException err2) { + this.logger.error("Failed to get URL from ServiceNow.", err2); + jsonNode = null; + //TODO: ++error_count; + break; } } } diff --git a/org.archicontribs.servicenow_1.3.jar b/org.archicontribs.servicenow_1.5.jar similarity index 99% rename from org.archicontribs.servicenow_1.3.jar rename to org.archicontribs.servicenow_1.5.jar index bad565e..91f1d1b 100644 Binary files a/org.archicontribs.servicenow_1.3.jar and b/org.archicontribs.servicenow_1.5.jar differ diff --git a/release_note.md b/release_note.md index c6ae1c9..032c721 100644 --- a/release_note.md +++ b/release_note.md @@ -1,3 +1,9 @@ +### v1.5: 16/10/2018 +* add "filter" option in ini file + +### v1.4: 26/09/2018 +* continue to process ServiceNow data in case a link cannot be followed + ### v1.3: 16/09/2018 * make the progress bar application modal * rewrite progress bar to be more readable on 4K displays diff --git a/sample_servicenow_ini_file.ini b/sample_servicenow_ini_file.ini deleted file mode 100644 index 84d20c9..0000000 --- a/sample_servicenow_ini_file.ini +++ /dev/null @@ -1,530 +0,0 @@ -# -# Servicenow.ini -# -# Author : Herve Jouin -# -# This property file is used by the org.archicontribs.servicenow plugin -# -# https://github.com/archi-contribs/snow-import-plugin -# -# /!\ Please be carrefull, this file is case sensitive -# -SNowPlugin.version = 1.3 - - ## - ## logfile properties - ## ------------------ - ## Used to manage the log file. All the Log4J properties may be used. - ## -log4j.rootLogger = ALL, SNowPlugin - -log4j.appender.SNowPlugin = org.apache.log4j.FileAppender -log4j.appender.SNowPlugin.ImmediateFlush = true -log4j.appender.SNowPlugin.Append = false -log4j.appender.SNowPlugin.encoding = UTF-8 -log4j.appender.SNowPlugin.File = D:\\archimate-import_servicenow.log -log4j.appender.SNowPlugin.layout = org.apache.log4j.PatternLayout -log4j.appender.SNowPlugin.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %4L:%-20.20C{1} %m%n - - ## - ## Proxy properties - ## ---------------- - ## Used to send the http requests through a proxy. - ## http.proxyHost = name or ip specifies the name or ip of the proxy - ## http.proxyPort = port specifies the tcp port of the proxy - ## http.proxyUser = username specifies the credentials to send to the proxy - ## http.proxyPassword = password - ## -#http.proxyHost = -#http.proxyPort = -#http.proxyUser = -#http.proxyPassword = - - ## - ## ServiceNow properties - ## --------------------- - ## Used to specify how to retrieve data from theServiceNow website. - ## servicenow.site = URL specifies the URL of ServiceNow web site - ## servicenow.user = username specifies the credentials to send to ServiceNow - ## servicenow.pass = password - ## servicenow.sysparm_limit = nb specifies the maximum number of CIs to retrieve - ## if not specified or if zero, then ServiceNow automatically limits to 10.000 objects - ## -servicenow.site = https://mousquetaires.service-now.com -servicenow.user = hjouin -servicenow.pass = kXpisiPY -servicenow.sysparm_limit = 250 - - ## - ## Archi elements properties - ## ------------------------- - ## Used to map ServiceNow CIs to Archi elements - ## - ## The following properties allow to specify how CIs properties will be mapped to Archi properties. - ## +------------------+---------+----------------------------------------------------------------------------------------------------+-------------------+ - ## | property name | Type | Description | Default value | - ## +==================+=========+====================================================================================================+===================+ - ## | archi_class | string | Class of the Archi objects. | n/a | - ## +------------------+---------+----------------------------------------------------------------------------------------------------+-------------------+ - ## | | | Import behavior of the plugin: | | - ## | | | - full : create, update and remove elements depending of the operational_status | | - ## | import_mode | string | - create_only : create new elements when operational status = 1 but do not update existing ones | full | - ## | | | - update_only : update existing elements when operational status = 1 but do not create new ones | | - ## | | | - create_or_update_only : create or update components but do not remove the non operational | | - ## | | | - remove_only : remove elements when operational_status = 2 but do not create or update elements | | - ## +------------------+---------+----------------------------------------------------------------------------------------------------+-------------------+ - ## | id | string | Id of the Archi objects. | sys_id | - ## +------------------+---------+----------------------------------------------------------------------------------------------------+-------------------+ - ## | name | string | Name of the Archi objects. | sys_class_name | - ## +------------------+---------+----------------------------------------------------------------------------------------------------+-------------------+ - ## | documentation | string | Documentation of the Archi objects. | short_description | - ## +------------------+---------+----------------------------------------------------------------------------------------------------+-------------------+ - ## | folder | string | Folder where the Archi object should be created. | sys_class_name | - ## +------------------+---------+----------------------------------------------------------------------------------------------------+-------------------+ - ## | property.xxxxx | string | Property to add or replace in the Archi objects. | n/a | - ## +------------------+---------+----------------------------------------------------------------------------------------------------+-------------------+ - ## - ## They all begin with the "archi.elements.." prefix where "" may be: - ## - any ServiceNow table name - ## - the wildcard char (*) to specify a default value for all ServiceNow tables - ## - ## The property values may be: - ## - a value without quotes to represent a ServiceNow table column, like sys_id. - ## - a set of values without quotes, separated by a hash to follow ServiceNow links, like processor#processor_mapping#pvus_per_core. - ## - a value between quotes to represent a constant string, like "this is a constant string". - ## - a value starting with a dollar sign and inside parentheses to represent a calculated variable, like ${date:dd/MM/yyyy HH:mm:ss}. - ## - a list of values separated by slashes to represent a path, like "Serveurs"/os/"Hosts". - ## - ## The list of currently managed variables are: - ## - ${date:format} the current date and time under the specified fotmat (the format is mandatory) - ## - ${id} the ID of the element that has just been created ot that is being updated - ## - ${name} the name of the element that has just been created ot that is being updated - ## - ${description} the description of the element that has just been created ot that is being updated - ## - ${property:xxx} the value of the property xxx of the element that has just been created ot that is being updated - ## - ${model:id} the ID of the model - ## - ${model:name} the name of the model - ## - ${model:purpose} the purpose of the model - ## - ${model:property:xxx} the value of the property xxx of the model - ## - ## Please note that the variables retrieving information on the element, are valid only once the element has been created, or once the element to update has been found. - ## Therefore they cannot be used on the "archi.elements..import_mode" nor "archi.elements..id" properties. - ## - ## Like ServiceNow, Archi manages elements using internal IDs. When the plugin maps a ServiceNow CI to an Archi element: - ## - either an element with the same ID exists and it is updated with the new values from ServiceNow, - ## - either no element with the same ID exists, and a new one is created. - ## - - -## -## 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.*.company = company#name -archi.elements.*.oasis_created_by = sys_created_by -archi.elements.*.oasis_created_on = sys_created_on -archi.elements.*.oasis_updated_by = sys_updated_by -archi.elements.*.oasis_updated_on = sys_updated_on - - ## mapping between ServiceNow CI and Archi elements - - ## Locations -archi.elements.cmdb_ci_computer_room.archi_class = "Location" -archi.elements.cmdb_ci_computer_room.folder = "Salles informatiques" -archi.elements.cmdb_ci_computer_room.property.hosting = u_hosting - -archi.elements.cmdb_ci_datacenter.archi_class = "Location" -archi.elements.cmdb_ci_datacenter.folder = "Sites" -archi.elements.cmdb_ci_datacenter.property.hosting = u_hosting - -archi.elements.cmdb_ci_zone.archi_class = "Location" -archi.elements.cmdb_ci_zone.folder = "Zones" -archi.elements.cmdb_ci_zone.property.hosting = u_hosting - - ## Servers -archi.elements.cmdb_ci_mainframe.archi_class = "Node" -archi.elements.cmdb_ci_mainframe.folder = "Serveurs"/"Mainframe" - -archi.elements.cmdb_ci_esx_server.archi_class = "Device" -archi.elements.cmdb_ci_esx_server.folder = "Serveurs"/"ESX" -archi.elements.cmdb_ci_esx_server.property.cores = cpu_count -archi.elements.cmdb_ci_esx_server.property.cpu_type = cpu_type -archi.elements.cmdb_ci_esx_server.property.os = os -archi.elements.cmdb_ci_esx_server.property.ram = Ram -archi.elements.cmdb_ci_esx_server.property.env = u_fonction -archi.elements.cmdb_ci_esx_server.property.chassis_type = chassis_type -archi.elements.cmdb_ci_esx_server.property.status = hardware_status - -archi.elements.cmdb_ci_vcenter_cluster.archi_class = "Node" -archi.elements.cmdb_ci_vcenter_cluster.folder = "Serveurs"/"ESX"/"Clusters" - -archi.elements.cmdb_ci_vcenter_server_obj.archi_class = "Node" -archi.elements.cmdb_ci_vcenter_server_obj.folder = "Serveurs"/"ESX"/"Vcenter" - -archi.elements.cmdb_ci_aix_server.archi_class = "Node" -archi.elements.cmdb_ci_aix_server.folder = "Serveurs"/AIX"/os -archi.elements.cmdb_ci_aix_server.property.processor = processor#display_name -archi.elements.cmdb_ci_aix_server.property.pvus_per_core = processor#processor_mapping#pvus_per_core - -archi.elements.u_cmdb_ci_lpar_server.archi_class = "Device" -archi.elements.u_cmdb_ci_lpar_server.folder = "Serveurs"/"AIX"/os/"LPAR" -archi.elements.u_cmdb_ci_lpar_server.property.cores = cpu_count -archi.elements.u_cmdb_ci_lpar_server.property.cpu_type = cpu_type -archi.elements.u_cmdb_ci_lpar_server.property.os = os -archi.elements.u_cmdb_ci_lpar_server.property.ram = Ram -archi.elements.u_cmdb_ci_lpar_server.property.env = u_fonction -archi.elements.u_cmdb_ci_lpar_server.property.chassis_type = chassis_type -archi.elements.u_cmdb_ci_lpar_server.property.status = hardware_status - -archi.elements.cmdb_ci_linux_server.archi_class = "Device" -archi.elements.cmdb_ci_linux_server.folder = "Serveurs"/"Linux"/os -archi.elements.cmdb_ci_linux_server.property.cores = cpu_count -archi.elements.cmdb_ci_linux_server.property.cpu_type = cpu_type -archi.elements.cmdb_ci_linux_server.property.os = os -archi.elements.cmdb_ci_linux_server.property.ram = Ram -archi.elements.cmdb_ci_linux_server.property.env = u_fonction -archi.elements.cmdb_ci_linux_server.property.chassis_type = chassis_type -archi.elements.cmdb_ci_linux_server.property.status = hardware_status - -archi.elements.cmdb_ci_linux_host.archi_class = "Device" -archi.elements.cmdb_ci_linux_host.folder = "Serveurs"/"Linux"/os/"Hosts" -archi.elements.cmdb_ci_linux_host.property.cores = cpu_count -archi.elements.cmdb_ci_linux_host.property.cpu_type = cpu_type -archi.elements.cmdb_ci_linux_host.property.os = os -archi.elements.cmdb_ci_linux_host.property.ram = Ram -archi.elements.cmdb_ci_linux_host.property.env = u_fonction -archi.elements.cmdb_ci_linux_host.property.chassis_type = chassis_type -archi.elements.cmdb_ci_linux_host.property.status = hardware_status - -archi.elements.cmdb_ci_win_server.archi_class = "Device" -archi.elements.cmdb_ci_win_server.folder = "Serveurs"/"Windows"/os -archi.elements.cmdb_ci_win_server.property.cores = cpu_count -archi.elements.cmdb_ci_win_server.property.cpu_type = cpu_type -archi.elements.cmdb_ci_win_server.property.os = os -archi.elements.cmdb_ci_win_server.property.ram = Ram -archi.elements.cmdb_ci_win_server.property.env = u_fonction -archi.elements.cmdb_ci_win_server.property.chassis_type = chassis_type -archi.elements.cmdb_ci_win_server.property.status = hardware_status - -archi.elements.u_cmdb_ci_as400_server.archi_class = "Device" -archi.elements.u_cmdb_ci_as400_server.folder = "Serveurs"/"AS 400" -archi.elements.u_cmdb_ci_as400_server.property.cores = cpu_count -archi.elements.u_cmdb_ci_as400_server.property.cpu_type = cpu_type -archi.elements.u_cmdb_ci_as400_server.property.os = os -archi.elements.u_cmdb_ci_as400_server.property.ram = Ram -archi.elements.u_cmdb_ci_as400_server.property.env = u_fonction -archi.elements.u_cmdb_ci_as400_server.property.chassis_type = chassis_type -archi.elements.u_cmdb_ci_as400_server.property.status = hardware_status - -archi.elements.u_cmdb_ci_teradata_server.archi_class = "Device" -archi.elements.u_cmdb_ci_teradata_server.folder = "Serveurs"/"Teradata" -archi.elements.u_cmdb_ci_teradata_server.property.cores = cpu_count -archi.elements.u_cmdb_ci_teradata_server.property.cpu_type = cpu_type -archi.elements.u_cmdb_ci_teradata_server.property.os = os -archi.elements.u_cmdb_ci_teradata_server.property.ram = Ram -archi.elements.u_cmdb_ci_teradata_server.property.env = u_fonction -archi.elements.u_cmdb_ci_teradata_server.property.chassis_type = chassis_type -archi.elements.u_cmdb_ci_teradata_server.property.status = hardware_status - - ## SystemSoftware -archi.elements.cmdb_ci_app_server_domino.archi_class = "SystemSoftware" -archi.elements.cmdb_ci_app_server_domino.folder = "Logiciels"/"Domino" -archi.elements.cmdb_ci_app_server_domino.property.env = u_fonction -archi.elements.cmdb_ci_app_server_domino.property.tcp_port = tcp_port - -archi.elements.cmdb_ci_app_server_tomcat.archi_class = "SystemSoftware" -archi.elements.cmdb_ci_app_server_tomcat.folder = "Logiciels"/"Tomcat" -archi.elements.cmdb_ci_app_server_tomcat.property.env = u_fonction -archi.elements.cmdb_ci_app_server_tomcat.property.tcp_port = tcp_port - -archi.elements.cmdb_ci_app_server_websphere.archi_class = "SystemSoftware" -archi.elements.cmdb_ci_app_server_websphere.folder = "Logiciels"/"Websphere" -archi.elements.cmdb_ci_app_server_websphere.property.env = u_fonction -archi.elements.cmdb_ci_app_server_websphere.property.tcp_port = tcp_port - -archi.elements.cmdb_ci_application_software.archi_class = "SystemSoftware" -archi.elements.cmdb_ci_application_software.folder = "Logiciels"/"Application Softwares" -archi.elements.cmdb_ci_application_software.property.env = u_fonction -archi.elements.cmdb_ci_application_software.property.tcp_port = tcp_port - -archi.elements.cmdb_ci_db_db2_catalog.archi_class = "SystemSoftware" -archi.elements.cmdb_ci_db_db2_catalog.folder = "Logiciels"/"DB2"/"Catalog" -archi.elements.cmdb_ci_db_db2_catalog.property.env = u_fonction -archi.elements.cmdb_ci_db_db2_catalog.property.tcp_port = tcp_port - -archi.elements.cmdb_ci_db_db2_instance.archi_class = "SystemSoftware" -archi.elements.cmdb_ci_db_db2_instance.folder = "Logiciels"/"DB2"/"Instance" -archi.elements.cmdb_ci_db_db2_instance.property.env = u_fonction -archi.elements.cmdb_ci_db_db2_instance.property.tcp_port = tcp_port - -archi.elements.cmdb_ci_db_mssql_catalog.archi_class = "SystemSoftware" -archi.elements.cmdb_ci_db_mssql_catalog.folder = "Logiciels"/"MS SQL"/"Catalog" -archi.elements.cmdb_ci_db_mssql_catalog.property.env = u_fonction -archi.elements.cmdb_ci_db_mssql_catalog.property.tcp_port = tcp_port - -archi.elements.cmdb_ci_db_mssql_instance.archi_class = "SystemSoftware" -archi.elements.cmdb_ci_db_mssql_instance.folder = "Logiciels"/"MS SQL"/"Instance" -archi.elements.cmdb_ci_db_mssql_instance.property.env = u_fonction -archi.elements.cmdb_ci_db_mssql_instance.property.tcp_port = tcp_port - -archi.elements.cmdb_ci_db_mysql_catalog.archi_class = "SystemSoftware" -archi.elements.cmdb_ci_db_mysql_catalog.folder = "Logiciels"/"MySQL"/"Catalog" -archi.elements.cmdb_ci_db_mysql_catalog.property.env = u_fonction -archi.elements.cmdb_ci_db_mysql_catalog.property.tcp_port = tcp_port - -archi.elements.cmdb_ci_db_mysql_instance.archi_class = "SystemSoftware" -archi.elements.cmdb_ci_db_mysql_instance.folder = "Logiciels"/"MySQL"/"Instance" -archi.elements.cmdb_ci_db_mysql_instance.property.env = u_fonction -archi.elements.cmdb_ci_db_mysql_instance.property.tcp_port = tcp_port - -archi.elements.cmdb_ci_database.archi_class = "SystemSoftware" -archi.elements.cmdb_ci_database.folder = "Logiciels"/"Database" -archi.elements.cmdb_ci_database.property.env = u_fonction -archi.elements.cmdb_ci_database.property.tcp_port = tcp_port - -archi.elements.u_cmdb_ci_db_datacom_catalog.archi_class = "SystemSoftware" -archi.elements.u_cmdb_ci_db_datacom_catalog.folder = "Logiciels"/"Datacom"/"Catalog" -archi.elements.u_cmdb_ci_db_datacom_catalog.property.env = u_fonction -archi.elements.u_cmdb_ci_db_datacom_catalog.property.tcp_port = tcp_port - -archi.elements.u_cmdb_ci_db_datacom_instance.archi_class = "SystemSoftware" -archi.elements.u_cmdb_ci_db_datacom_instance.folder = "Logiciels"/"Datacom"/"Instance" -archi.elements.u_cmdb_ci_db_datacom_instance.property.env = u_fonction -archi.elements.u_cmdb_ci_db_datacom_instance.property.tcp_port = tcp_port - -archi.elements.cmdb_ci_db_ora_catalog.archi_class = "SystemSoftware" -archi.elements.cmdb_ci_db_ora_catalog.folder = "Logiciels"/"Oracle"/"Catalog" -archi.elements.cmdb_ci_db_ora_catalog.property.env = u_fonction -archi.elements.cmdb_ci_db_ora_catalog.property.tcp_port = tcp_port - -archi.elements.cmdb_ci_db_ora_instance.archi_class = "SystemSoftware" -archi.elements.cmdb_ci_db_ora_instance.folder = "Logiciels"/"Oracle"/"Instance" -archi.elements.cmdb_ci_db_ora_instance.property.env = u_fonction -archi.elements.cmdb_ci_db_ora_instance.property.tcp_port = tcp_port - -archi.elements.u_cmdb_ci_db_oracle_schema.archi_class = "SystemSoftware" -archi.elements.u_cmdb_ci_db_oracle_schema.folder = "Logiciels"/"Oracle"/"Schema" -archi.elements.u_cmdb_ci_db_oracle_schema.property.env = u_fonction -archi.elements.u_cmdb_ci_db_oracle_schema.property.tcp_port = tcp_port - -archi.elements.cmdb_ci_vcenter.archi_class = "SystemSoftware" -archi.elements.cmdb_ci_vcenter.folder = "Logiciels"/"ESX"/"Vcenter" -archi.elements.cmdb_ci_vcenter.property.env = u_fonction -archi.elements.cmdb_ci_vcenter.property.tcp_port = tcp_port - -archi.elements.cmdb_ci_web_server.archi_class = "SystemSoftware" -archi.elements.cmdb_ci_web_server.folder = "Logiciels"/"Web servers" -archi.elements.cmdb_ci_web_server.property.env = u_fonction -archi.elements.cmdb_ci_web_server.property.tcp_port = tcp_port - -archi.elements.u_cmdb_ci_app_server_etl.archi_class = "SystemSoftware" -archi.elements.u_cmdb_ci_app_server_etl.folder = "Logiciels"/"ETL" -archi.elements.u_cmdb_ci_app_server_etl.property.env = u_fonction -archi.elements.u_cmdb_ci_app_server_etl.property.tcp_port = tcp_port - -archi.elements.u_cmdb_ci_app_server_mq_series.archi_class = "SystemSoftware" -archi.elements.u_cmdb_ci_app_server_mq_series.folder = "Logiciels"/"MQ Series" -archi.elements.u_cmdb_ci_app_server_mq_series.property.env = u_fonction -archi.elements.u_cmdb_ci_app_server_mq_series.property.tcp_port= tcp_port - -archi.elements.u_cmdb_ci_db_postgre_sql_catal.archi_class = "SystemSoftware" -archi.elements.u_cmdb_ci_db_postgre_sql_catal.folder = "Logiciels"/"PostGreSQL"/"Catalog" -archi.elements.u_cmdb_ci_db_postgre_sql_catal.property.env = u_fonction -archi.elements.u_cmdb_ci_db_postgre_sql_catal.property.tcp_port= tcp_port - -archi.elements.u_cmdb_ci_db_teradata_catalog.archi_class = "SystemSoftware" -archi.elements.u_cmdb_ci_db_teradata_catalog.folder = "Logiciels"/"Teradata"/"Catalog" -archi.elements.u_cmdb_ci_db_teradata_catalog.property.env = u_fonction -archi.elements.u_cmdb_ci_db_teradata_catalog.property.tcp_port = tcp_port - -archi.elements.u_cmdb_ci_db_teradata_instance.archi_class = "SystemSoftware" -archi.elements.u_cmdb_ci_db_teradata_instance.folder = "Logiciels"/"Teradata"/"Instance" -archi.elements.u_cmdb_ci_db_teradata_instance.property.env = u_fonction -archi.elements.u_cmdb_ci_db_teradata_instance.property.tcp_port= tcp_port - -archi.elements.cmdb_ci_cics.archi_class = "SystemSoftware" -archi.elements.cmdb_ci_cics.folder = "Logiciels"/"Cics" -archi.elements.cmdb_ci_cics.property.env = u_fonction -archi.elements.cmdb_ci_cics.property.tcp_port = tcp_port - -archi.elements.cmdb_ci_vmware_instance.archi_class = "SystemSoftware" -archi.elements.cmdb_ci_vmware_instance.folder = "Logiciels"/"VMware" -archi.elements.cmdb_ci_vmware_instance.property.env = u_fonction -archi.elements.cmdb_ci_vmware_instance.property.tcp_port = tcp_port - - ## ApplicationComponents - -archi.elements.cmdb_ci_appl.archi_class = "ApplicationComponent" -archi.elements.cmdb_ci_appl.folder = "Applications" - - ## Other existing tables in my ServiceNow implementation -#archi.elements.cmdb_ci_memory_module.archi_class = -#archi.elements.cmdb_ci_mobile_radio.archi_class = -#archi.elements.cmdb_ci_msd.archi_class = -#archi.elements.cmdb_ci_net_app_server.archi_class = -#archi.elements.cmdb_ci_network_adapter.archi_class = -#archi.elements.cmdb_ci_portable_radio.archi_class = -#archi.elements.cmdb_ci_print_queue.archi_class = -#archi.elements.cmdb_ci_printer.archi_class = -#archi.elements.cmdb_ci_rack.archi_class = -#archi.elements.cmdb_ci_radio_hardware.archi_class = -#archi.elements.cmdb_ci_service.archi_class = -#archi.elements.cmdb_ci_snc_component.archi_class = -#archi.elements.cmdb_ci_spkg.archi_class = -#archi.elements.cmdb_ci_storage_server.archi_class = -#archi.elements.cmdb_ci_switch_port.archi_class = -#archi.elements.cmdb_ci_terminal_network.archi_class = -#archi.elements.cmdb_ci_transport_hardware.archi_class = -#archi.elements.cmdb_ci_workstation_pc.archi_class = -#archi.elements.cmdb_ci_facility_hardware.archi_class = -#archi.elements.cmdb_ci_file_system.archi_class = -#archi.elements.cmdb_ci_firewall_network.archi_class = -#archi.elements.cmdb_ci_inf_software.archi_class = -#archi.elements.cmdb_ci_ip_phone.archi_class = -#archi.elements.cmdb_ci_ip_router.archi_class = -#archi.elements.cmdb_ci_ip_switch.archi_class = -#archi.elements.cmdb_ci_lb.archi_class = -#archi.elements.cmdb_ci_voice_hardware.archi_class = -#archi.elements.cmdb_ci_wap_network.archi_class = -#archi.elements.cmdb_ci_desktop_software.archi_class = -#archi.elements.cmdb_ci_disk.archi_class = -#archi.elements.cmdb_ci_chassis_server.archi_class = - - ## - ## Archi elements properties - ## ------------------------- - ## Used to map ServiceNow CIs to Archi elements - ## - ## The following properties allow to specify how CIs properties will be mapped to Archi properties. - ## +------------------+---------+----------------------------------------------------------------------------------------------------+-------------------+ - ## | property name | Type | Description | Default value | - ## +==================+=========+====================================================================================================+===================+ - ## | archi_class | string | Class of the Archi objects. | n/a | - ## +------------------+---------+----------------------------------------------------------------------------------------------------+-------------------+ - ## | | | Import behavior of the plugin: | | - ## | | | - full : create or update relations | | - ## | import_mode | string | - create_only : create new relations but do not update existing ones | full | - ## | | | - update_only : update existing relations but do not create new ones | | - ## | | | /!\ ServiceNow doesn't maintain operational status for relations, so we can't remove old relations | | - ## +------------------+---------+----------------------------------------------------------------------------------------------------+-------------------+ - ## | id | string | Id of the Archi objects. | sys_id | - ## +------------------+---------+----------------------------------------------------------------------------------------------------+-------------------+ - ## | name | string | Name of the Archi objects. | sys_class_name | - ## +------------------+---------+----------------------------------------------------------------------------------------------------+-------------------+ - ## | documentation | string | Documentation of the Archi objects. | short_description | - ## +------------------+---------+----------------------------------------------------------------------------------------------------+-------------------+ - ## | folder | string | Folder where the Archi object should be created. | sys_class_name | - ## +------------------+---------+----------------------------------------------------------------------------------------------------+-------------------+ - ## | property.xxxxx | string | Property to add or replace in the Archi objects. | n/a | - ## +------------------+---------+----------------------------------------------------------------------------------------------------+-------------------+ - ## - ## They all begin with the "archi.relations.." prefix where "" may be: - ## - any ServiceNow relation type (please refer to your ServiceNow documentation to get the types list) - ## - the wildcard char (*) to specify a default value for all the relation types - ## - ## The property values may be: - ## - a value without quotes to represent a ServiceNow table column, like sys_id. - ## - a set of values without quotes, separated by a hash to follow ServiceNow links, like type#name. - ## - a value between quotes to represent a constant string, like "this is a constant string". - ## - a value starting with a dollar sign and inside parentheses to represent a calculated variable, like ${date:dd/MM/yyyy HH:mm:ss}. - ## - a list of values separated by slashes to represent a path, like "Serveurs"/os/"Hosts". - ## - ## The list of currently managed variables are: - ## - ${date:format} the current date and time under the specified fotmat (the format is mandatory) - ## - ${id} the ID of the relation that has just been created ot that is being updated - ## - ${name} the name of the relation that has just been created ot that is being updated - ## - ${description} the description of the relation that has just been created ot that is being updated - ## - ${property:xxx} the value of the property xxx of the relation that has just been created ot that is being updated - ## - ${model:id} the ID of the model - ## - ${model:name} the name of the model - ## - ${model:purpose} the purpose of the model - ## - ${model:property:xxx} the value of the property xxx of the model - ## - ## Please note that the variables retrieving information on the relation, are valid only once the relation has been created, or once the relation to update has been found. - ## Therefore they cannot be used on the "archi.relations..import_mode" nor "archi.relations..id" properties. - ## - ## Like ServiceNow, Archi manages relations using internal IDs. When the plugin maps a ServiceNow relation to an Archi relation: - ## - either a relation with the same ID exists and it is updated with the new values from ServiceNow, - ## - either no relation with the same ID exists, and a new one is created. - ## -archi.relations.*.id = sys_id -archi.relations.*.name = type#name -archi.relations.*.type = type#value -archi.relations.*.source = child -archi.relations.*.target = parent -archi.relations.*.folder = ${class} -archi.relations.*.property.strength = connection_strength -archi.relations.*.property.source_action = type#child_descriptor -archi.relations.*.property.target_action = type#parent_description - -# Allocated to -#archi.relations.04180212371a200032ff8c00dfbe5d08.archi_class = - -# Runs -archi.relations.0454da4c6f7e9940f0721cef8d3ee4b9.archi_class = "CompositionRelationship" - -# Distributes -#archi.relations.0898719c37020100dcd48c00dfbe5d43.archi_class = - -# Dependent of -#archi.relations.1.archi_class = - -# Support -#archi.relations.1f246bc1898bc100b3ced795d2f57a0d.archi_class = - -# Sends the data to WebService -archi.relations.2da380cc6f3ab944a77a2dc71e3ee49d.archi_class = "FlowRelationship" -archi.relations.2da380cc6f3ab944a77a2dc71e3ee49d.source = parent -archi.relations.2da380cc6f3ab944a77a2dc71e3ee49d.target = child -archi.relations.2da380cc6f3ab944a77a2dc71e3ee49d.property.source_action = type#parent_descriptor -archi.relations.2da380cc6f3ab944a77a2dc71e3ee49d.property.target_action = type#child_description - -# Consumed by -#archi.relations.41008aa6ef32010098d5925495c0fb94.archi_class = - -# Sends data to -archi.relations.4b2b24dd6f435180f0721cef8d3ee42c.archi_class = "FlowRelationship" - -# Allocated from -#archi.relations.51678212371a200032ff8c00dfbe5d39.archi_class = - -# Receives a MQSeries from -#archi.relations.778300cc6f3ab944a77a2dc71e3ee4c3.archi_class = - -# Houses -archi.relations.91aaac9d6f435180f0721cef8d3ee4b9.archi_class = "AssignmentRelationship" - -# Is described in -#archi.relations.9b98225f6fbb0500f0721cef8d3ee4fc.archi_class = - -# Rescues -#archi.relations.9e0e6a9f6fbb0500f0721cef8d3ee4a5.archi_class = - -# Is hosted on -archi.relations.a8aab4c26f395900f0721cef8d3ee44a.archi_class = "AssignmentRelationship" -archi.relations.a8aab4c26f395900f0721cef8d3ee44a.source = parent -archi.relations.a8aab4c26f395900f0721cef8d3ee44a.target = child -archi.relations.a8aab4c26f395900f0721cef8d3ee44a.property.source_action = type#parent_descriptor -archi.relations.a8aab4c26f395900f0721cef8d3ee44a.property.target_action = type#child_description - -# Powered by -#archi.relations.b76c6a5f6fbb0500f0721cef8d3ee4d0.archi_class = - -# Sends a file to -archi.relations.ca538c8c6f3ab944a77a2dc71e3ee4d2.archi_class = "FlowRelationship" - -# Used by -#archi.relations.cb5592603751200032ff8c00dfbe5d17.archi_class = - -# Hosted on -archi.relations.d4b4861b3791c604f5e9d2e843990ed0.archi_class = "CompositionRelationship" - -# Contains -archi.relations.de34b3f66f00d500f0721cef8d3ee41d.archi_class = "CompositionRelationship" - -# Connects -#archi.relations.e9ab20dd6f435180f0721cef8d3ee4dd.archi_class = \ No newline at end of file diff --git a/sample_snow-import_plugin_ini_file.ini b/sample_snow-import_plugin_ini_file.ini new file mode 100644 index 0000000..ed3abe3 --- /dev/null +++ b/sample_snow-import_plugin_ini_file.ini @@ -0,0 +1,623 @@ +# +# Servicenow.ini +# +# Author : Herve Jouin +# +# This is a sample of tha property file used by the org.archicontribs.servicenow plugin +# +# https://github.com/archi-contribs/snow-import-plugin +# +# /!\ Please be carrefull, this file is case sensitive +# + + ## Plugin version: + ## --------------- + ## To avoid configuration errors du to changes in the configuration file between plugin versions, + ## the plugin checks the version of the ini file. + ## +SNowPlugin.version = 1.5 + + ## + ## logfile properties: + ## ------------------- + ## Used to manage the log file. + ## + ## The plugin uses Log4J to generate its log file, so any Log4J property may be used. + ## +log4j.rootLogger = ALL, SNowPlugin + +log4j.appender.SNowPlugin = org.apache.log4j.FileAppender +log4j.appender.SNowPlugin.ImmediateFlush = true +log4j.appender.SNowPlugin.Append = false +log4j.appender.SNowPlugin.encoding = UTF-8 +log4j.appender.SNowPlugin.File = D:\\archimate-import_servicenow.log +log4j.appender.SNowPlugin.layout = org.apache.log4j.PatternLayout +log4j.appender.SNowPlugin.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %4L:%-20.20C{1} - %m%n + + ## + ## Proxy properties: + ## ----------------- + ## Used to send the http requests through a proxy. + ## http.proxyHost = name or ip specifies the name or ip of the proxy + ## http.proxyPort = port specifies the tcp port of the proxy + ## http.proxyUser = username specifies the credentials to send to the proxy + ## http.proxyPassword = password + ## +#http.proxyHost = +#http.proxyPort = +#http.proxyUser = +#http.proxyPassword = + + ## + ## ServiceNow properties: + ## ---------------------- + ## Used to specify how to retrieve data from theServiceNow website. + ## servicenow.site = URL specifies the URL of ServiceNow web site + ## servicenow.user = username specifies the credentials to send to ServiceNow + ## servicenow.pass = password + ## servicenow.sysparm_limit = nb specifies the maximum number of CIs to retrieve + ## /!\ Please note that if not specified or if zero, + ## then ServiceNow automatically limits itself to + ## 10.000 objects without error message. + ## +servicenow.site = https://your_company.service-now.com +servicenow.user = your_account +servicenow.pass = your_password +servicenow.sysparm_limit = 100000 + + ## + ## Archi elements properties: + ## -------------------------- + ## The following properties specify how ServiceNow CIs will be mapped with Archi elements. + ## + ## These SerciceNow CIs are retrieved from the cmdb_ci_* tables. + ## + ## Properties: + ## ----------- + ## The properties are under the form: + ## - archi.elements.. = value + ## - archi.elements..property. = value + ## + ## Where: + ## - is the name of the ServiceNow table that contains the CIs to map + ## - you may use the * wildcard to create default values for all ServiceNow tables. + ## - This default value can, of course, be overriden for each of the individual tables. + ## - is the caracteristic to set in the Archi elements. It can be: + ## - import_mode to specify how the plugin will behave with the corresponding ServiceNow table (cf. import mode below) + ## - archi_class to specify the Archi class to be used when the Archi element is created (this plugin do not change the class of existing Archi elements) + ## - id to set the element's ID (defaults to ServiceNow sys_id) + ## - name to set the element's name (defaults to ServiceNow name) + ## - documentation to set the element's documentation (defaults to ServiceNow short_description) + ## - folder to set the folder where the Archi element should be placed (defaults to Archi's default folder) + ## - filter to filter the ServiceNow result (will be added to the s part of the ServiceNow web service request) + ## - property to set element's property + ## - is the name of the element's property to set + ## - is the value to set (cf. values below) + ## + ## Values: + ## ------- + ## The value may be specified using 4 different conventions: + ## - "xxxxxxxxx" quoted strings are constants. + ## For example: archi.elements.*.name = "this is the name" + ## -> will set the name of the element to this is the name + ## - ${xxxxxxxx} strings starting with a dollar sign and surrounded with brackets are variables. + ## For example: archi.elements.*.property.date = ${data:dd/MM/yyyy hh/mm/ss} + ## -> will set the element's property "date" to the current date and time + ## - xxxxxxxxxxx simple strings (without quotes nor dollar sign) are ServiceNow fields. + ## For example: archi.elements.*.id = sys_id + ## -> will set the element's ID to the sys_id field got in the ServiceNow table + ## - xxx/xxx/xxx For the folder caracteristic only: will be used to construct a path to a folder where the element should be placed. + ## This path should not begin with a "/" + ## The root folder is the default folder for the element (ie. Technology & Physical for a Node) + ## If the corresponding folder does not exist, it is automatically created. + ## For example: archi.elements.*.folder = "snow plugin"/${class} + ## -> will place the elements in folder called by the name of the Archi class of the lement, itself in a folder called "snow plugin", itself in the default folder of the element. + ## + ## Variables: + ## ---------- + ## The key variables that can be used are: + ## - ${class} the class of the Archi element (like Node, ApplicationComponent, BusinessActor, ...) + ## - ${date:} the current date (the colon and the format are mandatory) + ## - ${id} the id of the element + ## - ${name} the name of the element + ## - ${documentation} the documentation of the element + ## - ${property:xxx} the value of the property xxx of the element + ## - ${model:id} the id of the model + ## - ${model:name} the name of the element + ## - ${model:documentation} the documentation of the element + ## - ${model:property:xxx} the value of the property xxx of the element + ## + ## + ## Please be aware that using variables on some properties make no sens. + ## For examples, the id property is used to match a ServiceNow CI with an Archi element, when the id property is analysed, the corresponding Archi element is not yet known. + ## + ## Operational status: + ## ------------------- + ## ServiceNow CIs have got an operational status. They are tagged as operational or non operational. + ## + ## The plugin uses this tag to determine what to do with corresponding Archi elements: + ## - if operational status is operational: + ## - existing elements are updated + ## - non existing elements are created + ## - if operational status is non operational + ## - existing elements are removed + ## + ## Import mode: + ## ------------ + ## The plugin manages several import modes: + ## - create_only in this mode, the plugin creates new elements from operational ServiceNow CIs, but do not update nor remove existing elements + ## - update_only in ths mode, the plugin updates existing elements from operational ServiceNow CIs, but do not create nor remove elements. + ## - create_or_update_only in this mode, the plugin creates new elements or update existing elements from operational ServiceNow CIs, but do not remove existing elements. + ## - remove_only in this mode, the plugin removes elements from non operational ServiceNow CIs, but do not create nor update existing elements. + ## - full This is the default mode: the plugin creates and updates elements from operational ServiceNow CIs, and remove elements from non operational ServiceNow CIs. + ## + +## +## 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 + + ## mapping between ServiceNow CI and Archi elements + + ## Locations +archi.elements.cmdb_ci_computer_room.archi_class = "Location" +archi.elements.cmdb_ci_computer_room.folder = "Salles informatiques" +archi.elements.cmdb_ci_computer_room.property.hosting = u_hosting + +archi.elements.cmdb_ci_datacenter.archi_class = "Location" +archi.elements.cmdb_ci_datacenter.folder = "Sites" +archi.elements.cmdb_ci_datacenter.property.hosting = u_hosting + +archi.elements.cmdb_ci_zone.archi_class = "Location" +archi.elements.cmdb_ci_zone.folder = "Zones" +archi.elements.cmdb_ci_zone.property.hosting = u_hosting + + ## Servers +archi.elements.cmdb_ci_mainframe.archi_class = "Node" +archi.elements.cmdb_ci_mainframe.folder = "Serveurs"/"Mainframe" + +archi.elements.cmdb_ci_esx_server.archi_class = "Device" +archi.elements.cmdb_ci_esx_server.folder = "Serveurs"/"ESX" +archi.elements.cmdb_ci_esx_server.property.cores = cpu_count +archi.elements.cmdb_ci_esx_server.property.cpu_type = cpu_type +archi.elements.cmdb_ci_esx_server.property.os = os +archi.elements.cmdb_ci_esx_server.property.ram = Ram +archi.elements.cmdb_ci_esx_server.property.env = u_fonction +archi.elements.cmdb_ci_esx_server.property.chassis_type = chassis_type +archi.elements.cmdb_ci_esx_server.property.status = hardware_status + +archi.elements.cmdb_ci_vcenter_cluster.archi_class = "Node" +archi.elements.cmdb_ci_vcenter_cluster.folder = "Serveurs"/"ESX"/"Clusters" + +archi.elements.cmdb_ci_vcenter_server_obj.archi_class = "Node" +archi.elements.cmdb_ci_vcenter_server_obj.folder = "Serveurs"/"ESX"/"Vcenter" + +archi.elements.cmdb_ci_aix_server.archi_class = "Node" +archi.elements.cmdb_ci_aix_server.folder = "Serveurs"/"AIX"/os +archi.elements.cmdb_ci_aix_server.property.processor = processor#display_name +archi.elements.cmdb_ci_aix_server.property.pvus_per_core = processor#processor_mapping#pvus_per_core + +archi.elements.u_cmdb_ci_lpar_server.archi_class = "Device" +archi.elements.u_cmdb_ci_lpar_server.folder = "Serveurs"/"AIX"/os/"LPAR" +archi.elements.u_cmdb_ci_lpar_server.property.cores = cpu_count +archi.elements.u_cmdb_ci_lpar_server.property.cpu_type = cpu_type +archi.elements.u_cmdb_ci_lpar_server.property.os = os +archi.elements.u_cmdb_ci_lpar_server.property.ram = Ram +archi.elements.u_cmdb_ci_lpar_server.property.env = u_fonction +archi.elements.u_cmdb_ci_lpar_server.property.chassis_type = chassis_type +archi.elements.u_cmdb_ci_lpar_server.property.status = hardware_status + +archi.elements.cmdb_ci_linux_server.archi_class = "Device" +archi.elements.cmdb_ci_linux_server.folder = "Serveurs"/"Linux"/os +archi.elements.cmdb_ci_linux_server.property.cores = cpu_count +archi.elements.cmdb_ci_linux_server.property.cpu_type = cpu_type +archi.elements.cmdb_ci_linux_server.property.os = os +archi.elements.cmdb_ci_linux_server.property.ram = Ram +archi.elements.cmdb_ci_linux_server.property.env = u_fonction +archi.elements.cmdb_ci_linux_server.property.chassis_type = chassis_type +archi.elements.cmdb_ci_linux_server.property.status = hardware_status + +archi.elements.cmdb_ci_linux_host.archi_class = "Device" +archi.elements.cmdb_ci_linux_host.folder = "Serveurs"/"Linux"/os/"Hosts" +archi.elements.cmdb_ci_linux_host.property.cores = cpu_count +archi.elements.cmdb_ci_linux_host.property.cpu_type = cpu_type +archi.elements.cmdb_ci_linux_host.property.os = os +archi.elements.cmdb_ci_linux_host.property.ram = Ram +archi.elements.cmdb_ci_linux_host.property.env = u_fonction +archi.elements.cmdb_ci_linux_host.property.chassis_type = chassis_type +archi.elements.cmdb_ci_linux_host.property.status = hardware_status + +archi.elements.cmdb_ci_win_server.archi_class = "Device" +archi.elements.cmdb_ci_win_server.folder = "Serveurs"/"Windows"/os +archi.elements.cmdb_ci_win_server.property.cores = cpu_count +archi.elements.cmdb_ci_win_server.property.cpu_type = cpu_type +archi.elements.cmdb_ci_win_server.property.os = os +archi.elements.cmdb_ci_win_server.property.ram = Ram +archi.elements.cmdb_ci_win_server.property.env = u_fonction +archi.elements.cmdb_ci_win_server.property.chassis_type = chassis_type +archi.elements.cmdb_ci_win_server.property.status = hardware_status + +archi.elements.u_cmdb_ci_as400_server.archi_class = "Device" +archi.elements.u_cmdb_ci_as400_server.folder = "Serveurs"/"AS 400" +archi.elements.u_cmdb_ci_as400_server.property.cores = cpu_count +archi.elements.u_cmdb_ci_as400_server.property.cpu_type = cpu_type +archi.elements.u_cmdb_ci_as400_server.property.os = os +archi.elements.u_cmdb_ci_as400_server.property.ram = Ram +archi.elements.u_cmdb_ci_as400_server.property.env = u_fonction +archi.elements.u_cmdb_ci_as400_server.property.chassis_type = chassis_type +archi.elements.u_cmdb_ci_as400_server.property.status = hardware_status + +archi.elements.u_cmdb_ci_teradata_server.archi_class = "Device" +archi.elements.u_cmdb_ci_teradata_server.folder = "Serveurs"/"Teradata" +archi.elements.u_cmdb_ci_teradata_server.property.cores = cpu_count +archi.elements.u_cmdb_ci_teradata_server.property.cpu_type = cpu_type +archi.elements.u_cmdb_ci_teradata_server.property.os = os +archi.elements.u_cmdb_ci_teradata_server.property.ram = Ram +archi.elements.u_cmdb_ci_teradata_server.property.env = u_fonction +archi.elements.u_cmdb_ci_teradata_server.property.chassis_type = chassis_type +archi.elements.u_cmdb_ci_teradata_server.property.status = hardware_status + + ## SystemSoftware +archi.elements.cmdb_ci_app_server_domino.archi_class = "SystemSoftware" +archi.elements.cmdb_ci_app_server_domino.folder = "Logiciels"/"Domino" +archi.elements.cmdb_ci_app_server_domino.property.env = u_fonction +archi.elements.cmdb_ci_app_server_domino.property.tcp_port = tcp_port + +archi.elements.cmdb_ci_app_server_tomcat.archi_class = "SystemSoftware" +archi.elements.cmdb_ci_app_server_tomcat.folder = "Logiciels"/"Tomcat" +archi.elements.cmdb_ci_app_server_tomcat.property.env = u_fonction +archi.elements.cmdb_ci_app_server_tomcat.property.tcp_port = tcp_port + +archi.elements.cmdb_ci_app_server_websphere.archi_class = "SystemSoftware" +archi.elements.cmdb_ci_app_server_websphere.folder = "Logiciels"/"Websphere" +archi.elements.cmdb_ci_app_server_websphere.property.env = u_fonction +archi.elements.cmdb_ci_app_server_websphere.property.tcp_port = tcp_port + +archi.elements.cmdb_ci_application_software.archi_class = "SystemSoftware" +archi.elements.cmdb_ci_application_software.folder = "Logiciels"/"Application Softwares" +archi.elements.cmdb_ci_application_software.property.env = u_fonction +archi.elements.cmdb_ci_application_software.property.tcp_port = tcp_port + +archi.elements.cmdb_ci_db_db2_catalog.archi_class = "SystemSoftware" +archi.elements.cmdb_ci_db_db2_catalog.folder = "Logiciels"/"DB2"/"Catalog" +archi.elements.cmdb_ci_db_db2_catalog.property.env = u_fonction +archi.elements.cmdb_ci_db_db2_catalog.property.tcp_port = tcp_port + +archi.elements.cmdb_ci_db_db2_instance.archi_class = "SystemSoftware" +archi.elements.cmdb_ci_db_db2_instance.folder = "Logiciels"/"DB2"/"Instance" +archi.elements.cmdb_ci_db_db2_instance.property.env = u_fonction +archi.elements.cmdb_ci_db_db2_instance.property.tcp_port = tcp_port + +archi.elements.cmdb_ci_db_mssql_catalog.archi_class = "SystemSoftware" +archi.elements.cmdb_ci_db_mssql_catalog.folder = "Logiciels"/"MS SQL"/"Catalog" +archi.elements.cmdb_ci_db_mssql_catalog.property.env = u_fonction +archi.elements.cmdb_ci_db_mssql_catalog.property.tcp_port = tcp_port + +archi.elements.cmdb_ci_db_mssql_instance.archi_class = "SystemSoftware" +archi.elements.cmdb_ci_db_mssql_instance.folder = "Logiciels"/"MS SQL"/"Instance" +archi.elements.cmdb_ci_db_mssql_instance.property.env = u_fonction +archi.elements.cmdb_ci_db_mssql_instance.property.tcp_port = tcp_port + +archi.elements.cmdb_ci_db_mysql_catalog.archi_class = "SystemSoftware" +archi.elements.cmdb_ci_db_mysql_catalog.folder = "Logiciels"/"MySQL"/"Catalog" +archi.elements.cmdb_ci_db_mysql_catalog.property.env = u_fonction +archi.elements.cmdb_ci_db_mysql_catalog.property.tcp_port = tcp_port + +archi.elements.cmdb_ci_db_mysql_instance.archi_class = "SystemSoftware" +archi.elements.cmdb_ci_db_mysql_instance.folder = "Logiciels"/"MySQL"/"Instance" +archi.elements.cmdb_ci_db_mysql_instance.property.env = u_fonction +archi.elements.cmdb_ci_db_mysql_instance.property.tcp_port = tcp_port + +archi.elements.cmdb_ci_database.archi_class = "SystemSoftware" +archi.elements.cmdb_ci_database.folder = "Logiciels"/"Database" +archi.elements.cmdb_ci_database.property.env = u_fonction +archi.elements.cmdb_ci_database.property.tcp_port = tcp_port + +archi.elements.u_cmdb_ci_db_datacom_catalog.archi_class = "SystemSoftware" +archi.elements.u_cmdb_ci_db_datacom_catalog.folder = "Logiciels"/"Datacom"/"Catalog" +archi.elements.u_cmdb_ci_db_datacom_catalog.property.env = u_fonction +archi.elements.u_cmdb_ci_db_datacom_catalog.property.tcp_port = tcp_port + +archi.elements.u_cmdb_ci_db_datacom_instance.archi_class = "SystemSoftware" +archi.elements.u_cmdb_ci_db_datacom_instance.folder = "Logiciels"/"Datacom"/"Instance" +archi.elements.u_cmdb_ci_db_datacom_instance.property.env = u_fonction +archi.elements.u_cmdb_ci_db_datacom_instance.property.tcp_port = tcp_port + +archi.elements.cmdb_ci_db_ora_catalog.archi_class = "SystemSoftware" +archi.elements.cmdb_ci_db_ora_catalog.folder = "Logiciels"/"Oracle"/"Catalog" +archi.elements.cmdb_ci_db_ora_catalog.property.env = u_fonction +archi.elements.cmdb_ci_db_ora_catalog.property.tcp_port = tcp_port + +archi.elements.cmdb_ci_db_ora_instance.archi_class = "SystemSoftware" +archi.elements.cmdb_ci_db_ora_instance.folder = "Logiciels"/"Oracle"/"Instance" +archi.elements.cmdb_ci_db_ora_instance.property.env = u_fonction +archi.elements.cmdb_ci_db_ora_instance.property.tcp_port = tcp_port + +archi.elements.u_cmdb_ci_db_oracle_schema.archi_class = "SystemSoftware" +archi.elements.u_cmdb_ci_db_oracle_schema.folder = "Logiciels"/"Oracle"/"Schema" +archi.elements.u_cmdb_ci_db_oracle_schema.property.env = u_fonction +archi.elements.u_cmdb_ci_db_oracle_schema.property.tcp_port = tcp_port + +archi.elements.cmdb_ci_vcenter.archi_class = "SystemSoftware" +archi.elements.cmdb_ci_vcenter.folder = "Logiciels"/"ESX"/"Vcenter" +archi.elements.cmdb_ci_vcenter.property.env = u_fonction +archi.elements.cmdb_ci_vcenter.property.tcp_port = tcp_port + +archi.elements.cmdb_ci_web_server.archi_class = "SystemSoftware" +archi.elements.cmdb_ci_web_server.folder = "Logiciels"/"Web servers" +archi.elements.cmdb_ci_web_server.property.env = u_fonction +archi.elements.cmdb_ci_web_server.property.tcp_port = tcp_port + +archi.elements.u_cmdb_ci_app_server_etl.archi_class = "SystemSoftware" +archi.elements.u_cmdb_ci_app_server_etl.folder = "Logiciels"/"ETL" +archi.elements.u_cmdb_ci_app_server_etl.property.env = u_fonction +archi.elements.u_cmdb_ci_app_server_etl.property.tcp_port = tcp_port + +archi.elements.u_cmdb_ci_app_server_mq_series.archi_class = "SystemSoftware" +archi.elements.u_cmdb_ci_app_server_mq_series.folder = "Logiciels"/"MQ Series" +archi.elements.u_cmdb_ci_app_server_mq_series.property.env = u_fonction +archi.elements.u_cmdb_ci_app_server_mq_series.property.tcp_port = tcp_port + +archi.elements.u_cmdb_ci_db_postgre_sql_catal.archi_class = "SystemSoftware" +archi.elements.u_cmdb_ci_db_postgre_sql_catal.folder = "Logiciels"/"PostGreSQL"/"Catalog" +archi.elements.u_cmdb_ci_db_postgre_sql_catal.property.env = u_fonction +archi.elements.u_cmdb_ci_db_postgre_sql_catal.property.tcp_port = tcp_port + +archi.elements.u_cmdb_ci_db_teradata_catalog.archi_class = "SystemSoftware" +archi.elements.u_cmdb_ci_db_teradata_catalog.folder = "Logiciels"/"Teradata"/"Catalog" +archi.elements.u_cmdb_ci_db_teradata_catalog.property.env = u_fonction +archi.elements.u_cmdb_ci_db_teradata_catalog.property.tcp_port = tcp_port + +archi.elements.u_cmdb_ci_db_teradata_instance.archi_class = "SystemSoftware" +archi.elements.u_cmdb_ci_db_teradata_instance.folder = "Logiciels"/"Teradata"/"Instance" +archi.elements.u_cmdb_ci_db_teradata_instance.property.env = u_fonction +archi.elements.u_cmdb_ci_db_teradata_instance.property.tcp_port = tcp_port + +archi.elements.cmdb_ci_cics.archi_class = "SystemSoftware" +archi.elements.cmdb_ci_cics.folder = "Logiciels"/"Cics" +archi.elements.cmdb_ci_cics.property.env = u_fonction +archi.elements.cmdb_ci_cics.property.tcp_port = tcp_port + +archi.elements.cmdb_ci_vmware_instance.archi_class = "SystemSoftware" +archi.elements.cmdb_ci_vmware_instance.folder = "Logiciels"/"VMware" +archi.elements.cmdb_ci_vmware_instance.property.env = u_fonction +archi.elements.cmdb_ci_vmware_instance.property.tcp_port = tcp_port + + ## ApplicationComponents +archi.elements.cmdb_ci_appl.archi_class = "ApplicationComponent" +archi.elements.cmdb_ci_appl.name = u_display_name +archi.elements.cmdb_ci_appl.folder = sys_class_name +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 + + + ## Other existing tables +#archi.elements.cmdb_ci_memory_module.archi_class = +#archi.elements.cmdb_ci_mobile_radio.archi_class = +#archi.elements.cmdb_ci_msd.archi_class = +#archi.elements.cmdb_ci_net_app_server.archi_class = +#archi.elements.cmdb_ci_network_adapter.archi_class = +#archi.elements.cmdb_ci_portable_radio.archi_class = +#archi.elements.cmdb_ci_print_queue.archi_class = +#archi.elements.cmdb_ci_printer.archi_class = +#archi.elements.cmdb_ci_rack.archi_class = +#archi.elements.cmdb_ci_radio_hardware.archi_class = +#archi.elements.cmdb_ci_service.archi_class = +#archi.elements.cmdb_ci_snc_component.archi_class = +#archi.elements.cmdb_ci_spkg.archi_class = +#archi.elements.cmdb_ci_storage_server.archi_class = +#archi.elements.cmdb_ci_switch_port.archi_class = +#archi.elements.cmdb_ci_terminal_network.archi_class = +#archi.elements.cmdb_ci_transport_hardware.archi_class = +#archi.elements.cmdb_ci_workstation_pc.archi_class = +#archi.elements.cmdb_ci_facility_hardware.archi_class = +#archi.elements.cmdb_ci_file_system.archi_class = +#archi.elements.cmdb_ci_firewall_network.archi_class = +#archi.elements.cmdb_ci_inf_software.archi_class = +#archi.elements.cmdb_ci_ip_phone.archi_class = +#archi.elements.cmdb_ci_ip_router.archi_class = +#archi.elements.cmdb_ci_ip_switch.archi_class = +#archi.elements.cmdb_ci_lb.archi_class = +#archi.elements.cmdb_ci_voice_hardware.archi_class = +#archi.elements.cmdb_ci_wap_network.archi_class = +#archi.elements.cmdb_ci_desktop_software.archi_class = +#archi.elements.cmdb_ci_disk.archi_class = +#archi.elements.cmdb_ci_chassis_server.archi_class = + + ## + ## Archi relations properties + ## ------------------------- + ## The following properties specify how ServiceNow relations will be mapped with Archi relations. + ## + ## These ServiceNow relations are all retrieved from the cmdb_rel_ci table. + ## + ## Properties: + ## ----------- + ## The properties are under the form: + ## - archi.relations.. = value + ## - archi.relations..property. = value + ## + ## Where: + ## - is the numerical ID of the ServiceNow relation (type field of the Ser + ## - you may use the * wildcard to create default values for all ServiceNow relations. + ## - This default value can, of course, be overriden for each of the individual relation. + ## - is the caracteristic to set in the Archi relation. It can be: + ## - import_mode to specify how the plugin will behave with the corresponding ServiceNow relation (cf. import mode below) + ## - archi_class to specify the Archi class to be used when the Archi relation is created (this plugin do not change the class of existing Archi elements) + ## - id to set the relation's ID (defaults to ServiceNow sys_id) + ## - name to set the relation's name (defaults to ServiceNow name) + ## - documentation to set the relation's documentation (defaults to ServiceNow short_description) + ## - folder to set the relation where the Archi relation should be placed (defaults to Archi's default folder) + ## - property to set relation's property + ## - is the name of the relation's property to set + ## - is the value to set (cf. values below) + ## + ## Values: + ## ------- + ## The value may be specified using 4 different conventions: + ## - "xxxxxxxxx" quoted strings are constants. + ## For example: archi.relations.*.name = "this is the name" + ## -> will set the name of the relation to this is the name + ## - ${xxxxxxxx} strings starting with a dollar sign and surrounded with brackets are variables. + ## For example: archi.relations.*.property.date = ${data:dd/MM/yyyy hh/mm/ss} + ## -> will set the relation's property "date" to the current date and time + ## - xxxxxxxxxxx simple strings (without quotes nor dollar sign) are ServiceNow fields. + ## For example: archi.relations.*.id = sys_id + ## -> will set the relation's ID to the sys_id field got in the ServiceNow table + ## - xxx/xxx/xxx For the folder caracteristic only: will be used to construct a path to a folder where the relation should be placed. + ## This path should not begin with a "/" + ## The root folder is the default folder for the relation (ie. Technology & Physical for a Node) + ## If the corresponding folder does not exist, it is automatically created. + ## For example: archi.relations.*.folder = "snow plugin"/${class} + ## -> will place the relations in folder called by the name of the Archi class of the relation, itself in a folder called "snow plugin", itself in the Relations folder. + ## + ## Variables: + ## ---------- + ## The key variables that can be used are: + ## - ${class} the class of the Archi relation (like RealizationRelationship, FlowRelationship, ...) + ## - ${date:} the current date (the colon and the format are mandatory) + ## - ${id} the id of the relation + ## - ${name} the name of the relation + ## - ${documentation} the documentation of the relation + ## - ${property:xxx} the value of the property xxx of the relation + ## - ${model:id} the id of the model + ## - ${model:name} the name of the relation + ## - ${model:documentation} the documentation of the relation + ## - ${model:property:xxx} the value of the property xxx of the relation + ## + ## Please be aware that using variables on some properties make no sens. + ## For examples, the id property is used to match a ServiceNow relation with an Archi relation, when the id property is analysed, the corresponding Archi relation is not yet known. + ## + ## Operational status: + ## ------------------- + ## ServiceNow relations have got an operational status. They are tagged as operational or non operational. + ## + ## The plugin uses this tag to determine what to do with corresponding Archi relations: + ## - if operational status is operational: + ## - existing relations are updated + ## - non existing relations are created + ## - if operational status is non operational + ## - existing relations are removed + ## + ## Import mode: + ## ------------ + ## The plugin manages several import modes: + ## - create_only in this mode, the plugin creates new relations from operational ServiceNow relations, but do not update nor remove existing elements + ## - update_only in ths mode, the plugin updates existing relations from operational ServiceNow relations, but do not create nor remove elements. + ## - create_or_update_only in this mode, the plugin creates new relations or update existing relations from operational ServiceNow relations, but do not remove existing elements. + ## - remove_only in this mode, the plugin removes relations from non operational ServiceNow relations, but do not create nor update existing elements. + ## - full This is the default mode: the plugin creates and updates relations from operational ServiceNow relations, and remove elements from non operational ServiceNow relations. + ## + ## Relations direction: + ## -------------------- + ## One must pay attention to the direction of the relations. + ## + ## Some relations must map the ServiceNow child to Archi source and the ServiceNow parent to Archi target, but some other relations must be the opposite. + ## + ## Relations validation: + ## --------------------- + ## Please be aware that the version 1.3 and below of the plugin does not check if relations are valid from an Archimate point of view. + ## + ## So a badly configured configuration file can lead to Archi relations that ara not valid from an Archimate point of view. + ## + + + ## relations + ## + ## One must choose the relation direction : + ## - from the child to the parent + ## - or from the parent to the child + ## As a general rule, but also, relation by relation + ## + ## /!\ beware, ServiceNow relationships IDs may be different in your ServiceNow database + ## + ## /!\ the actual version of the plugin fails to get ServiceNow relationships IDs, only relationsips class IDs + ## therefore, it can create relationships, but not update them. +archi.relations.*.id = sys_id +archi.relations.*.name = type#name +archi.relations.*.source = child +archi.relations.*.target = parent +archi.relations.*.folder = ${class} +archi.relations.*.property.strength = connection_strength +archi.relations.*.property.source_action = type#child_descriptor +archi.relations.*.property.target_action = type#parent_description + +# "Allocated to" +#archi.relations.04180212371a200032ff8c00dfbe5d08.archi_class = + +# "Runs" +archi.relations.0454da4c6f7e9940f0721cef8d3ee4b9.archi_class = "CompositionRelationship" + +# "Distributes" +#archi.relations.0898719c37020100dcd48c00dfbe5d43.archi_class = + +# "Dependent of" +#archi.relations.1.archi_class = + +# "Support" +#archi.relations.1f246bc1898bc100b3ced795d2f57a0d.archi_class = + +# "Sends the data to WebService" +archi.relations.2da380cc6f3ab944a77a2dc71e3ee49d.archi_class = "FlowRelationship" +archi.relations.2da380cc6f3ab944a77a2dc71e3ee49d.source = parent +archi.relations.2da380cc6f3ab944a77a2dc71e3ee49d.target = child +archi.relations.2da380cc6f3ab944a77a2dc71e3ee49d.property.source_action = type#parent_descriptor +archi.relations.2da380cc6f3ab944a77a2dc71e3ee49d.property.target_action = type#child_description + +# "Consumed by" +#archi.relations.41008aa6ef32010098d5925495c0fb94.archi_class = + +# "Sends data to" +archi.relations.4b2b24dd6f435180f0721cef8d3ee42c.archi_class = "FlowRelationship" + +# "Allocated from" +#archi.relations.51678212371a200032ff8c00dfbe5d39.archi_class = + +# "Receives a MQSeries from" +#archi.relations.778300cc6f3ab944a77a2dc71e3ee4c3.archi_class = + +# "Houses" +archi.relations.91aaac9d6f435180f0721cef8d3ee4b9.archi_class = "AssignmentRelationship" + +# "Is described in" +#archi.relations.9b98225f6fbb0500f0721cef8d3ee4fc.archi_class = + +# "Rescues" +#archi.relations.9e0e6a9f6fbb0500f0721cef8d3ee4a5.archi_class = + +# "Is hosted on" +archi.relations.a8aab4c26f395900f0721cef8d3ee44a.archi_class = "AssignmentRelationship" +archi.relations.a8aab4c26f395900f0721cef8d3ee44a.source = parent +archi.relations.a8aab4c26f395900f0721cef8d3ee44a.target = child + +# "Powered by" +#archi.relations.b76c6a5f6fbb0500f0721cef8d3ee4d0.archi_class = + +# "Sends a file to" +archi.relations.ca538c8c6f3ab944a77a2dc71e3ee4d2.archi_class = "FlowRelationship" + +# "Used by" +#archi.relations.cb5592603751200032ff8c00dfbe5d17.archi_class = + +# "Hosted on" +archi.relations.d4b4861b3791c604f5e9d2e843990ed0.archi_class = "CompositionRelationship" + +# "Contains" +archi.relations.de34b3f66f00d500f0721cef8d3ee41d.archi_class = "CompositionRelationship" + +# "Connects" +#archi.relations.e9ab20dd6f435180f0721cef8d3ee4dd.archi_class = \ No newline at end of file