-
Notifications
You must be signed in to change notification settings - Fork 6
Combine Command
Raju Gurram edited this page Dec 20, 2025
·
1 revision
The combine command merges two or more Gateway configuration bundles into a single unified bundle. This is useful for consolidating configurations from multiple sources or environments.
graphman combine --inputs <input-file> <input-file> ... [--output <output-file>]| Parameter | Description |
|---|---|
--inputs |
Two or more input bundle files to combine. At least two bundles are required. |
| Parameter | Description | Default |
|---|---|---|
--output |
Specify the output file to save the combined bundle | Standard output (console) |
When combining bundles, the command follows these rules:
- Rightmost Precedence: When similar entities are encountered across multiple bundles, entities from the rightmost bundle take precedence
- Entity Matching: Entities are matched based on their identifying attributes (e.g., name, GUID)
- Non-duplicate Preservation: Unique entities from all bundles are preserved in the result
- Automatic Sorting: The output bundle is automatically sorted for consistency
The combine operation processes bundles from left to right:
- All entities from the rightmost bundle are added first
- Entities from other bundles are added only if they don't already exist
- The final result contains all unique entities with rightmost precedence for duplicates
Combine two bundles into one:
graphman combine --inputs bundle1.json bundle2.json --output combined.jsonCombine three or more bundles:
graphman combine --inputs base.json dev.json prod.json --output final.jsonIn this example:
- Entities unique to
base.jsonare included - Entities unique to
dev.jsonare included - Entities from
prod.jsonoverride any matching entities frombase.jsonordev.json
Combine bundles and output to standard output:
graphman combine --inputs bundle1.json bundle2.jsonCombine a base configuration with environment-specific overrides:
graphman combine --inputs base-config.json production-overrides.json --output prod-config.jsonBuild up a configuration from multiple smaller bundles:
graphman combine \
--inputs core-services.json \
security-policies.json \
custom-assertions.json \
--output complete-config.jsonMerge configurations from multiple gateways into a unified bundle:
graphman combine --inputs gateway1.json gateway2.json gateway3.json --output consolidated.json- Minimum Requirement: At least two input bundles must be provided
- Entity Identification: Entities are matched using their unique identifiers (typically name and/or GUID)
- Precedence Rule: Always remember that rightmost bundles take precedence in case of conflicts
- Automatic Sorting: The output is automatically sorted, ensuring consistent formatting
- File Format: All input files must be valid Gateway configuration bundles in JSON format
The command will fail if:
- The
--inputsparameter is missing - Fewer than two input bundles are provided
- Any input file cannot be read or is not a valid bundle format
- export: Export configuration from a Gateway
- import: Import a bundle to a Gateway
- diff: Compare two bundles to see differences
The combine operation uses the following algorithm:
- Initialize an empty result bundle
- Process the rightmost bundle first, adding all its entities to the result
- Process remaining bundles from left to right:
- For each entity in the current bundle
- Check if a matching entity exists in the result
- If no match is found, add the entity to the result
- Sort the final result bundle for consistent output