catocli 2.1.4__py3-none-any.whl → 2.1.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of catocli might be problematic. Click here for more details.
- catocli/Utils/clidriver.py +10 -8
- catocli/Utils/cliutils.py +45 -4
- catocli/__init__.py +2 -2
- catocli/clisettings.json +35 -0
- catocli/parsers/custom/export_sites/__init__.py +14 -3
- catocli/parsers/custom/export_sites/export_sites.py +635 -5
- catocli/parsers/custom/import_sites_to_tf/__init__.py +44 -16
- catocli/parsers/custom/import_sites_to_tf/import_sites_to_tf.py +732 -395
- catocli/parsers/mutation_licensing/__init__.py +24 -0
- catocli/parsers/mutation_licensing_updateCommercialLicense/README.md +19 -0
- catocli/parsers/mutation_policy/__init__.py +509 -509
- catocli/parsers/query_devices/README.md +1 -1
- catocli/parsers/query_eventsFeed/README.md +1 -1
- catocli/parsers/query_policy/__init__.py +55 -55
- {catocli-2.1.4.dist-info → catocli-2.1.6.dist-info}/METADATA +1 -1
- {catocli-2.1.4.dist-info → catocli-2.1.6.dist-info}/RECORD +25 -21
- models/mutation.licensing.updateCommercialLicense.json +931 -0
- models/query.devices.json +199 -60
- models/query.events.json +216 -0
- models/query.eventsFeed.json +48 -0
- models/query.eventsTimeSeries.json +144 -0
- {catocli-2.1.4.dist-info → catocli-2.1.6.dist-info}/WHEEL +0 -0
- {catocli-2.1.4.dist-info → catocli-2.1.6.dist-info}/entry_points.txt +0 -0
- {catocli-2.1.4.dist-info → catocli-2.1.6.dist-info}/licenses/LICENSE +0 -0
- {catocli-2.1.4.dist-info → catocli-2.1.6.dist-info}/top_level.txt +0 -0
|
@@ -20,27 +20,55 @@ def site_import_parse(subparsers, import_parser):
|
|
|
20
20
|
socket_sites_parser = import_subparsers.add_parser(
|
|
21
21
|
'socket_sites_to_tf',
|
|
22
22
|
help='Import socket sites to Terraform state',
|
|
23
|
-
|
|
23
|
+
description='Import Cato socket sites, WAN interfaces, and network ranges to Terraform state from JSON or CSV data sources.',
|
|
24
|
+
usage='''catocli import socket_sites_to_tf [options]
|
|
25
|
+
|
|
26
|
+
JSON Import Examples:
|
|
27
|
+
catocli import socket_sites_to_tf --data-type json --json-file sites.json --module-name module.sites
|
|
28
|
+
catocli import socket_sites_to_tf sites.json --module-name module.sites # Legacy format (auto-detects JSON)
|
|
29
|
+
|
|
30
|
+
CSV Import Examples:
|
|
31
|
+
catocli import socket_sites_to_tf --data-type csv --csv-file sites.csv --module-name module.sites
|
|
32
|
+
catocli import socket_sites_to_tf --data-type csv --csv-file sites.csv --csv-folder sites_config --module-name module.sites''',
|
|
33
|
+
formatter_class=import_sites_to_tf.argparse.RawDescriptionHelpFormatter
|
|
24
34
|
)
|
|
25
35
|
|
|
26
|
-
|
|
36
|
+
# Data source arguments
|
|
37
|
+
data_group = socket_sites_parser.add_argument_group('Data Source (choose one)')
|
|
38
|
+
data_group.add_argument('--data-type', choices=['json', 'csv'],
|
|
39
|
+
help='Specify data source type: json or csv')
|
|
40
|
+
data_group.add_argument('--json-file',
|
|
41
|
+
help='Path to JSON file containing socket sites data')
|
|
42
|
+
data_group.add_argument('--csv-file',
|
|
43
|
+
help='Path to main CSV file containing socket sites data')
|
|
44
|
+
data_group.add_argument('--csv-folder',
|
|
45
|
+
help='Path to folder containing per-site network ranges CSV files (optional for CSV import)')
|
|
46
|
+
|
|
47
|
+
# Backward compatibility: positional JSON file argument
|
|
48
|
+
socket_sites_parser.add_argument('json_file_legacy', nargs='?',
|
|
49
|
+
help='[LEGACY] Path to JSON file (for backward compatibility)')
|
|
50
|
+
|
|
51
|
+
# Required arguments
|
|
27
52
|
socket_sites_parser.add_argument('--module-name', required=True,
|
|
28
53
|
help='Terraform module name to import resources into')
|
|
29
54
|
socket_sites_parser.add_argument('-accountID', help='Account ID (required by CLI framework but not used for import)', required=False)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
socket_sites_parser.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
55
|
+
|
|
56
|
+
# Import options
|
|
57
|
+
import_group = socket_sites_parser.add_argument_group('Import Options')
|
|
58
|
+
import_group.add_argument('--batch-size', type=int, default=10,
|
|
59
|
+
help='Number of imports per batch (default: 10)')
|
|
60
|
+
import_group.add_argument('--delay', type=int, default=2,
|
|
61
|
+
help='Delay between batches in seconds (default: 2)')
|
|
62
|
+
import_group.add_argument('--sites-only', action='store_true',
|
|
63
|
+
help='Import only sites, skip interfaces and network ranges')
|
|
64
|
+
import_group.add_argument('--wan-interfaces-only', action='store_true',
|
|
65
|
+
help='Import only WAN interfaces, skip sites and network ranges')
|
|
66
|
+
import_group.add_argument('--lan-interfaces-only', action='store_true',
|
|
67
|
+
help='Import only LAN interfaces, skip sites and network ranges')
|
|
68
|
+
import_group.add_argument('--network-ranges-only', action='store_true',
|
|
69
|
+
help='Import only network ranges, skip sites and interfaces')
|
|
70
|
+
import_group.add_argument('-v', '--verbose', action='store_true', help='Verbose output')
|
|
71
|
+
import_group.add_argument('--auto-approve', action='store_true', help='Skip confirmation prompt and proceed automatically')
|
|
44
72
|
|
|
45
73
|
socket_sites_parser.set_defaults(func=import_sites_to_tf.import_socket_sites_to_tf)
|
|
46
74
|
|