Skip to content

Commit aa7abcc

Browse files
authored
Merge pull request #6 from IcePanel/shehab/add-namespace-section
Add namespace section in import-landscapes
2 parents 0c2931e + ca1e948 commit aa7abcc

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

fern/guides/import-diagrams.mdx

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,6 @@ tags:
11711171
```
11721172
</Accordion>
11731173

1174-
11751174
## Prune option
11761175

11771176
By default, data models that exist in IcePanel but are missing from your import file are left untouched. To have IcePanel **delete** models not present in the import file, add the `prune=true` query parameter.
@@ -1186,3 +1185,34 @@ curl -sf -X POST "https://api.icepanel.io/v1/landscapes/$ICEPANEL_LANDSCAPE_ID/v
11861185
-H "Content-Type: application/yaml" \
11871186
--data-binary @icepanel-landscape-import.yaml
11881187
```
1188+
1189+
## Namespace option
1190+
1191+
A namespace is a label that groups models by their import source. You can add a `namespace` to your import file to separate models by import source. When used with `prune=true`, only models in the same namespace are deleted. Models from other namespaces are left untouched.
1192+
1193+
This is useful for large organizations running multiple CI/CD pipelines from different repositories against the same landscape, with each pipeline managing its own models independently.
1194+
1195+
You can set the namespace in your YAML file:
1196+
1197+
```yaml
1198+
# yaml-language-server: $schema=https://api.icepanel.io/v1/schemas/LandscapeImportData
1199+
1200+
namespace: my-repo
1201+
1202+
modelObjects:
1203+
- id: system-storefront
1204+
name: Storefront
1205+
type: system
1206+
```
1207+
1208+
Or pass it directly in the request body when using JSON:
1209+
1210+
```bash
1211+
curl -sf -X POST "https://api.icepanel.io/v1/landscapes/$ICEPANEL_LANDSCAPE_ID/versions/latest/import" \
1212+
-H "X-API-Key: $ICEPANEL_API_KEY" \
1213+
-H "Content-Type: application/json" \
1214+
-d '{
1215+
"namespace": "my-repo",
1216+
"modelObjects": [...]
1217+
}'
1218+
```

0 commit comments

Comments
 (0)