Skip to content

feat: Add logic to export and import etcd catalog keys as JSON#174

Merged
subkanthi merged 5 commits into
masterfrom
ice_cli_catalog_export_import
May 21, 2026
Merged

feat: Add logic to export and import etcd catalog keys as JSON#174
subkanthi merged 5 commits into
masterfrom
ice_cli_catalog_export_import

Conversation

@subkanthi
Copy link
Copy Markdown
Collaborator

@subkanthi subkanthi commented May 21, 2026

…ON to catalog.

closes: ##27
closes: #176

@subkanthi
Copy link
Copy Markdown
Collaborator Author

subkanthi commented May 21, 2026

Export

ice catalog-export -o catalog_export.json
2026-05-21 15:23:20 [49717579-57/47868] INFO c.a.i.r.c.i.r.CatalogAdminServlet > Exported 1 namespace(s) and 13 table(s)
2026-05-21 15:23:20 [main/74519] INFO com.altinity.ice.cli.Main > Wrote catalog snapshot to catalog_export.json

Delete all keys

etcdctl del --prefix ""

Import

ice catalog-import -i catalog_export.json          
2026-05-21 15:25:25 [49717579-38/47868] INFO c.a.i.r.c.i.r.CatalogAdminServlet > Import: 14 created, 0 skipped, 0 overwritten
{
  "created" : 14,
  "skipped" : 0,
  "overwritten" : 0,
  "catalog_name" : "default",
  "exported_at" : "2026-05-21T20:23:20.555925Z"
}
ice list-tables ontime            
2026-05-21 15:26:57 [49717579-41/47868] INFO c.a.i.r.c.i.r.RESTCatalogServlet > @token:anonymous GET v1/config
2026-05-21 15:26:57 [49717579-42/47868] INFO c.a.i.r.c.i.r.RESTCatalogServlet > @token:anonymous GET v1/namespaces/ontime/tables
---
namespace: ontime
tables:
- ontime.testmay6_17_01
- ontime.testmay6_19_01
- ontime.testmay7_13_01
- ontime.testmay7_15_01
- ontime.testmay7_16_01
- ontime.testmay7_16_02
- ontime.testmay7_17_02
- ontime.testmay7_17_03
- ontime.testmay7_17_04
- ontime.testmay7_17_05
- ontime.testmay7_17_06
- ontime.testmay7_17_07
- ontime.testmay9_17_07

@subkanthi subkanthi marked this pull request as ready for review May 21, 2026 20:23
@subkanthi subkanthi requested a review from xieandrew May 21, 2026 20:25
Copy link
Copy Markdown
Collaborator

@xieandrew xieandrew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionality looks good, tested locally with 1 and 3 node etcd using docker compose. I have a couple comments on a potential security issue with the endpoints and an edge case error.

Also, it would be nice if there was a test in EtcdCatalogIT for this, but we could add it in a later PR.

Comment thread ice-rest-catalog/src/main/java/com/altinity/ice/rest/catalog/Main.java Outdated
Comment thread ice/src/main/java/com/altinity/ice/cli/Main.java
Comment thread ice/src/main/java/com/altinity/ice/cli/Main.java Outdated
@subkanthi subkanthi requested a review from xieandrew May 21, 2026 21:44
Copy link
Copy Markdown
Collaborator

@xieandrew xieandrew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@xieandrew xieandrew changed the title Added logic to export etcd catalog keys as JSON and import it from JS… feat: Add logic to export and import etcd catalog keys as JSON May 21, 2026
@subkanthi subkanthi merged commit 204d30f into master May 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ice cli command to export/import catalog data

2 participants