Default DevOps Config exporters
Summarize
Summary of Default DevOps Config exporters
The Default DevOps Config exporters in ServiceNow provide predefined methods to export configuration data from deployable snapshots. These exporters, contained in the DevOps Config Exporter content pack, enable integration with other tools by allowing them to consume snapshot data for deployment and provisioning processes. While default exporters cannot be modified, customers can copy and customize them as needed.
Show less
Important: Starting with the Washington D.C. release, DevOps Config is preparing for future deprecation. It will no longer be activated on new instances but will continue to be supported for existing users.
Key Features
- Return All Data (returnAllData-now): Exports the entire snapshot content, including system variables, without filtering. Requires the application and deployable to be active.
- Return All Data Except Vars (returnAllDatanoVars-now): Exports all configuration data except variables and deployable name. Does not work for deleted applications/deployables.
- Return Data for Node Name (returnDataforNodeName-now): Exports data for a specific node by name, with options to include or exclude the node name in output. Handles errors for non-unique or missing nodes.
- Return Data for List of Nodes (returnDataForNodeNames-now): Exports data for multiple specified nodes, returning nested JSON. Provides error messages for missing or duplicate nodes in the response.
- Return Data for Path (returnDataForPath-now): Exports configuration data for a specified path in the snapshot. Returns entire content if path is empty and reports errors for invalid paths.
- Return Node List for Level (returnNodeListForLevel-now): Lists nodes at a specified depth level within the snapshot hierarchy, with optional exclusion of variables nodes.
- Return Node List for Path (returnNodeListForPath-now): Lists direct child nodes at a given path without descending into sub-nodes, supporting customization of path separator characters.
- Return Value for Key Within a Node (returnValueForKeyAtNodeName-now): Retrieves the value of a specific key within a given node’s subtree, ensuring uniqueness of the key-node combination.
- Return Value for Key Path (returnValueForKeyPath-now): Retrieves a key’s value by specifying its full path in the snapshot. Validates path presence and type (key vs node).
- Return Value for Unique Key Name (returnValueForUniqueKeyName-now): Retrieves the value of a uniquely named key across the entire snapshot. Supports multiple keys but returns the first found value with an error if duplicates exist. XML and INI formats are not supported.
Practical Considerations for ServiceNow Customers
- These exporters facilitate automation and integration by providing structured access to configuration snapshot data in multiple formats (JSON, YAML, XML, INI, RAW).
- They support granular data retrieval by node name, path, level, or specific keys, enabling tailored export for deployment pipelines or provisioning tools.
- Customers should plan for DevOps Config deprecation by reviewing dependency on these exporters and considering alternative solutions for future releases.
- Default exporters cannot be changed directly; customization requires copying an exporter for tailored needs.
- Error handling is built into exporters to manage cases like missing nodes, duplicate names, or invalid paths, providing clear messages for troubleshooting.
The DevOps Config Exporter content pack contains a set of default DevOps Config exporters of data that can be used as input for further deployment and provisioning activities.
DevOps Config exporters allow other tools to consume the data from deployable snapshots.
- returnAllData-now
- returnAllData_noVars-now
- returnDataforNodeName-now
- returnDataForNodeNames-now
- returnDataForPath-now
- returnNodeListForLevel-now
- returnNodeListForPath-now
- returnValueForKeyAtNodeName-now
- returnValueForKeyPath-now
- returnValueForUniqueKeyName-now
Return all data (returnAllData-now)
- Arguments
- appName - Application name
- deployableName - Deployable name
- requestedFormat - Requested format (json/yaml/xml/ini/raw)
- Special logic
- None.
- Error handling
- None.
Return all data except vars (returnAllData_noVars-now)
Returns all of the configuration data for the deployable, except deployable name and variables.
- vars folder at the deployable level
- vars folder at each of the included collections
- Deployable name at the root level of the response
- Arguments
- Arguments (can be provided on the command line, or entered interactively in run mode).
- appName - Application name
- deployableName - Deployable name
- requestedFormat - Requested format (json/yaml/xml/ini/raw)
- Special logic
- None.
- Error handling
- None.
Return data for a node name (returnDataforNodeName-now)
Returns the subset of the snapshot data for a given node name, which is provided as an argument. The argument value must be passed as string text.
- Arguments
- appName - Application name
- deployableName - Deployable name
- requestedFormat - Requested format (json/yaml/xml/ini/raw)
- nodeName - Node name (string, in quotes)
- includeNodeInOutput - (string, default is true)
- Special logic
- If nodeName is empty, all data is returned.
- If includeNodeInOutput is false, the node data is returned excluding the node name.
- Error handling
- If the nodeName is not unique, multiple instances of nodeName found.
- If the nodeName is not found, node not found: <nodeName>.
- If includeNodeInOutput is false and node data is a key-value pair, an error is returned.
Return data for list of nodes (returnDataForNodeNames-now)
Returns the full data from the snapshot for a list of nodes. Same as Return data for a node name but returns a nested JSON with configuration data for a list of given node names (including any child nodes).
- Arguments
- appName - Application name
- deployableName - Deployable name
- requestedFormat - Requested format (json/yaml/xml/ini/raw)
- nodeNames - Node names (string, in quotes, comma-separated)
- Special logic
- If nodeNamesList is empty, returns all config data.
- Error handling
- None.
- Response details
- {“node1”:{“contentKey”:”contentValue”},”node2”:{ “error”:”nodeName not found”}}.
- Error handling
- In case the nodeName is not unique the exporter returns an error response stating “multiple instances of nodeName found” for that specific nodeName. Other nodeNames contain the data
- If a nodeName is not found it should contain error message for that node
Return data for path (returnDataForPath-now)
Returns all of the configuration data for a given node path in the snapshot.
- Arguments
- appName - Application name
- deployableName - Deployable name
- requestedFormat - Requested format (json/yaml/xml/ini/raw)
- nodePath - Node path (string, in quotes)
- Special logic
- If nodePath is empty, return the whole content (similar to all config data).
- Error handling
- If nodePath is not found, the last node name that was not found is stated path not found: <nodeName>.
Return node list for level (returnNodeListForLevel-now)
Returns a list of names of nodes that are children of root node at specified level (depth) in the snapshot. For example, level 1 is a direct child of root node, level 2 is a grandchild, etc.
- Arguments
- appName - Application name
- deployableName - Deployable name
- requestedFormat - Requested format (json/yaml/xml/ini/raw)
- ExcludeVarsNode [true|false] - Exclude the vars node from the result (true or false, default is true)
- nodeLevel - Level of the node (integer, default is 0)
- Special logic
- If no level is specified, then exporter returns the value for level 0 (for example, the deployable root node name).
- Error handling
- None.
- Response details
- [“node1, “node2”, “node3”]
Return node list for path (returnNodeListForPath-now)
Returns the list of nodes for a given node path in the snapshot (not taking into account sub-nodes).
- Arguments
- appName - Application name
- deployableName - Deployable name
- requestedFormat - Requested format (json/yaml/xml/ini/raw)
- ExcludeVarsNode [true|false] - Exclude the vars node from the result (true or false, default is true)
- nodePath - Path to follow with list of nodes separated by pathSeparator (string, in quotes)
- pathSeparator - Character to separate list of nodePaths (string, default is ‘,’)
- Special logic
- None.
- Error handling
- None.
- Response details
- [“node1, “node2”, “node3”]
Return value for key within a node (returnValueForKeyAtNodeName-now)
Returns the value of a specific key that is part of a node in the snapshot. The key can either be directly defined to the node, or lower in the data model to one of the children of the node.
The difference between this exporter and export value for unique keyName is that the key name only needs to be unique within the subtree of the node.
Key/node combination is expected to be unique in the snapshot. If the key/node combination is found more than once, there is an error.
- Arguments
- appName - Application name
- deployableName - Deployable name
- requestedFormat - Requested format (json/yaml/xml/ini/raw)
- keyName - Key name (string, in quotes)
- nodeName - Node name (string, in quotes)
- Special logic
- None.
- Error Handling
- If keyName nodeName combination is not found an empty response is returned.
Return value for keyPath (returnValueForKeyPath-now)
Returns the value of a specific key in a specific path.
- Arguments
- appName - Application name
- deployableName - Deployable name
- requestedFormat - Requested format (json/yaml/xml/ini/raw)
- keyPath - List of node names with key name at the end separated by pathSeparator (string, in quotes)
- pathSeparator - Character to separate list of keyPaths (string, default is ‘,’)
- Special logic
- None.
- Error handling
- If the keyPath is not provided, no keyPath argument provided.
- If the keyPath is not found, states the last node name not found path not found: <path>/<nodeName>.
- If the keyPath is found and is a node (not a key), keyPath provided is a node and not a key.
Return value for unique keyName (returnValueForUniqueKeyName-now)
- Arguments
- appName - Application name
- deployableName - Deployable name
- requestedFormat - Requested format (json/yaml/raw)
- keyName - Key name (data array)
- Special logic
- If the key is present multiple times in the snapshot, the exporter returns the first value found (returns error).
- Error handling
- If the keyName is not provided, no keyName argument provided.
- If the key is not found, key not found: <keyName>.