catocli 2.1.4__py3-none-any.whl → 2.1.8__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.

@@ -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
- usage='catocli import socket_sites_to_tf <json_file> --module-name <module_name> [options]\n\nexample: catocli import socket_sites_to_tf config_data/socket_sites_11484.json --module-name module.sites'
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
- socket_sites_parser.add_argument('json_file', help='Path to the JSON file containing socket sites data')
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
- socket_sites_parser.add_argument('--batch-size', type=int, default=10,
31
- help='Number of imports per batch (default: 10)')
32
- socket_sites_parser.add_argument('--delay', type=int, default=2,
33
- help='Delay between batches in seconds (default: 2)')
34
- socket_sites_parser.add_argument('--sites-only', action='store_true',
35
- help='Import only sites, skip interfaces and network ranges')
36
- socket_sites_parser.add_argument('--wan-interfaces-only', action='store_true',
37
- help='Import only WAN interfaces, skip sites and network ranges')
38
- socket_sites_parser.add_argument('--lan-interfaces-only', action='store_true',
39
- help='Import only LAN interfaces, skip sites and network ranges')
40
- socket_sites_parser.add_argument('--network-ranges-only', action='store_true',
41
- help='Import only network ranges, skip sites and interfaces')
42
- socket_sites_parser.add_argument('-v', '--verbose', action='store_true', help='Verbose output')
43
- socket_sites_parser.add_argument('--auto-approve', action='store_true', help='Skip confirmation prompt and proceed automatically')
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