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

Files changed (365) hide show
  1. catocli/Utils/clidriver.py +32 -4
  2. catocli/Utils/version_checker.py +1 -1
  3. catocli/__init__.py +1 -1
  4. catocli/parsers/custom/export_sites/export_sites.py +18 -1
  5. catocli/parsers/custom/import_rules_to_tf/import_rules_to_tf.py +13 -2
  6. catocli/parsers/custom/import_sites_to_tf/__init__.py +3 -1
  7. catocli/parsers/custom/import_sites_to_tf/import_sites_to_tf.py +79 -6
  8. catocli/parsers/custom_private/__init__.py +134 -0
  9. catocli/parsers/mutation_accountManagement/__init__.py +13 -0
  10. catocli/parsers/mutation_accountManagement_disableAccount/README.md +16 -0
  11. catocli/parsers/mutation_groups/README.md +7 -0
  12. catocli/parsers/mutation_groups/__init__.py +48 -0
  13. catocli/parsers/mutation_groups_createGroup/README.md +18 -0
  14. catocli/parsers/mutation_groups_deleteGroup/README.md +18 -0
  15. catocli/parsers/mutation_groups_updateGroup/README.md +18 -0
  16. catocli/parsers/mutation_site/__init__.py +104 -0
  17. catocli/parsers/mutation_site_assignSiteBwLicense/README.md +17 -0
  18. catocli/parsers/mutation_site_removeSecondaryAwsVSocket/README.md +17 -0
  19. catocli/parsers/mutation_site_removeSecondaryAzureVSocket/README.md +17 -0
  20. catocli/parsers/mutation_site_removeSiteBwLicense/README.md +17 -0
  21. catocli/parsers/mutation_site_replaceSiteBwLicense/README.md +17 -0
  22. catocli/parsers/mutation_site_updateSecondaryAwsVSocket/README.md +17 -0
  23. catocli/parsers/mutation_site_updateSecondaryAzureVSocket/README.md +17 -0
  24. catocli/parsers/mutation_site_updateSiteBwLicense/README.md +17 -0
  25. catocli/parsers/mutation_site_updateSiteGeneralDetails/README.md +1 -1
  26. catocli/parsers/mutation_sites/__init__.py +104 -0
  27. catocli/parsers/mutation_sites_assignSiteBwLicense/README.md +17 -0
  28. catocli/parsers/mutation_sites_removeSecondaryAwsVSocket/README.md +17 -0
  29. catocli/parsers/mutation_sites_removeSecondaryAzureVSocket/README.md +17 -0
  30. catocli/parsers/mutation_sites_removeSiteBwLicense/README.md +17 -0
  31. catocli/parsers/mutation_sites_replaceSiteBwLicense/README.md +17 -0
  32. catocli/parsers/mutation_sites_updateSecondaryAwsVSocket/README.md +17 -0
  33. catocli/parsers/mutation_sites_updateSecondaryAzureVSocket/README.md +17 -0
  34. catocli/parsers/mutation_sites_updateSiteBwLicense/README.md +17 -0
  35. catocli/parsers/mutation_sites_updateSiteGeneralDetails/README.md +1 -1
  36. catocli/parsers/parserApiClient.py +444 -9
  37. catocli/parsers/query_eventsFeed/README.md +1 -1
  38. catocli/parsers/query_groups/README.md +7 -0
  39. catocli/parsers/query_groups/__init__.py +54 -0
  40. catocli/parsers/query_groups_group/README.md +7 -0
  41. catocli/parsers/query_groups_groupList/README.md +18 -0
  42. catocli/parsers/query_groups_group_members/README.md +18 -0
  43. catocli/parsers/query_groups_whereUsed/README.md +17 -0
  44. catocli/parsers/query_popLocations/README.md +17 -0
  45. catocli/parsers/query_popLocations/__init__.py +16 -0
  46. catocli/parsers/query_site/__init__.py +26 -0
  47. catocli/parsers/query_site_secondaryAwsVSocket/README.md +17 -0
  48. catocli/parsers/query_site_secondaryAzureVSocket/README.md +17 -0
  49. catocli/parsers/query_socketPortMetrics/README.md +23 -0
  50. catocli/parsers/query_socketPortMetrics/__init__.py +16 -0
  51. catocli/parsers/query_socketPortMetricsTimeSeries/README.md +24 -0
  52. catocli/parsers/query_socketPortMetricsTimeSeries/__init__.py +16 -0
  53. {catocli-2.0.5.dist-info → catocli-2.1.1.dist-info}/METADATA +3 -2
  54. {catocli-2.0.5.dist-info → catocli-2.1.1.dist-info}/RECORD +253 -300
  55. {catocli-2.0.5.dist-info → catocli-2.1.1.dist-info}/WHEEL +1 -1
  56. {catocli-2.0.5.dist-info → catocli-2.1.1.dist-info}/top_level.txt +0 -2
  57. graphql_client/api/call_api.py +20 -2
  58. models/mutation.accountManagement.addAccount.json +97 -0
  59. models/mutation.accountManagement.disableAccount.json +545 -0
  60. models/mutation.accountManagement.removeAccount.json +102 -3
  61. models/mutation.accountManagement.updateAccount.json +97 -0
  62. models/mutation.admin.addAdmin.json +6 -9
  63. models/mutation.container.delete.json +2 -2
  64. models/mutation.container.fqdn.addValues.json +3 -3
  65. models/mutation.container.fqdn.createFromFile.json +3 -3
  66. models/mutation.container.fqdn.removeValues.json +3 -3
  67. models/mutation.container.fqdn.updateFromFile.json +3 -3
  68. models/mutation.container.ipAddressRange.addValues.json +3 -3
  69. models/mutation.container.ipAddressRange.createFromFile.json +3 -3
  70. models/mutation.container.ipAddressRange.removeValues.json +3 -3
  71. models/mutation.container.ipAddressRange.updateFromFile.json +3 -3
  72. models/mutation.groups.createGroup.json +3178 -0
  73. models/mutation.groups.deleteGroup.json +2758 -0
  74. models/mutation.groups.updateGroup.json +4429 -0
  75. models/mutation.hardware.updateHardwareShipping.json +30 -10
  76. models/mutation.policy.appTenantRestriction.addRule.json +33 -33
  77. models/mutation.policy.appTenantRestriction.addSection.json +4 -4
  78. models/mutation.policy.appTenantRestriction.createPolicyRevision.json +33 -33
  79. models/mutation.policy.appTenantRestriction.discardPolicyRevision.json +33 -33
  80. models/mutation.policy.appTenantRestriction.moveRule.json +27 -27
  81. models/mutation.policy.appTenantRestriction.moveSection.json +4 -4
  82. models/mutation.policy.appTenantRestriction.publishPolicyRevision.json +33 -33
  83. models/mutation.policy.appTenantRestriction.removeRule.json +27 -27
  84. models/mutation.policy.appTenantRestriction.removeSection.json +4 -4
  85. models/mutation.policy.appTenantRestriction.updatePolicy.json +33 -33
  86. models/mutation.policy.appTenantRestriction.updateRule.json +33 -33
  87. models/mutation.policy.appTenantRestriction.updateSection.json +4 -4
  88. models/mutation.policy.dynamicIpAllocation.addRule.json +12 -12
  89. models/mutation.policy.dynamicIpAllocation.addSection.json +4 -4
  90. models/mutation.policy.dynamicIpAllocation.createPolicyRevision.json +18 -18
  91. models/mutation.policy.dynamicIpAllocation.discardPolicyRevision.json +18 -18
  92. models/mutation.policy.dynamicIpAllocation.moveRule.json +12 -12
  93. models/mutation.policy.dynamicIpAllocation.moveSection.json +4 -4
  94. models/mutation.policy.dynamicIpAllocation.publishPolicyRevision.json +18 -18
  95. models/mutation.policy.dynamicIpAllocation.removeRule.json +12 -12
  96. models/mutation.policy.dynamicIpAllocation.removeSection.json +4 -4
  97. models/mutation.policy.dynamicIpAllocation.updatePolicy.json +18 -18
  98. models/mutation.policy.dynamicIpAllocation.updateRule.json +12 -12
  99. models/mutation.policy.dynamicIpAllocation.updateSection.json +4 -4
  100. models/mutation.policy.internetFirewall.addRule.json +141 -141
  101. models/mutation.policy.internetFirewall.addSection.json +4 -4
  102. models/mutation.policy.internetFirewall.createPolicyRevision.json +102 -102
  103. models/mutation.policy.internetFirewall.discardPolicyRevision.json +102 -102
  104. models/mutation.policy.internetFirewall.moveRule.json +96 -96
  105. models/mutation.policy.internetFirewall.moveSection.json +4 -4
  106. models/mutation.policy.internetFirewall.publishPolicyRevision.json +102 -102
  107. models/mutation.policy.internetFirewall.removeRule.json +96 -96
  108. models/mutation.policy.internetFirewall.removeSection.json +4 -4
  109. models/mutation.policy.internetFirewall.updatePolicy.json +102 -102
  110. models/mutation.policy.internetFirewall.updateRule.json +141 -141
  111. models/mutation.policy.internetFirewall.updateSection.json +4 -4
  112. models/mutation.policy.remotePortFwd.addRule.json +21 -21
  113. models/mutation.policy.remotePortFwd.addSection.json +4 -4
  114. models/mutation.policy.remotePortFwd.createPolicyRevision.json +24 -24
  115. models/mutation.policy.remotePortFwd.discardPolicyRevision.json +24 -24
  116. models/mutation.policy.remotePortFwd.moveRule.json +18 -18
  117. models/mutation.policy.remotePortFwd.moveSection.json +4 -4
  118. models/mutation.policy.remotePortFwd.publishPolicyRevision.json +24 -24
  119. models/mutation.policy.remotePortFwd.removeRule.json +18 -18
  120. models/mutation.policy.remotePortFwd.removeSection.json +4 -4
  121. models/mutation.policy.remotePortFwd.updatePolicy.json +24 -24
  122. models/mutation.policy.remotePortFwd.updateRule.json +21 -21
  123. models/mutation.policy.remotePortFwd.updateSection.json +4 -4
  124. models/mutation.policy.socketLan.addRule.json +97 -97
  125. models/mutation.policy.socketLan.addSection.json +4 -4
  126. models/mutation.policy.socketLan.createPolicyRevision.json +91 -91
  127. models/mutation.policy.socketLan.discardPolicyRevision.json +91 -91
  128. models/mutation.policy.socketLan.moveRule.json +85 -85
  129. models/mutation.policy.socketLan.moveSection.json +4 -4
  130. models/mutation.policy.socketLan.publishPolicyRevision.json +91 -91
  131. models/mutation.policy.socketLan.removeRule.json +85 -85
  132. models/mutation.policy.socketLan.removeSection.json +4 -4
  133. models/mutation.policy.socketLan.updatePolicy.json +91 -91
  134. models/mutation.policy.socketLan.updateRule.json +97 -97
  135. models/mutation.policy.socketLan.updateSection.json +4 -4
  136. models/mutation.policy.terminalServer.addRule.json +7 -7
  137. models/mutation.policy.terminalServer.addSection.json +4 -4
  138. models/mutation.policy.terminalServer.createPolicyRevision.json +13 -13
  139. models/mutation.policy.terminalServer.discardPolicyRevision.json +13 -13
  140. models/mutation.policy.terminalServer.moveRule.json +7 -7
  141. models/mutation.policy.terminalServer.moveSection.json +4 -4
  142. models/mutation.policy.terminalServer.publishPolicyRevision.json +13 -13
  143. models/mutation.policy.terminalServer.removeRule.json +7 -7
  144. models/mutation.policy.terminalServer.removeSection.json +4 -4
  145. models/mutation.policy.terminalServer.updatePolicy.json +13 -13
  146. models/mutation.policy.terminalServer.updateRule.json +7 -7
  147. models/mutation.policy.terminalServer.updateSection.json +4 -4
  148. models/mutation.policy.wanFirewall.addRule.json +157 -157
  149. models/mutation.policy.wanFirewall.addSection.json +4 -4
  150. models/mutation.policy.wanFirewall.createPolicyRevision.json +121 -121
  151. models/mutation.policy.wanFirewall.discardPolicyRevision.json +121 -121
  152. models/mutation.policy.wanFirewall.moveRule.json +115 -115
  153. models/mutation.policy.wanFirewall.moveSection.json +4 -4
  154. models/mutation.policy.wanFirewall.publishPolicyRevision.json +121 -121
  155. models/mutation.policy.wanFirewall.removeRule.json +115 -115
  156. models/mutation.policy.wanFirewall.removeSection.json +4 -4
  157. models/mutation.policy.wanFirewall.updatePolicy.json +121 -121
  158. models/mutation.policy.wanFirewall.updateRule.json +157 -157
  159. models/mutation.policy.wanFirewall.updateSection.json +4 -4
  160. models/mutation.policy.wanNetwork.addRule.json +103 -103
  161. models/mutation.policy.wanNetwork.addSection.json +4 -4
  162. models/mutation.policy.wanNetwork.createPolicyRevision.json +97 -97
  163. models/mutation.policy.wanNetwork.discardPolicyRevision.json +97 -97
  164. models/mutation.policy.wanNetwork.moveRule.json +91 -91
  165. models/mutation.policy.wanNetwork.moveSection.json +4 -4
  166. models/mutation.policy.wanNetwork.publishPolicyRevision.json +97 -97
  167. models/mutation.policy.wanNetwork.removeRule.json +91 -91
  168. models/mutation.policy.wanNetwork.removeSection.json +4 -4
  169. models/mutation.policy.wanNetwork.updatePolicy.json +97 -97
  170. models/mutation.policy.wanNetwork.updateRule.json +103 -103
  171. models/mutation.policy.wanNetwork.updateSection.json +4 -4
  172. models/mutation.site.addBgpPeer.json +10 -10
  173. models/mutation.site.addIpsecIkeV2SiteTunnels.json +2 -2
  174. models/mutation.site.addSocketAddOnCard.json +2 -2
  175. models/mutation.site.assignSiteBwLicense.json +12879 -0
  176. models/mutation.site.removeBgpPeer.json +10 -10
  177. models/mutation.site.removeIpsecIkeV2SiteTunnels.json +2 -2
  178. models/mutation.site.removeSecondaryAwsVSocket.json +375 -0
  179. models/mutation.site.removeSecondaryAzureVSocket.json +354 -0
  180. models/mutation.site.removeSiteBwLicense.json +12822 -0
  181. models/mutation.site.removeSocketAddOnCard.json +2 -2
  182. models/mutation.site.replaceSiteBwLicense.json +12939 -0
  183. models/mutation.site.startSiteUpgrade.json +36 -15
  184. models/mutation.site.updateBgpPeer.json +10 -10
  185. models/mutation.site.updateIpsecIkeV2SiteTunnels.json +2 -2
  186. models/mutation.site.updateSecondaryAwsVSocket.json +643 -0
  187. models/mutation.site.updateSecondaryAzureVSocket.json +565 -0
  188. models/mutation.site.updateSiteBwLicense.json +12882 -0
  189. models/mutation.site.updateSiteGeneralDetails.json +724 -1
  190. models/mutation.sites.addBgpPeer.json +10 -10
  191. models/mutation.sites.addIpsecIkeV2SiteTunnels.json +2 -2
  192. models/mutation.sites.addSocketAddOnCard.json +2 -2
  193. models/mutation.sites.assignSiteBwLicense.json +12879 -0
  194. models/mutation.sites.removeBgpPeer.json +10 -10
  195. models/mutation.sites.removeIpsecIkeV2SiteTunnels.json +2 -2
  196. models/mutation.sites.removeSecondaryAwsVSocket.json +375 -0
  197. models/mutation.sites.removeSecondaryAzureVSocket.json +354 -0
  198. models/mutation.sites.removeSiteBwLicense.json +12822 -0
  199. models/mutation.sites.removeSocketAddOnCard.json +2 -2
  200. models/mutation.sites.replaceSiteBwLicense.json +12939 -0
  201. models/mutation.sites.startSiteUpgrade.json +36 -15
  202. models/mutation.sites.updateBgpPeer.json +10 -10
  203. models/mutation.sites.updateIpsecIkeV2SiteTunnels.json +2 -2
  204. models/mutation.sites.updateSecondaryAwsVSocket.json +643 -0
  205. models/mutation.sites.updateSecondaryAzureVSocket.json +565 -0
  206. models/mutation.sites.updateSiteBwLicense.json +12882 -0
  207. models/mutation.sites.updateSiteGeneralDetails.json +724 -1
  208. models/mutation.xdr.addStoryComment.json +1 -1
  209. models/mutation.xdr.analystFeedback.json +84 -84
  210. models/mutation.xdr.deleteStoryComment.json +1 -1
  211. models/query.accountManagement.json +97 -0
  212. models/query.accountMetrics.json +45 -45
  213. models/query.accountSnapshot.json +30 -30
  214. models/query.admin.json +6 -6
  215. models/query.admins.json +13 -13
  216. models/query.appStats.json +915 -867
  217. models/query.appStatsTimeSeries.json +692 -656
  218. models/query.auditFeed.json +6 -6
  219. models/query.catalogs.json +52 -52
  220. models/query.container.json +16 -16
  221. models/query.devices.json +20 -93
  222. models/query.entityLookup.json +2 -2
  223. models/query.events.json +288 -384
  224. models/query.eventsFeed.json +73 -97
  225. models/query.eventsTimeSeries.json +219 -291
  226. models/query.groups.group.members.json +3058 -0
  227. models/query.groups.groupList.json +6474 -0
  228. models/query.groups.whereUsed.json +697 -0
  229. models/query.hardware.json +27 -7
  230. models/query.hardwareManagement.json +8 -8
  231. models/query.licensing.json +3487 -1324
  232. models/query.policy.appTenantRestriction.policy.json +32 -32
  233. models/query.policy.dynamicIpAllocation.policy.json +18 -18
  234. models/query.policy.internetFirewall.policy.json +93 -93
  235. models/query.policy.remotePortFwd.policy.json +23 -23
  236. models/query.policy.socketLan.policy.json +88 -88
  237. models/query.policy.terminalServer.policy.json +13 -13
  238. models/query.policy.wanFirewall.policy.json +111 -111
  239. models/query.policy.wanNetwork.policy.json +97 -97
  240. models/query.popLocations.json +2878 -0
  241. models/query.sandbox.json +5 -5
  242. models/query.site.bgpPeer.json +4 -4
  243. models/query.site.bgpPeerList.json +10 -10
  244. models/query.site.secondaryAwsVSocket.json +340 -0
  245. models/query.site.secondaryAzureVSocket.json +319 -0
  246. models/query.site.siteBgpStatus.json +2 -2
  247. models/query.socketPortMetrics.json +2410 -0
  248. models/query.socketPortMetricsTimeSeries.json +2361 -0
  249. models/query.xdr.stories.json +104 -104
  250. models/query.xdr.story.json +93 -93
  251. schema/catolib.py +43 -16
  252. build/lib/catocli/Utils/clidriver.py +0 -268
  253. build/lib/catocli/Utils/profile_manager.py +0 -188
  254. build/lib/catocli/Utils/version_checker.py +0 -192
  255. build/lib/catocli/__init__.py +0 -2
  256. build/lib/catocli/__main__.py +0 -12
  257. build/lib/catocli/parsers/configure/__init__.py +0 -115
  258. build/lib/catocli/parsers/configure/configure.py +0 -307
  259. build/lib/catocli/parsers/custom/__init__.py +0 -57
  260. build/lib/catocli/parsers/custom/customLib.py +0 -561
  261. build/lib/catocli/parsers/custom/export_rules/__init__.py +0 -42
  262. build/lib/catocli/parsers/custom/export_rules/export_rules.py +0 -234
  263. build/lib/catocli/parsers/custom/export_sites/__init__.py +0 -21
  264. build/lib/catocli/parsers/custom/export_sites/export_sites.py +0 -372
  265. build/lib/catocli/parsers/custom/import_rules_to_tf/__init__.py +0 -58
  266. build/lib/catocli/parsers/custom/import_rules_to_tf/import_rules_to_tf.py +0 -451
  267. build/lib/catocli/parsers/custom/import_sites_to_tf/__init__.py +0 -45
  268. build/lib/catocli/parsers/custom/import_sites_to_tf/import_sites_to_tf.py +0 -891
  269. build/lib/catocli/parsers/mutation_accountManagement/__init__.py +0 -48
  270. build/lib/catocli/parsers/mutation_admin/__init__.py +0 -48
  271. build/lib/catocli/parsers/mutation_container/__init__.py +0 -138
  272. build/lib/catocli/parsers/mutation_hardware/__init__.py +0 -22
  273. build/lib/catocli/parsers/mutation_policy/__init__.py +0 -1305
  274. build/lib/catocli/parsers/mutation_sandbox/__init__.py +0 -35
  275. build/lib/catocli/parsers/mutation_site/__init__.py +0 -373
  276. build/lib/catocli/parsers/mutation_sites/__init__.py +0 -373
  277. build/lib/catocli/parsers/mutation_xdr/__init__.py +0 -48
  278. build/lib/catocli/parsers/parserApiClient.py +0 -513
  279. build/lib/catocli/parsers/query_accountBySubdomain/__init__.py +0 -16
  280. build/lib/catocli/parsers/query_accountManagement/__init__.py +0 -16
  281. build/lib/catocli/parsers/query_accountMetrics/__init__.py +0 -16
  282. build/lib/catocli/parsers/query_accountRoles/__init__.py +0 -16
  283. build/lib/catocli/parsers/query_accountSnapshot/__init__.py +0 -16
  284. build/lib/catocli/parsers/query_admin/__init__.py +0 -16
  285. build/lib/catocli/parsers/query_admins/__init__.py +0 -16
  286. build/lib/catocli/parsers/query_appStats/__init__.py +0 -16
  287. build/lib/catocli/parsers/query_appStatsTimeSeries/__init__.py +0 -16
  288. build/lib/catocli/parsers/query_auditFeed/__init__.py +0 -16
  289. build/lib/catocli/parsers/query_catalogs/__init__.py +0 -16
  290. build/lib/catocli/parsers/query_container/__init__.py +0 -16
  291. build/lib/catocli/parsers/query_devices/__init__.py +0 -16
  292. build/lib/catocli/parsers/query_entityLookup/__init__.py +0 -16
  293. build/lib/catocli/parsers/query_events/__init__.py +0 -16
  294. build/lib/catocli/parsers/query_eventsFeed/__init__.py +0 -16
  295. build/lib/catocli/parsers/query_eventsTimeSeries/__init__.py +0 -16
  296. build/lib/catocli/parsers/query_hardware/__init__.py +0 -16
  297. build/lib/catocli/parsers/query_hardwareManagement/__init__.py +0 -16
  298. build/lib/catocli/parsers/query_licensing/__init__.py +0 -16
  299. build/lib/catocli/parsers/query_policy/__init__.py +0 -161
  300. build/lib/catocli/parsers/query_sandbox/__init__.py +0 -16
  301. build/lib/catocli/parsers/query_site/__init__.py +0 -100
  302. build/lib/catocli/parsers/query_siteLocation/__init__.py +0 -13
  303. build/lib/catocli/parsers/query_subDomains/__init__.py +0 -16
  304. build/lib/catocli/parsers/query_xdr/__init__.py +0 -35
  305. build/lib/catocli/parsers/raw/__init__.py +0 -12
  306. build/lib/graphql_client/__init__.py +0 -11
  307. build/lib/graphql_client/api/__init__.py +0 -3
  308. build/lib/graphql_client/api/call_api.py +0 -84
  309. build/lib/graphql_client/api_client.py +0 -192
  310. build/lib/graphql_client/api_client_types.py +0 -409
  311. build/lib/graphql_client/configuration.py +0 -232
  312. build/lib/graphql_client/models/__init__.py +0 -13
  313. build/lib/graphql_client/models/no_schema.py +0 -71
  314. build/lib/schema/catolib.py +0 -1141
  315. build/lib/schema/importSchema.py +0 -60
  316. build/lib/schema/remove_policyid.py +0 -89
  317. build/lib/schema/remove_policyid_mutations.py +0 -89
  318. build/lib/scripts/catolib.py +0 -62
  319. build/lib/scripts/export_if_rules_to_json.py +0 -188
  320. build/lib/scripts/export_wf_rules_to_json.py +0 -111
  321. build/lib/scripts/import_wf_rules_to_tfstate.py +0 -331
  322. build/lib/vendor/certifi/__init__.py +0 -4
  323. build/lib/vendor/certifi/__main__.py +0 -12
  324. build/lib/vendor/certifi/core.py +0 -114
  325. build/lib/vendor/certifi/py.typed +0 -0
  326. build/lib/vendor/six.py +0 -998
  327. build/lib/vendor/urllib3/__init__.py +0 -211
  328. build/lib/vendor/urllib3/_base_connection.py +0 -172
  329. build/lib/vendor/urllib3/_collections.py +0 -483
  330. build/lib/vendor/urllib3/_request_methods.py +0 -278
  331. build/lib/vendor/urllib3/_version.py +0 -16
  332. build/lib/vendor/urllib3/connection.py +0 -1033
  333. build/lib/vendor/urllib3/connectionpool.py +0 -1182
  334. build/lib/vendor/urllib3/contrib/__init__.py +0 -0
  335. build/lib/vendor/urllib3/contrib/emscripten/__init__.py +0 -18
  336. build/lib/vendor/urllib3/contrib/emscripten/connection.py +0 -254
  337. build/lib/vendor/urllib3/contrib/emscripten/fetch.py +0 -418
  338. build/lib/vendor/urllib3/contrib/emscripten/request.py +0 -22
  339. build/lib/vendor/urllib3/contrib/emscripten/response.py +0 -285
  340. build/lib/vendor/urllib3/contrib/pyopenssl.py +0 -552
  341. build/lib/vendor/urllib3/contrib/socks.py +0 -228
  342. build/lib/vendor/urllib3/exceptions.py +0 -321
  343. build/lib/vendor/urllib3/fields.py +0 -341
  344. build/lib/vendor/urllib3/filepost.py +0 -89
  345. build/lib/vendor/urllib3/http2/__init__.py +0 -53
  346. build/lib/vendor/urllib3/http2/connection.py +0 -356
  347. build/lib/vendor/urllib3/http2/probe.py +0 -87
  348. build/lib/vendor/urllib3/poolmanager.py +0 -637
  349. build/lib/vendor/urllib3/py.typed +0 -2
  350. build/lib/vendor/urllib3/response.py +0 -1265
  351. build/lib/vendor/urllib3/util/__init__.py +0 -42
  352. build/lib/vendor/urllib3/util/connection.py +0 -137
  353. build/lib/vendor/urllib3/util/proxy.py +0 -43
  354. build/lib/vendor/urllib3/util/request.py +0 -256
  355. build/lib/vendor/urllib3/util/response.py +0 -101
  356. build/lib/vendor/urllib3/util/retry.py +0 -533
  357. build/lib/vendor/urllib3/util/ssl_.py +0 -513
  358. build/lib/vendor/urllib3/util/ssl_match_hostname.py +0 -159
  359. build/lib/vendor/urllib3/util/ssltransport.py +0 -276
  360. build/lib/vendor/urllib3/util/timeout.py +0 -275
  361. build/lib/vendor/urllib3/util/url.py +0 -471
  362. build/lib/vendor/urllib3/util/util.py +0 -42
  363. build/lib/vendor/urllib3/util/wait.py +0 -124
  364. {catocli-2.0.5.dist-info → catocli-2.1.1.dist-info}/entry_points.txt +0 -0
  365. {catocli-2.0.5.dist-info → catocli-2.1.1.dist-info/licenses}/LICENSE +0 -0
