Merging resources
Different Observers deployed as part of the Agile Service Manager solution may represent the same resource as different resources. To prevent the UI from depicting multiple resource views of the same resource, you can merge them into a single composite resource by assigning them the same value in their mergeTokens set.
Before you begin
- You must know your tenant ID.
- You also need to know which resources exist as duplicate records across your Observers before you can merge these into composites.
About this task
To merge resources so that they are displayed as single, composite resources in the UI, resources
must share values in their mergeTokens set. This triggers the Merge Service to create a composite
resource vertex merging those resources together.
- Merge rules
- Merge rules are applied before each observation job is sent to the topology service, and they can be manged using the Rules REST API in the Merge Service.
- Merge rule example
- The following example is the default merge rule defined for the Docker Observer.
Procedure
Using the live Swagger interface or cURL commands, write a rule for each record to be merged
into a composite record, and POST it to the Rules API.
Use the following information as guidance when defining each merge rule:
- Name
- The name of the merge rule, which must be unique within the context of the tenant.
- ruleStatus
- The rule status can be either enabled or disabled, and the observers will only apply merge rules which are in an enabled state.
- mergeTokens
- The merge tokens set in a merge rule contains the list of resource parameter names which will become merge tokens for those resources to which the rule is applied.
- entityTypes
- The entity types set in a merge rule contains the list of resources entity types for which this rule is valid.
- observers
- The observers set contains the list of names of the observers to which this rule applies.
- providers
- The providers set contains the list of names of the providers so which this rule applies.
- excludeTokens
- These properties discard any values that match the regular expression.
- includeTokens
- These properties apply a merge token only if the value matches the regular expression.
Results
After you have created and posted your merge rules, these are applied before each observation job is sent to the topology service. Composite, merged resources are displayed in the Agile Service Manager UI as a single resource, which includes the properties of all merged resources.
Example
- Resource one
- http://<your_NASM_host>/1.0/topology/resources/ABC
- Resource two
- http://<your host>/1.0/topology/resources/DEF
- Composite resource
- http://<your_NASM_host>/1.0/topology/resources/XYZ
- Resource with variable substitutions and exclude list
{ "name": "sysNameMatching", "mergeTokens": [ "sysName", "${name}/${customField}"], "ruleStatus": "enabled", "entityTypes": [ "host", "server" ], "observers": [ "ITNM", "TADDM" ], "providers": [ "*" ], "customField": "string", "excludeTokens": [ "^asm-default.*"] }
Tip: You can also view composite resources in the live Swagger Composite API in the
Merge Service, which returns the properties of the composite itself, and provides methods to get all
composite vertices: http://<your
host>/1.0/merge/swagger/#/Composites