@@ -1,58 +0,0 @@
1
- import catocli.parsers.custom.import_rules_to_tf.import_rules_to_tf as import_rules_to_tf
2
-
3
- def rule_import_parse(subparsers):
4
- """Create import command parsers"""
5
-
6
- # Create the main import parser
7
- import_parser = subparsers.add_parser('import', help='Import data from various sources', usage='catocli import <operation> [options]')
8
- import_subparsers = import_parser.add_subparsers(description='valid import operations', help='additional help')
9
-
10
- # Add if_rules_to_tf command
11
- if_rules_parser = import_subparsers.add_parser(
12
- 'if_rules_to_tf',
13
- help='Import Internet Firewall rules to Terraform state',
14
- usage='catocli import if_rules_to_tf <json_file> --module-name <module_name> [options]\n\nexample: catocli import if_rules_to_tf config_data/all_wf_rules_and_sections.json --module-name module.if_rules'
15
- )
16
-
17
- if_rules_parser.add_argument('json_file', help='Path to the JSON file containing IFW rules and sections')
18
- if_rules_parser.add_argument('--module-name', required=True,
19
- help='Terraform module name to import resources into')
20
- if_rules_parser.add_argument('-accountID', help='Account ID (required by CLI framework but not used for import)', required=False)
21
- if_rules_parser.add_argument('--batch-size', type=int, default=10,
22
- help='Number of imports per batch (default: 10)')
23
- if_rules_parser.add_argument('--delay', type=int, default=2,
24
- help='Delay between batches in seconds (default: 2)')
25
- if_rules_parser.add_argument('--rules-only', action='store_true',
26
- help='Import only rules, skip sections')
27
- if_rules_parser.add_argument('--sections-only', action='store_true',
28
- help='Import only sections, skip rules')
29
- if_rules_parser.add_argument('-v', '--verbose', action='store_true', help='Verbose output')
30
- if_rules_parser.add_argument('--auto-approve', action='store_true', help='Skip confirmation prompt and proceed automatically')
31
-
32
- if_rules_parser.set_defaults(func=import_rules_to_tf.import_if_rules_to_tf)
33
-
34
- # Add wf_rules_to_tf command
35
- wf_rules_parser = import_subparsers.add_parser(
36
- 'wf_rules_to_tf',
37
- help='Import WAN Firewall rules to Terraform state',
38
- usage='catocli import wf_rules_to_tf <json_file> --module-name <module_name> [options]\n\nexample: catocli import wf_rules_to_tf config_data/all_wf_rules_and_sections.json --module-name module.wf_rules'
39
- )
40
-
41
- wf_rules_parser.add_argument('json_file', help='Path to the JSON file containing WF rules and sections')
42
- wf_rules_parser.add_argument('--module-name', required=True,
43
- help='Terraform module name to import resources into')
44
- wf_rules_parser.add_argument('-accountID', help='Account ID (required by CLI framework but not used for import)', required=False)
45
- wf_rules_parser.add_argument('--batch-size', type=int, default=10,
46
- help='Number of imports per batch (default: 10)')
47
- wf_rules_parser.add_argument('--delay', type=int, default=2,
48
- help='Delay between batches in seconds (default: 2)')
49
- wf_rules_parser.add_argument('--rules-only', action='store_true',
50
- help='Import only rules, skip sections')
51
- wf_rules_parser.add_argument('--sections-only', action='store_true',
52
- help='Import only sections, skip rules')
53
- wf_rules_parser.add_argument('-v', '--verbose', action='store_true', help='Verbose output')
54
- wf_rules_parser.add_argument('--auto-approve', action='store_true', help='Skip confirmation prompt and proceed automatically')
55
-
56
- wf_rules_parser.set_defaults(func=import_rules_to_tf.import_wf_rules_to_tf)
57
-
58
- return import_parser
@@ -1,451 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- Direct Terraform Import Script using Python
4
- Imports firewall rules and sections directly using subprocess calls to terraform import
5
- Reads from JSON structure exported from Cato API
6
- Adapted from scripts/import_if_rules_to_tfstate.py for CLI usage
7
- """
8
-
9
- import json
10
- import subprocess
11
- import sys
12
- import re
13
- import time
14
- import glob
15
- from pathlib import Path
16
- from ..customLib import validate_terraform_environment
17
-
18
-
19
- def load_json_data(json_file):
20
- """Load firewall data from JSON file"""
21
- try:
22
- with open(json_file, 'r') as f:
23
- data = json.load(f)
24
- return data['data']['policy']['internetFirewall']['policy']
25
- except FileNotFoundError:
26
- print(f"Error: JSON file '{json_file}' not found")
27
- sys.exit(1)
28
- except json.JSONDecodeError as e:
29
- print(f"Error: Invalid JSON in '{json_file}': {e}")
30
- sys.exit(1)
31
- except KeyError as e:
32
- print(f"Error: Expected JSON structure not found in '{json_file}': {e}")
33
- sys.exit(1)
34
-
35
-
36
- def sanitize_name_for_terraform(name):
37
- """Sanitize rule/section name to create valid Terraform resource key"""
38
- # Replace spaces and special characters with underscores
39
- sanitized = re.sub(r'[^a-zA-Z0-9_-]', '_', name)
40
- # Remove multiple consecutive underscores
41
- sanitized = re.sub(r'_+', '_', sanitized)
42
- # Remove leading/trailing underscores
43
- sanitized = sanitized.strip('_')
44
- return sanitized
45
-
46
-
47
- def extract_rules_and_sections(policy_data):
48
- """Extract rules and sections from the policy data"""
49
- rules = []
50
- sections = []
51
-
52
- # Extract rules
53
- for rule_entry in policy_data.get('rules', []):
54
- rule = rule_entry.get('rule', {})
55
- if rule.get('id') and rule.get('name'):
56
- rules.append({
57
- 'id': rule['id'],
58
- 'name': rule['name'],
59
- 'index': rule.get('index', 0),
60
- 'section_name': rule.get('section', {}).get('name', 'Default')
61
- })
62
-
63
- # Extract sections
64
- for section in policy_data.get('sections', []):
65
- if section.get('section_name'):
66
- sections.append({
67
- 'section_name': section['section_name'],
68
- 'section_index': section.get('section_index', 0),
69
- 'section_id': section.get('section_id', '')
70
- })
71
- return rules, sections
72
-
73
-
74
- def run_terraform_import(resource_address, resource_id, timeout=60, verbose=False):
75
- """
76
- Run a single terraform import command
77
-
78
- Args:
79
- resource_address: The terraform resource address
80
- resource_id: The actual resource ID to import
81
- timeout: Command timeout in seconds
82
- verbose: Whether to show verbose output
83
-
84
- Returns:
85
- tuple: (success: bool, output: str, error: str)
86
- """
87
- cmd = ['terraform', 'import', resource_address, resource_id]
88
- if verbose:
89
- print(f"Command: {' '.join(cmd)}")
90
-
91
- try:
92
- print(f"Importing: {resource_address} <- {resource_id}")
93
-
94
- result = subprocess.run(
95
- cmd,
96
- capture_output=True,
97
- text=True,
98
- timeout=timeout,
99
- cwd=Path.cwd()
100
- )
101
-
102
- if result.returncode == 0:
103
- print(f"Success: {resource_address}")
104
- return True, result.stdout, result.stderr
105
- else:
106
- print(f"Failed: {resource_address}")
107
- print(f"Error: {result.stderr}")
108
- return False, result.stdout, result.stderr
109
-
110
- except subprocess.TimeoutExpired:
111
- print(f"Timeout: {resource_address} (exceeded {timeout}s)")
112
- return False, "", f"Command timed out after {timeout} seconds"
113
- except Exception as e:
114
- print(f"Unexpected error for {resource_address}: {e}")
115
- return False, "", str(e)
116
-
117
-
118
- def find_rule_index(rules, rule_name):
119
- """Find rule index by name."""
120
- for index, rule in enumerate(rules):
121
- if rule['name'] == rule_name:
122
- return index
123
- return None
124
-
125
-
126
- def import_sections(sections, module_name, resource_type,
127
- resource_name="sections", verbose=False):
128
- """Import all sections"""
129
- print("\nStarting section imports...")
130
- total_sections = len(sections)
131
- successful_imports = 0
132
- failed_imports = 0
133
-
134
- for i, section in enumerate(sections):
135
- section_id = section['section_id']
136
- section_name = section['section_name']
137
- section_index = section['section_index']
138
- resource_address = f'{module_name}.{resource_type}.{resource_name}["{section_name}"]'
139
- print(f"\n[{i+1}/{total_sections}] Section: {section_name} (index: {section_index})")
140
-
141
- # For sections, we use the section name as the ID since that's how Cato identifies them
142
- success, stdout, stderr = run_terraform_import(resource_address, section_id, verbose=verbose)
143
-
144
- if success:
145
- successful_imports += 1
146
- else:
147
- failed_imports += 1
148
-
149
- print(f"\nSection Import Summary: {successful_imports} successful, {failed_imports} failed")
150
- return successful_imports, failed_imports
151
-
152
-
153
- def import_rules(rules, module_name, verbose=False,
154
- resource_type="cato_if_rule", resource_name="rules",
155
- batch_size=10, delay_between_batches=2, auto_approve=False):
156
- """Import all rules in batches"""
157
- print("\nStarting rule imports...")
158
- successful_imports = 0
159
- failed_imports = 0
160
- total_rules = len(rules)
161
-
162
- for i, rule in enumerate(rules):
163
- rule_id = rule['id']
164
- rule_name = rule['name']
165
- rule_index = find_rule_index(rules, rule_name)
166
- terraform_key = sanitize_name_for_terraform(rule_name)
167
-
168
- # Use array index syntax instead of rule ID
169
- resource_address = f'{module_name}.{resource_type}.{resource_name}["{str(rule_name)}"]'
170
- print(f"\n[{i+1}/{total_rules}] Rule: {rule_name} (index: {rule_index})")
171
-
172
- success, stdout, stderr = run_terraform_import(resource_address, rule_id, verbose=verbose)
173
-
174
- if success:
175
- successful_imports += 1
176
- else:
177
- failed_imports += 1
178
-
179
- # Ask user if they want to continue on failure (unless auto-approved)
180
- if failed_imports <= 3 and not auto_approve: # Only prompt for first few failures
181
- response = input(f"\nContinue with remaining imports? (y/n): ").lower()
182
- if response == 'n':
183
- print("Import process stopped by user.")
184
- break
185
-
186
- # Delay between batches
187
- if (i + 1) % batch_size == 0 and i < total_rules - 1:
188
- print(f"\n Batch complete. Waiting {delay_between_batches}s before next batch...")
189
- time.sleep(delay_between_batches)
190
-
191
- print(f"\n Rule Import Summary: {successful_imports} successful, {failed_imports} failed")
192
- return successful_imports, failed_imports
193
-
194
-
195
- def import_if_rules_to_tf(args, configuration):
196
- """Main function to orchestrate the import process"""
197
- try:
198
- print(" Terraform Import Tool - Cato IFW Rules & Sections")
199
- print("=" * 60)
200
-
201
- # Load data
202
- print(f" Loading data from {args.json_file}...")
203
- policy_data = load_json_data(args.json_file)
204
-
205
- # Extract rules and sections
206
- rules, sections = extract_rules_and_sections(policy_data)
207
-
208
- if hasattr(args, 'verbose') and args.verbose:
209
- print(f"section_ids: {json.dumps(policy_data.get('section_ids', {}), indent=2)}")
210
-
211
- print(f" Found {len(rules)} rules")
212
- print(f" Found {len(sections)} sections")
213
-
214
- if not rules and not sections:
215
- print(" No rules or sections found. Exiting.")
216
- return [{"success": False, "error": "No rules or sections found"}]
217
-
218
- # Validate Terraform environment before proceeding
219
- validate_terraform_environment(args.module_name, verbose=args.verbose)
220
-
221
- # Ask for confirmation (unless auto-approved)
222
- if not args.rules_only and not args.sections_only:
223
- print(f"\n Ready to import {len(sections)} sections and {len(rules)} rules.")
224
- elif args.rules_only:
225
- print(f"\n Ready to import {len(rules)} rules only.")
226
- elif args.sections_only:
227
- print(f"\n Ready to import {len(sections)} sections only.")
228
-
229
- if hasattr(args, 'auto_approve') and args.auto_approve:
230
- print("\nAuto-approve enabled, proceeding with import...")
231
- else:
232
- confirm = input(f"\nProceed with import? (y/n): ").lower()
233
- if confirm != 'y':
234
- print("Import cancelled.")
235
- return [{"success": False, "error": "Import cancelled by user"}]
236
-
237
- total_successful = 0
238
- total_failed = 0
239
-
240
- # Import sections first (if not skipped)
241
- if not args.rules_only and sections:
242
- successful, failed = import_sections(sections, module_name=args.module_name, resource_type="cato_if_section", verbose=args.verbose)
243
- total_successful += successful
244
- total_failed += failed
245
-
246
- # Import rules (if not skipped)
247
- if not args.sections_only and rules:
248
- successful, failed = import_rules(rules, module_name=args.module_name,
249
- verbose=args.verbose, batch_size=args.batch_size,
250
- delay_between_batches=args.delay,
251
- auto_approve=getattr(args, 'auto_approve', False))
252
- total_successful += successful
253
- total_failed += failed
254
-
255
- # Final summary
256
- print("\n" + "=" * 60)
257
- print(" FINAL IMPORT SUMMARY")
258
- print("=" * 60)
259
- print(f" Total successful imports: {total_successful}")
260
- print(f" Total failed imports: {total_failed}")
261
- print(f" Overall success rate: {(total_successful / (total_successful + total_failed) * 100):.1f}%" if (total_successful + total_failed) > 0 else "N/A")
262
- print("\n Import process completed!")
263
-
264
- return [{
265
- "success": True,
266
- "total_successful": total_successful,
267
- "total_failed": total_failed,
268
- "module_name": args.module_name
269
- }]
270
-
271
- except Exception as e:
272
- print(f"ERROR: {str(e)}")
273
- return [{"success": False, "error": str(e)}]
274
-
275
-
276
- def load_wf_json_data(json_file):
277
- """Load WAN Firewall data from JSON file"""
278
- try:
279
- with open(json_file, 'r') as f:
280
- data = json.load(f)
281
- return data['data']['policy']['wanFirewall']['policy']
282
- except FileNotFoundError:
283
- print(f"Error: JSON file '{json_file}' not found")
284
- sys.exit(1)
285
- except json.JSONDecodeError as e:
286
- print(f"Error: Invalid JSON in '{json_file}': {e}")
287
- sys.exit(1)
288
- except KeyError as e:
289
- print(f"Error: Expected JSON structure not found in '{json_file}': {e}")
290
- sys.exit(1)
291
-
292
-
293
- def import_wf_sections(sections, module_name, verbose=False,
294
- resource_type="cato_wf_section", resource_name="sections"):
295
- """Import all WAN Firewall sections"""
296
- print("\nStarting WAN Firewall section imports...")
297
- total_sections = len(sections)
298
- successful_imports = 0
299
- failed_imports = 0
300
-
301
- for i, section in enumerate(sections):
302
- section_id = section['section_id']
303
- section_name = section['section_name']
304
- section_index = section['section_index']
305
- # Add module. prefix if not present
306
- if not module_name.startswith('module.'):
307
- module_name = f'module.{module_name}'
308
- resource_address = f'{module_name}.{resource_type}.{resource_name}["{section_name}"]'
309
- print(f"\n[{i+1}/{total_sections}] Section: {section_name} (index: {section_index})")
310
-
311
- # For sections, we use the section name as the ID since that's how Cato identifies them
312
- success, stdout, stderr = run_terraform_import(resource_address, section_id, verbose=verbose)
313
-
314
- if success:
315
- successful_imports += 1
316
- else:
317
- failed_imports += 1
318
-
319
- print(f"\nWAN Firewall Section Import Summary: {successful_imports} successful, {failed_imports} failed")
320
- return successful_imports, failed_imports
321
-
322
-
323
- def import_wf_rules(rules, module_name, verbose=False,
324
- resource_type="cato_wf_rule", resource_name="rules",
325
- batch_size=10, delay_between_batches=2, auto_approve=False):
326
- """Import all WAN Firewall rules in batches"""
327
- print("\nStarting WAN Firewall rule imports...")
328
- successful_imports = 0
329
- failed_imports = 0
330
- total_rules = len(rules)
331
-
332
- for i, rule in enumerate(rules):
333
- rule_id = rule['id']
334
- rule_name = rule['name']
335
- rule_index = find_rule_index(rules, rule_name)
336
- terraform_key = sanitize_name_for_terraform(rule_name)
337
-
338
- # Add module. prefix if not present
339
- if not module_name.startswith('module.'):
340
- module_name = f'module.{module_name}'
341
-
342
- # Use array index syntax instead of rule ID
343
- resource_address = f'{module_name}.{resource_type}.{resource_name}["{str(rule_name)}"]'
344
- print(f"\n[{i+1}/{total_rules}] Rule: {rule_name} (index: {rule_index})")
345
-
346
- success, stdout, stderr = run_terraform_import(resource_address, rule_id, verbose=verbose)
347
-
348
- if success:
349
- successful_imports += 1
350
- else:
351
- failed_imports += 1
352
-
353
- # Ask user if they want to continue on failure (unless auto-approved)
354
- if failed_imports <= 3 and not auto_approve: # Only prompt for first few failures
355
- response = input(f"\nContinue with remaining imports? (y/n): ").lower()
356
- if response == 'n':
357
- print("Import process stopped by user.")
358
- break
359
-
360
- # Delay between batches
361
- if (i + 1) % batch_size == 0 and i < total_rules - 1:
362
- print(f"\n Batch complete. Waiting {delay_between_batches}s before next batch...")
363
- time.sleep(delay_between_batches)
364
-
365
- print(f"\nWAN Firewall Rule Import Summary: {successful_imports} successful, {failed_imports} failed")
366
- return successful_imports, failed_imports
367
-
368
-
369
- def import_wf_rules_to_tf(args, configuration):
370
- """Main function to orchestrate the WAN Firewall import process"""
371
- try:
372
- print(" Terraform Import Tool - Cato WF Rules & Sections")
373
- print("=" * 60)
374
-
375
- # Load data
376
- print(f" Loading data from {args.json_file}...")
377
- policy_data = load_wf_json_data(args.json_file)
378
-
379
- # Extract rules and sections
380
- rules, sections = extract_rules_and_sections(policy_data)
381
-
382
- if hasattr(args, 'verbose') and args.verbose:
383
- print(f"section_ids: {json.dumps(policy_data.get('section_ids', {}), indent=2)}")
384
-
385
- print(f" Found {len(rules)} rules")
386
- print(f" Found {len(sections)} sections")
387
-
388
- if not rules and not sections:
389
- print(" No rules or sections found. Exiting.")
390
- return [{"success": False, "error": "No rules or sections found"}]
391
-
392
- # Add module. prefix if not present
393
- module_name = args.module_name
394
- if not module_name.startswith('module.'):
395
- module_name = f'module.{module_name}'
396
- # Validate Terraform environment before proceeding
397
- validate_terraform_environment(module_name, verbose=args.verbose)
398
-
399
- # Ask for confirmation (unless auto-approved)
400
- if not args.rules_only and not args.sections_only:
401
- print(f"\n Ready to import {len(sections)} sections and {len(rules)} rules.")
402
- elif args.rules_only:
403
- print(f"\n Ready to import {len(rules)} rules only.")
404
- elif args.sections_only:
405
- print(f"\n Ready to import {len(sections)} sections only.")
406
-
407
- if hasattr(args, 'auto_approve') and args.auto_approve:
408
- print("\nAuto-approve enabled, proceeding with import...")
409
- else:
410
- confirm = input(f"\nProceed with import? (y/n): ").lower()
411
- if confirm != 'y':
412
- print("Import cancelled.")
413
- return [{"success": False, "error": "Import cancelled by user"}]
414
-
415
- total_successful = 0
416
- total_failed = 0
417
-
418
- # Import sections first (if not skipped)
419
- if not args.rules_only and sections:
420
- successful, failed = import_wf_sections(sections, module_name=args.module_name, verbose=args.verbose)
421
- total_successful += successful
422
- total_failed += failed
423
-
424
- # Import rules (if not skipped)
425
- if not args.sections_only and rules:
426
- successful, failed = import_wf_rules(rules, module_name=args.module_name,
427
- verbose=args.verbose, batch_size=args.batch_size,
428
- delay_between_batches=args.delay,
429
- auto_approve=getattr(args, 'auto_approve', False))
430
- total_successful += successful
431
- total_failed += failed
432
-
433
- # Final summary
434
- print("\n" + "=" * 60)
435
- print(" FINAL IMPORT SUMMARY")
436
- print("=" * 60)
437
- print(f" Total successful imports: {total_successful}")
438
- print(f" Total failed imports: {total_failed}")
439
- print(f" Overall success rate: {(total_successful / (total_successful + total_failed) * 100):.1f}%" if (total_successful + total_failed) > 0 else "N/A")
440
- print("\n Import process completed!")
441
-
442
- return [{
443
- "success": True,
444
- "total_successful": total_successful,
445
- "total_failed": total_failed,
446
- "module_name": args.module_name
447
- }]
448
-
449
- except Exception as e:
450
- print(f"ERROR: {str(e)}")
451
- return [{"success": False, "error": str(e)}]
@@ -1,45 +0,0 @@
1
- import catocli.parsers.custom.import_sites_to_tf.import_sites_to_tf as import_sites_to_tf
2
-
3
- def site_import_parse(subparsers, import_parser):
4
- """Add socket sites import command to existing import parser"""
5
-
6
- if import_parser is None:
7
- raise ValueError("Import parser not found. Make sure rule_import_parse is called before site_import_parse.")
8
-
9
- # Get the existing subparsers from the import parser
10
- import_subparsers = None
11
- for action in import_parser._subparsers._group_actions:
12
- if hasattr(action, 'choices'):
13
- import_subparsers = action
14
- break
15
-
16
- if import_subparsers is None:
17
- raise ValueError("Import subparsers not found in existing import parser.")
18
-
19
- # Add socket_sites_to_tf command
20
- socket_sites_parser = import_subparsers.add_parser(
21
- 'socket_sites_to_tf',
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'
24
- )
25
-
26
- socket_sites_parser.add_argument('json_file', help='Path to the JSON file containing socket sites data')
27
- socket_sites_parser.add_argument('--module-name', required=True,
28
- help='Terraform module name to import resources into')
29
- 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('--interfaces-only', action='store_true',
37
- help='Import only WAN interfaces, skip sites and network ranges')
38
- socket_sites_parser.add_argument('--network-ranges-only', action='store_true',
39
- help='Import only network ranges, skip sites and interfaces')
40
- socket_sites_parser.add_argument('-v', '--verbose', action='store_true', help='Verbose output')
41
- socket_sites_parser.add_argument('--auto-approve', action='store_true', help='Skip confirmation prompt and proceed automatically')
42
-
43
- socket_sites_parser.set_defaults(func=import_sites_to_tf.import_socket_sites_to_tf)
44
-
45
- return import_parser