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.
- catocli/Utils/clidriver.py +32 -4
- catocli/Utils/version_checker.py +1 -1
- catocli/__init__.py +1 -1
- catocli/parsers/custom/export_sites/export_sites.py +18 -1
- catocli/parsers/custom/import_rules_to_tf/import_rules_to_tf.py +13 -2
- catocli/parsers/custom/import_sites_to_tf/__init__.py +3 -1
- catocli/parsers/custom/import_sites_to_tf/import_sites_to_tf.py +79 -6
- catocli/parsers/custom_private/__init__.py +134 -0
- catocli/parsers/mutation_accountManagement/__init__.py +13 -0
- catocli/parsers/mutation_accountManagement_disableAccount/README.md +16 -0
- catocli/parsers/mutation_groups/README.md +7 -0
- catocli/parsers/mutation_groups/__init__.py +48 -0
- catocli/parsers/mutation_groups_createGroup/README.md +18 -0
- catocli/parsers/mutation_groups_deleteGroup/README.md +18 -0
- catocli/parsers/mutation_groups_updateGroup/README.md +18 -0
- catocli/parsers/mutation_site/__init__.py +104 -0
- catocli/parsers/mutation_site_assignSiteBwLicense/README.md +17 -0
- catocli/parsers/mutation_site_removeSecondaryAwsVSocket/README.md +17 -0
- catocli/parsers/mutation_site_removeSecondaryAzureVSocket/README.md +17 -0
- catocli/parsers/mutation_site_removeSiteBwLicense/README.md +17 -0
- catocli/parsers/mutation_site_replaceSiteBwLicense/README.md +17 -0
- catocli/parsers/mutation_site_updateSecondaryAwsVSocket/README.md +17 -0
- catocli/parsers/mutation_site_updateSecondaryAzureVSocket/README.md +17 -0
- catocli/parsers/mutation_site_updateSiteBwLicense/README.md +17 -0
- catocli/parsers/mutation_site_updateSiteGeneralDetails/README.md +1 -1
- catocli/parsers/mutation_sites/__init__.py +104 -0
- catocli/parsers/mutation_sites_assignSiteBwLicense/README.md +17 -0
- catocli/parsers/mutation_sites_removeSecondaryAwsVSocket/README.md +17 -0
- catocli/parsers/mutation_sites_removeSecondaryAzureVSocket/README.md +17 -0
- catocli/parsers/mutation_sites_removeSiteBwLicense/README.md +17 -0
- catocli/parsers/mutation_sites_replaceSiteBwLicense/README.md +17 -0
- catocli/parsers/mutation_sites_updateSecondaryAwsVSocket/README.md +17 -0
- catocli/parsers/mutation_sites_updateSecondaryAzureVSocket/README.md +17 -0
- catocli/parsers/mutation_sites_updateSiteBwLicense/README.md +17 -0
- catocli/parsers/mutation_sites_updateSiteGeneralDetails/README.md +1 -1
- catocli/parsers/parserApiClient.py +444 -9
- catocli/parsers/query_eventsFeed/README.md +1 -1
- catocli/parsers/query_groups/README.md +7 -0
- catocli/parsers/query_groups/__init__.py +54 -0
- catocli/parsers/query_groups_group/README.md +7 -0
- catocli/parsers/query_groups_groupList/README.md +18 -0
- catocli/parsers/query_groups_group_members/README.md +18 -0
- catocli/parsers/query_groups_whereUsed/README.md +17 -0
- catocli/parsers/query_popLocations/README.md +17 -0
- catocli/parsers/query_popLocations/__init__.py +16 -0
- catocli/parsers/query_site/__init__.py +26 -0
- catocli/parsers/query_site_secondaryAwsVSocket/README.md +17 -0
- catocli/parsers/query_site_secondaryAzureVSocket/README.md +17 -0
- catocli/parsers/query_socketPortMetrics/README.md +23 -0
- catocli/parsers/query_socketPortMetrics/__init__.py +16 -0
- catocli/parsers/query_socketPortMetricsTimeSeries/README.md +24 -0
- catocli/parsers/query_socketPortMetricsTimeSeries/__init__.py +16 -0
- {catocli-2.0.5.dist-info → catocli-2.1.1.dist-info}/METADATA +3 -2
- {catocli-2.0.5.dist-info → catocli-2.1.1.dist-info}/RECORD +253 -300
- {catocli-2.0.5.dist-info → catocli-2.1.1.dist-info}/WHEEL +1 -1
- {catocli-2.0.5.dist-info → catocli-2.1.1.dist-info}/top_level.txt +0 -2
- graphql_client/api/call_api.py +20 -2
- models/mutation.accountManagement.addAccount.json +97 -0
- models/mutation.accountManagement.disableAccount.json +545 -0
- models/mutation.accountManagement.removeAccount.json +102 -3
- models/mutation.accountManagement.updateAccount.json +97 -0
- models/mutation.admin.addAdmin.json +6 -9
- models/mutation.container.delete.json +2 -2
- models/mutation.container.fqdn.addValues.json +3 -3
- models/mutation.container.fqdn.createFromFile.json +3 -3
- models/mutation.container.fqdn.removeValues.json +3 -3
- models/mutation.container.fqdn.updateFromFile.json +3 -3
- models/mutation.container.ipAddressRange.addValues.json +3 -3
- models/mutation.container.ipAddressRange.createFromFile.json +3 -3
- models/mutation.container.ipAddressRange.removeValues.json +3 -3
- models/mutation.container.ipAddressRange.updateFromFile.json +3 -3
- models/mutation.groups.createGroup.json +3178 -0
- models/mutation.groups.deleteGroup.json +2758 -0
- models/mutation.groups.updateGroup.json +4429 -0
- models/mutation.hardware.updateHardwareShipping.json +30 -10
- models/mutation.policy.appTenantRestriction.addRule.json +33 -33
- models/mutation.policy.appTenantRestriction.addSection.json +4 -4
- models/mutation.policy.appTenantRestriction.createPolicyRevision.json +33 -33
- models/mutation.policy.appTenantRestriction.discardPolicyRevision.json +33 -33
- models/mutation.policy.appTenantRestriction.moveRule.json +27 -27
- models/mutation.policy.appTenantRestriction.moveSection.json +4 -4
- models/mutation.policy.appTenantRestriction.publishPolicyRevision.json +33 -33
- models/mutation.policy.appTenantRestriction.removeRule.json +27 -27
- models/mutation.policy.appTenantRestriction.removeSection.json +4 -4
- models/mutation.policy.appTenantRestriction.updatePolicy.json +33 -33
- models/mutation.policy.appTenantRestriction.updateRule.json +33 -33
- models/mutation.policy.appTenantRestriction.updateSection.json +4 -4
- models/mutation.policy.dynamicIpAllocation.addRule.json +12 -12
- models/mutation.policy.dynamicIpAllocation.addSection.json +4 -4
- models/mutation.policy.dynamicIpAllocation.createPolicyRevision.json +18 -18
- models/mutation.policy.dynamicIpAllocation.discardPolicyRevision.json +18 -18
- models/mutation.policy.dynamicIpAllocation.moveRule.json +12 -12
- models/mutation.policy.dynamicIpAllocation.moveSection.json +4 -4
- models/mutation.policy.dynamicIpAllocation.publishPolicyRevision.json +18 -18
- models/mutation.policy.dynamicIpAllocation.removeRule.json +12 -12
- models/mutation.policy.dynamicIpAllocation.removeSection.json +4 -4
- models/mutation.policy.dynamicIpAllocation.updatePolicy.json +18 -18
- models/mutation.policy.dynamicIpAllocation.updateRule.json +12 -12
- models/mutation.policy.dynamicIpAllocation.updateSection.json +4 -4
- models/mutation.policy.internetFirewall.addRule.json +141 -141
- models/mutation.policy.internetFirewall.addSection.json +4 -4
- models/mutation.policy.internetFirewall.createPolicyRevision.json +102 -102
- models/mutation.policy.internetFirewall.discardPolicyRevision.json +102 -102
- models/mutation.policy.internetFirewall.moveRule.json +96 -96
- models/mutation.policy.internetFirewall.moveSection.json +4 -4
- models/mutation.policy.internetFirewall.publishPolicyRevision.json +102 -102
- models/mutation.policy.internetFirewall.removeRule.json +96 -96
- models/mutation.policy.internetFirewall.removeSection.json +4 -4
- models/mutation.policy.internetFirewall.updatePolicy.json +102 -102
- models/mutation.policy.internetFirewall.updateRule.json +141 -141
- models/mutation.policy.internetFirewall.updateSection.json +4 -4
- models/mutation.policy.remotePortFwd.addRule.json +21 -21
- models/mutation.policy.remotePortFwd.addSection.json +4 -4
- models/mutation.policy.remotePortFwd.createPolicyRevision.json +24 -24
- models/mutation.policy.remotePortFwd.discardPolicyRevision.json +24 -24
- models/mutation.policy.remotePortFwd.moveRule.json +18 -18
- models/mutation.policy.remotePortFwd.moveSection.json +4 -4
- models/mutation.policy.remotePortFwd.publishPolicyRevision.json +24 -24
- models/mutation.policy.remotePortFwd.removeRule.json +18 -18
- models/mutation.policy.remotePortFwd.removeSection.json +4 -4
- models/mutation.policy.remotePortFwd.updatePolicy.json +24 -24
- models/mutation.policy.remotePortFwd.updateRule.json +21 -21
- models/mutation.policy.remotePortFwd.updateSection.json +4 -4
- models/mutation.policy.socketLan.addRule.json +97 -97
- models/mutation.policy.socketLan.addSection.json +4 -4
- models/mutation.policy.socketLan.createPolicyRevision.json +91 -91
- models/mutation.policy.socketLan.discardPolicyRevision.json +91 -91
- models/mutation.policy.socketLan.moveRule.json +85 -85
- models/mutation.policy.socketLan.moveSection.json +4 -4
- models/mutation.policy.socketLan.publishPolicyRevision.json +91 -91
- models/mutation.policy.socketLan.removeRule.json +85 -85
- models/mutation.policy.socketLan.removeSection.json +4 -4
- models/mutation.policy.socketLan.updatePolicy.json +91 -91
- models/mutation.policy.socketLan.updateRule.json +97 -97
- models/mutation.policy.socketLan.updateSection.json +4 -4
- models/mutation.policy.terminalServer.addRule.json +7 -7
- models/mutation.policy.terminalServer.addSection.json +4 -4
- models/mutation.policy.terminalServer.createPolicyRevision.json +13 -13
- models/mutation.policy.terminalServer.discardPolicyRevision.json +13 -13
- models/mutation.policy.terminalServer.moveRule.json +7 -7
- models/mutation.policy.terminalServer.moveSection.json +4 -4
- models/mutation.policy.terminalServer.publishPolicyRevision.json +13 -13
- models/mutation.policy.terminalServer.removeRule.json +7 -7
- models/mutation.policy.terminalServer.removeSection.json +4 -4
- models/mutation.policy.terminalServer.updatePolicy.json +13 -13
- models/mutation.policy.terminalServer.updateRule.json +7 -7
- models/mutation.policy.terminalServer.updateSection.json +4 -4
- models/mutation.policy.wanFirewall.addRule.json +157 -157
- models/mutation.policy.wanFirewall.addSection.json +4 -4
- models/mutation.policy.wanFirewall.createPolicyRevision.json +121 -121
- models/mutation.policy.wanFirewall.discardPolicyRevision.json +121 -121
- models/mutation.policy.wanFirewall.moveRule.json +115 -115
- models/mutation.policy.wanFirewall.moveSection.json +4 -4
- models/mutation.policy.wanFirewall.publishPolicyRevision.json +121 -121
- models/mutation.policy.wanFirewall.removeRule.json +115 -115
- models/mutation.policy.wanFirewall.removeSection.json +4 -4
- models/mutation.policy.wanFirewall.updatePolicy.json +121 -121
- models/mutation.policy.wanFirewall.updateRule.json +157 -157
- models/mutation.policy.wanFirewall.updateSection.json +4 -4
- models/mutation.policy.wanNetwork.addRule.json +103 -103
- models/mutation.policy.wanNetwork.addSection.json +4 -4
- models/mutation.policy.wanNetwork.createPolicyRevision.json +97 -97
- models/mutation.policy.wanNetwork.discardPolicyRevision.json +97 -97
- models/mutation.policy.wanNetwork.moveRule.json +91 -91
- models/mutation.policy.wanNetwork.moveSection.json +4 -4
- models/mutation.policy.wanNetwork.publishPolicyRevision.json +97 -97
- models/mutation.policy.wanNetwork.removeRule.json +91 -91
- models/mutation.policy.wanNetwork.removeSection.json +4 -4
- models/mutation.policy.wanNetwork.updatePolicy.json +97 -97
- models/mutation.policy.wanNetwork.updateRule.json +103 -103
- models/mutation.policy.wanNetwork.updateSection.json +4 -4
- models/mutation.site.addBgpPeer.json +10 -10
- models/mutation.site.addIpsecIkeV2SiteTunnels.json +2 -2
- models/mutation.site.addSocketAddOnCard.json +2 -2
- models/mutation.site.assignSiteBwLicense.json +12879 -0
- models/mutation.site.removeBgpPeer.json +10 -10
- models/mutation.site.removeIpsecIkeV2SiteTunnels.json +2 -2
- models/mutation.site.removeSecondaryAwsVSocket.json +375 -0
- models/mutation.site.removeSecondaryAzureVSocket.json +354 -0
- models/mutation.site.removeSiteBwLicense.json +12822 -0
- models/mutation.site.removeSocketAddOnCard.json +2 -2
- models/mutation.site.replaceSiteBwLicense.json +12939 -0
- models/mutation.site.startSiteUpgrade.json +36 -15
- models/mutation.site.updateBgpPeer.json +10 -10
- models/mutation.site.updateIpsecIkeV2SiteTunnels.json +2 -2
- models/mutation.site.updateSecondaryAwsVSocket.json +643 -0
- models/mutation.site.updateSecondaryAzureVSocket.json +565 -0
- models/mutation.site.updateSiteBwLicense.json +12882 -0
- models/mutation.site.updateSiteGeneralDetails.json +724 -1
- models/mutation.sites.addBgpPeer.json +10 -10
- models/mutation.sites.addIpsecIkeV2SiteTunnels.json +2 -2
- models/mutation.sites.addSocketAddOnCard.json +2 -2
- models/mutation.sites.assignSiteBwLicense.json +12879 -0
- models/mutation.sites.removeBgpPeer.json +10 -10
- models/mutation.sites.removeIpsecIkeV2SiteTunnels.json +2 -2
- models/mutation.sites.removeSecondaryAwsVSocket.json +375 -0
- models/mutation.sites.removeSecondaryAzureVSocket.json +354 -0
- models/mutation.sites.removeSiteBwLicense.json +12822 -0
- models/mutation.sites.removeSocketAddOnCard.json +2 -2
- models/mutation.sites.replaceSiteBwLicense.json +12939 -0
- models/mutation.sites.startSiteUpgrade.json +36 -15
- models/mutation.sites.updateBgpPeer.json +10 -10
- models/mutation.sites.updateIpsecIkeV2SiteTunnels.json +2 -2
- models/mutation.sites.updateSecondaryAwsVSocket.json +643 -0
- models/mutation.sites.updateSecondaryAzureVSocket.json +565 -0
- models/mutation.sites.updateSiteBwLicense.json +12882 -0
- models/mutation.sites.updateSiteGeneralDetails.json +724 -1
- models/mutation.xdr.addStoryComment.json +1 -1
- models/mutation.xdr.analystFeedback.json +84 -84
- models/mutation.xdr.deleteStoryComment.json +1 -1
- models/query.accountManagement.json +97 -0
- models/query.accountMetrics.json +45 -45
- models/query.accountSnapshot.json +30 -30
- models/query.admin.json +6 -6
- models/query.admins.json +13 -13
- models/query.appStats.json +915 -867
- models/query.appStatsTimeSeries.json +692 -656
- models/query.auditFeed.json +6 -6
- models/query.catalogs.json +52 -52
- models/query.container.json +16 -16
- models/query.devices.json +20 -93
- models/query.entityLookup.json +2 -2
- models/query.events.json +288 -384
- models/query.eventsFeed.json +73 -97
- models/query.eventsTimeSeries.json +219 -291
- models/query.groups.group.members.json +3058 -0
- models/query.groups.groupList.json +6474 -0
- models/query.groups.whereUsed.json +697 -0
- models/query.hardware.json +27 -7
- models/query.hardwareManagement.json +8 -8
- models/query.licensing.json +3487 -1324
- models/query.policy.appTenantRestriction.policy.json +32 -32
- models/query.policy.dynamicIpAllocation.policy.json +18 -18
- models/query.policy.internetFirewall.policy.json +93 -93
- models/query.policy.remotePortFwd.policy.json +23 -23
- models/query.policy.socketLan.policy.json +88 -88
- models/query.policy.terminalServer.policy.json +13 -13
- models/query.policy.wanFirewall.policy.json +111 -111
- models/query.policy.wanNetwork.policy.json +97 -97
- models/query.popLocations.json +2878 -0
- models/query.sandbox.json +5 -5
- models/query.site.bgpPeer.json +4 -4
- models/query.site.bgpPeerList.json +10 -10
- models/query.site.secondaryAwsVSocket.json +340 -0
- models/query.site.secondaryAzureVSocket.json +319 -0
- models/query.site.siteBgpStatus.json +2 -2
- models/query.socketPortMetrics.json +2410 -0
- models/query.socketPortMetricsTimeSeries.json +2361 -0
- models/query.xdr.stories.json +104 -104
- models/query.xdr.story.json +93 -93
- schema/catolib.py +43 -16
- build/lib/catocli/Utils/clidriver.py +0 -268
- build/lib/catocli/Utils/profile_manager.py +0 -188
- build/lib/catocli/Utils/version_checker.py +0 -192
- build/lib/catocli/__init__.py +0 -2
- build/lib/catocli/__main__.py +0 -12
- build/lib/catocli/parsers/configure/__init__.py +0 -115
- build/lib/catocli/parsers/configure/configure.py +0 -307
- build/lib/catocli/parsers/custom/__init__.py +0 -57
- build/lib/catocli/parsers/custom/customLib.py +0 -561
- build/lib/catocli/parsers/custom/export_rules/__init__.py +0 -42
- build/lib/catocli/parsers/custom/export_rules/export_rules.py +0 -234
- build/lib/catocli/parsers/custom/export_sites/__init__.py +0 -21
- build/lib/catocli/parsers/custom/export_sites/export_sites.py +0 -372
- build/lib/catocli/parsers/custom/import_rules_to_tf/__init__.py +0 -58
- build/lib/catocli/parsers/custom/import_rules_to_tf/import_rules_to_tf.py +0 -451
- build/lib/catocli/parsers/custom/import_sites_to_tf/__init__.py +0 -45
- build/lib/catocli/parsers/custom/import_sites_to_tf/import_sites_to_tf.py +0 -891
- build/lib/catocli/parsers/mutation_accountManagement/__init__.py +0 -48
- build/lib/catocli/parsers/mutation_admin/__init__.py +0 -48
- build/lib/catocli/parsers/mutation_container/__init__.py +0 -138
- build/lib/catocli/parsers/mutation_hardware/__init__.py +0 -22
- build/lib/catocli/parsers/mutation_policy/__init__.py +0 -1305
- build/lib/catocli/parsers/mutation_sandbox/__init__.py +0 -35
- build/lib/catocli/parsers/mutation_site/__init__.py +0 -373
- build/lib/catocli/parsers/mutation_sites/__init__.py +0 -373
- build/lib/catocli/parsers/mutation_xdr/__init__.py +0 -48
- build/lib/catocli/parsers/parserApiClient.py +0 -513
- build/lib/catocli/parsers/query_accountBySubdomain/__init__.py +0 -16
- build/lib/catocli/parsers/query_accountManagement/__init__.py +0 -16
- build/lib/catocli/parsers/query_accountMetrics/__init__.py +0 -16
- build/lib/catocli/parsers/query_accountRoles/__init__.py +0 -16
- build/lib/catocli/parsers/query_accountSnapshot/__init__.py +0 -16
- build/lib/catocli/parsers/query_admin/__init__.py +0 -16
- build/lib/catocli/parsers/query_admins/__init__.py +0 -16
- build/lib/catocli/parsers/query_appStats/__init__.py +0 -16
- build/lib/catocli/parsers/query_appStatsTimeSeries/__init__.py +0 -16
- build/lib/catocli/parsers/query_auditFeed/__init__.py +0 -16
- build/lib/catocli/parsers/query_catalogs/__init__.py +0 -16
- build/lib/catocli/parsers/query_container/__init__.py +0 -16
- build/lib/catocli/parsers/query_devices/__init__.py +0 -16
- build/lib/catocli/parsers/query_entityLookup/__init__.py +0 -16
- build/lib/catocli/parsers/query_events/__init__.py +0 -16
- build/lib/catocli/parsers/query_eventsFeed/__init__.py +0 -16
- build/lib/catocli/parsers/query_eventsTimeSeries/__init__.py +0 -16
- build/lib/catocli/parsers/query_hardware/__init__.py +0 -16
- build/lib/catocli/parsers/query_hardwareManagement/__init__.py +0 -16
- build/lib/catocli/parsers/query_licensing/__init__.py +0 -16
- build/lib/catocli/parsers/query_policy/__init__.py +0 -161
- build/lib/catocli/parsers/query_sandbox/__init__.py +0 -16
- build/lib/catocli/parsers/query_site/__init__.py +0 -100
- build/lib/catocli/parsers/query_siteLocation/__init__.py +0 -13
- build/lib/catocli/parsers/query_subDomains/__init__.py +0 -16
- build/lib/catocli/parsers/query_xdr/__init__.py +0 -35
- build/lib/catocli/parsers/raw/__init__.py +0 -12
- build/lib/graphql_client/__init__.py +0 -11
- build/lib/graphql_client/api/__init__.py +0 -3
- build/lib/graphql_client/api/call_api.py +0 -84
- build/lib/graphql_client/api_client.py +0 -192
- build/lib/graphql_client/api_client_types.py +0 -409
- build/lib/graphql_client/configuration.py +0 -232
- build/lib/graphql_client/models/__init__.py +0 -13
- build/lib/graphql_client/models/no_schema.py +0 -71
- build/lib/schema/catolib.py +0 -1141
- build/lib/schema/importSchema.py +0 -60
- build/lib/schema/remove_policyid.py +0 -89
- build/lib/schema/remove_policyid_mutations.py +0 -89
- build/lib/scripts/catolib.py +0 -62
- build/lib/scripts/export_if_rules_to_json.py +0 -188
- build/lib/scripts/export_wf_rules_to_json.py +0 -111
- build/lib/scripts/import_wf_rules_to_tfstate.py +0 -331
- build/lib/vendor/certifi/__init__.py +0 -4
- build/lib/vendor/certifi/__main__.py +0 -12
- build/lib/vendor/certifi/core.py +0 -114
- build/lib/vendor/certifi/py.typed +0 -0
- build/lib/vendor/six.py +0 -998
- build/lib/vendor/urllib3/__init__.py +0 -211
- build/lib/vendor/urllib3/_base_connection.py +0 -172
- build/lib/vendor/urllib3/_collections.py +0 -483
- build/lib/vendor/urllib3/_request_methods.py +0 -278
- build/lib/vendor/urllib3/_version.py +0 -16
- build/lib/vendor/urllib3/connection.py +0 -1033
- build/lib/vendor/urllib3/connectionpool.py +0 -1182
- build/lib/vendor/urllib3/contrib/__init__.py +0 -0
- build/lib/vendor/urllib3/contrib/emscripten/__init__.py +0 -18
- build/lib/vendor/urllib3/contrib/emscripten/connection.py +0 -254
- build/lib/vendor/urllib3/contrib/emscripten/fetch.py +0 -418
- build/lib/vendor/urllib3/contrib/emscripten/request.py +0 -22
- build/lib/vendor/urllib3/contrib/emscripten/response.py +0 -285
- build/lib/vendor/urllib3/contrib/pyopenssl.py +0 -552
- build/lib/vendor/urllib3/contrib/socks.py +0 -228
- build/lib/vendor/urllib3/exceptions.py +0 -321
- build/lib/vendor/urllib3/fields.py +0 -341
- build/lib/vendor/urllib3/filepost.py +0 -89
- build/lib/vendor/urllib3/http2/__init__.py +0 -53
- build/lib/vendor/urllib3/http2/connection.py +0 -356
- build/lib/vendor/urllib3/http2/probe.py +0 -87
- build/lib/vendor/urllib3/poolmanager.py +0 -637
- build/lib/vendor/urllib3/py.typed +0 -2
- build/lib/vendor/urllib3/response.py +0 -1265
- build/lib/vendor/urllib3/util/__init__.py +0 -42
- build/lib/vendor/urllib3/util/connection.py +0 -137
- build/lib/vendor/urllib3/util/proxy.py +0 -43
- build/lib/vendor/urllib3/util/request.py +0 -256
- build/lib/vendor/urllib3/util/response.py +0 -101
- build/lib/vendor/urllib3/util/retry.py +0 -533
- build/lib/vendor/urllib3/util/ssl_.py +0 -513
- build/lib/vendor/urllib3/util/ssl_match_hostname.py +0 -159
- build/lib/vendor/urllib3/util/ssltransport.py +0 -276
- build/lib/vendor/urllib3/util/timeout.py +0 -275
- build/lib/vendor/urllib3/util/url.py +0 -471
- build/lib/vendor/urllib3/util/util.py +0 -42
- build/lib/vendor/urllib3/util/wait.py +0 -124
- {catocli-2.0.5.dist-info → catocli-2.1.1.dist-info}/entry_points.txt +0 -0
- {catocli-2.0.5.dist-info → catocli-2.1.1.dist-info/licenses}/LICENSE +0 -0
catocli/Utils/clidriver.py
CHANGED
|
@@ -18,10 +18,12 @@ profile_manager = get_profile_manager()
|
|
|
18
18
|
CATO_DEBUG = bool(os.getenv("CATO_DEBUG", False))
|
|
19
19
|
from ..parsers.raw import raw_parse
|
|
20
20
|
from ..parsers.custom import custom_parse
|
|
21
|
+
from ..parsers.custom_private import private_parse
|
|
21
22
|
from ..parsers.query_siteLocation import query_siteLocation_parse
|
|
22
23
|
from ..parsers.mutation_accountManagement import mutation_accountManagement_parse
|
|
23
24
|
from ..parsers.mutation_admin import mutation_admin_parse
|
|
24
25
|
from ..parsers.mutation_container import mutation_container_parse
|
|
26
|
+
from ..parsers.mutation_groups import mutation_groups_parse
|
|
25
27
|
from ..parsers.mutation_hardware import mutation_hardware_parse
|
|
26
28
|
from ..parsers.mutation_policy import mutation_policy_parse
|
|
27
29
|
from ..parsers.mutation_sandbox import mutation_sandbox_parse
|
|
@@ -45,12 +47,16 @@ from ..parsers.query_entityLookup import query_entityLookup_parse
|
|
|
45
47
|
from ..parsers.query_events import query_events_parse
|
|
46
48
|
from ..parsers.query_eventsFeed import query_eventsFeed_parse
|
|
47
49
|
from ..parsers.query_eventsTimeSeries import query_eventsTimeSeries_parse
|
|
50
|
+
from ..parsers.query_groups import query_groups_parse
|
|
48
51
|
from ..parsers.query_hardware import query_hardware_parse
|
|
49
52
|
from ..parsers.query_hardwareManagement import query_hardwareManagement_parse
|
|
50
53
|
from ..parsers.query_licensing import query_licensing_parse
|
|
51
54
|
from ..parsers.query_policy import query_policy_parse
|
|
55
|
+
from ..parsers.query_popLocations import query_popLocations_parse
|
|
52
56
|
from ..parsers.query_sandbox import query_sandbox_parse
|
|
53
57
|
from ..parsers.query_site import query_site_parse
|
|
58
|
+
from ..parsers.query_socketPortMetrics import query_socketPortMetrics_parse
|
|
59
|
+
from ..parsers.query_socketPortMetricsTimeSeries import query_socketPortMetricsTimeSeries_parse
|
|
54
60
|
from ..parsers.query_subDomains import query_subDomains_parse
|
|
55
61
|
from ..parsers.query_xdr import query_xdr_parse
|
|
56
62
|
|
|
@@ -77,6 +83,15 @@ def show_version_info(args, configuration=None):
|
|
|
77
83
|
print("Unable to check for updates (check your internet connection)")
|
|
78
84
|
return [{"success": True, "current_version": catocli.__version__, "latest_version": latest_version if not args.current_only else None}]
|
|
79
85
|
|
|
86
|
+
def load_private_settings():
|
|
87
|
+
# Load private settings from ~/.cato/settings.json
|
|
88
|
+
settings_file = os.path.expanduser("~/.cato/settings.json")
|
|
89
|
+
try:
|
|
90
|
+
with open(settings_file, 'r') as f:
|
|
91
|
+
return json.load(f)
|
|
92
|
+
except (FileNotFoundError, json.JSONDecodeError):
|
|
93
|
+
return {}
|
|
94
|
+
|
|
80
95
|
def get_configuration(skip_api_key=False):
|
|
81
96
|
configuration = Configuration()
|
|
82
97
|
configuration.verify_ssl = False
|
|
@@ -99,10 +114,13 @@ def get_configuration(skip_api_key=False):
|
|
|
99
114
|
print(f"Run 'catocli configure set --profile {profile_name}' to update your credentials.")
|
|
100
115
|
exit(1)
|
|
101
116
|
|
|
117
|
+
# Use standard endpoint from profile for regular API calls
|
|
118
|
+
configuration.host = credentials['endpoint']
|
|
119
|
+
|
|
102
120
|
# Only set API key if not using custom headers file
|
|
121
|
+
# (Private settings are handled separately in createPrivateRequest)
|
|
103
122
|
if not skip_api_key:
|
|
104
123
|
configuration.api_key["x-api-key"] = credentials['cato_token']
|
|
105
|
-
configuration.host = credentials['endpoint']
|
|
106
124
|
configuration.accountID = credentials['account_id']
|
|
107
125
|
|
|
108
126
|
return configuration
|
|
@@ -131,6 +149,7 @@ version_parser.add_argument('--current-only', action='store_true', help='Show on
|
|
|
131
149
|
version_parser.set_defaults(func=show_version_info)
|
|
132
150
|
|
|
133
151
|
custom_parsers = custom_parse(subparsers)
|
|
152
|
+
private_parsers = private_parse(subparsers)
|
|
134
153
|
raw_parsers = subparsers.add_parser('raw', help='Raw GraphQL', usage=get_help("raw"))
|
|
135
154
|
raw_parser = raw_parse(raw_parsers)
|
|
136
155
|
query_parser = subparsers.add_parser('query', help='Query', usage='catocli query <operationName> [options]')
|
|
@@ -142,6 +161,7 @@ mutation_subparsers = mutation_parser.add_subparsers(description='valid subcomma
|
|
|
142
161
|
mutation_accountManagement_parser = mutation_accountManagement_parse(mutation_subparsers)
|
|
143
162
|
mutation_admin_parser = mutation_admin_parse(mutation_subparsers)
|
|
144
163
|
mutation_container_parser = mutation_container_parse(mutation_subparsers)
|
|
164
|
+
mutation_groups_parser = mutation_groups_parse(mutation_subparsers)
|
|
145
165
|
mutation_hardware_parser = mutation_hardware_parse(mutation_subparsers)
|
|
146
166
|
mutation_policy_parser = mutation_policy_parse(mutation_subparsers)
|
|
147
167
|
mutation_sandbox_parser = mutation_sandbox_parse(mutation_subparsers)
|
|
@@ -165,12 +185,16 @@ query_entityLookup_parser = query_entityLookup_parse(query_subparsers)
|
|
|
165
185
|
query_events_parser = query_events_parse(query_subparsers)
|
|
166
186
|
query_eventsFeed_parser = query_eventsFeed_parse(query_subparsers)
|
|
167
187
|
query_eventsTimeSeries_parser = query_eventsTimeSeries_parse(query_subparsers)
|
|
188
|
+
query_groups_parser = query_groups_parse(query_subparsers)
|
|
168
189
|
query_hardware_parser = query_hardware_parse(query_subparsers)
|
|
169
190
|
query_hardwareManagement_parser = query_hardwareManagement_parse(query_subparsers)
|
|
170
191
|
query_licensing_parser = query_licensing_parse(query_subparsers)
|
|
171
192
|
query_policy_parser = query_policy_parse(query_subparsers)
|
|
193
|
+
query_popLocations_parser = query_popLocations_parse(query_subparsers)
|
|
172
194
|
query_sandbox_parser = query_sandbox_parse(query_subparsers)
|
|
173
195
|
query_site_parser = query_site_parse(query_subparsers)
|
|
196
|
+
query_socketPortMetrics_parser = query_socketPortMetrics_parse(query_subparsers)
|
|
197
|
+
query_socketPortMetricsTimeSeries_parser = query_socketPortMetricsTimeSeries_parse(query_subparsers)
|
|
174
198
|
query_subDomains_parser = query_subDomains_parse(query_subparsers)
|
|
175
199
|
query_xdr_parser = query_xdr_parse(query_subparsers)
|
|
176
200
|
|
|
@@ -229,6 +253,7 @@ def main(args=None):
|
|
|
229
253
|
response = args.func(args, None)
|
|
230
254
|
else:
|
|
231
255
|
# Check if using headers file to determine if we should skip API key
|
|
256
|
+
# Note: Private settings should NOT affect regular API calls - only private commands
|
|
232
257
|
using_headers_file = hasattr(args, 'headers_file') and args.headers_file
|
|
233
258
|
|
|
234
259
|
# Get configuration from profiles
|
|
@@ -242,8 +267,8 @@ def main(args=None):
|
|
|
242
267
|
custom_headers.update(parse_headers_from_file(args.headers_file))
|
|
243
268
|
if custom_headers:
|
|
244
269
|
configuration.custom_headers.update(custom_headers)
|
|
245
|
-
# Handle account ID override
|
|
246
|
-
if args.func.__name__
|
|
270
|
+
# Handle account ID override (applies to all commands except raw)
|
|
271
|
+
if args.func.__name__ not in ["createRawRequest"]:
|
|
247
272
|
if hasattr(args, 'accountID') and args.accountID is not None:
|
|
248
273
|
# Command line override takes precedence
|
|
249
274
|
configuration.accountID = args.accountID
|
|
@@ -256,6 +281,9 @@ def main(args=None):
|
|
|
256
281
|
else:
|
|
257
282
|
if response!=None:
|
|
258
283
|
print(json.dumps(response[0], sort_keys=True, indent=4))
|
|
284
|
+
except KeyboardInterrupt:
|
|
285
|
+
print('Operation cancelled by user (Ctrl+C).')
|
|
286
|
+
exit(130) # Standard exit code for SIGINT
|
|
259
287
|
except Exception as e:
|
|
260
288
|
if isinstance(e, AttributeError):
|
|
261
289
|
print('Missing arguments. Usage: catocli <operation> -h')
|
|
@@ -265,4 +293,4 @@ def main(args=None):
|
|
|
265
293
|
else:
|
|
266
294
|
print('ERROR: ',e)
|
|
267
295
|
traceback.print_exc()
|
|
268
|
-
|
|
296
|
+
exit(1)
|
catocli/Utils/version_checker.py
CHANGED
|
@@ -14,7 +14,7 @@ from .. import __version__
|
|
|
14
14
|
|
|
15
15
|
# Cache settings
|
|
16
16
|
CACHE_FILE = os.path.expanduser("~/.catocli_version_cache")
|
|
17
|
-
CACHE_DURATION = 3600 *
|
|
17
|
+
CACHE_DURATION = 3600 * 4 # 4 hours in seconds
|
|
18
18
|
|
|
19
19
|
def get_cached_version_info():
|
|
20
20
|
"""Get cached version information if still valid"""
|
catocli/__init__.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "2.
|
|
1
|
+
__version__ = "2.1.1"
|
|
2
2
|
__cato_host__ = "https://api.catonetworks.com/api/v1/graphql2"
|
|
@@ -97,6 +97,23 @@ def export_socket_site_to_json(args, configuration):
|
|
|
97
97
|
cur_lan_interface['index'] = lan_ni.get("helperFields","").get('interfaceId', "")
|
|
98
98
|
cur_lan_interface['destType'] = lan_ni.get("helperFields","").get('destType', "")
|
|
99
99
|
|
|
100
|
+
for range in entity_network_ranges:
|
|
101
|
+
if hasattr(args, 'verbose') and args.verbose:
|
|
102
|
+
print(f"Processing network range: {type(range)} - {range}")
|
|
103
|
+
helper_fields = range.get("helperFields", {})
|
|
104
|
+
entity_data = range.get('entity', {})
|
|
105
|
+
range_name = entity_data.get('name', "")
|
|
106
|
+
if range_name and " \\ " in range_name:
|
|
107
|
+
range_name = range_name.split(" \\ ").pop()
|
|
108
|
+
else:
|
|
109
|
+
range_name = range_name
|
|
110
|
+
network_range_site_id = str(helper_fields.get('siteId', ""))
|
|
111
|
+
network_range_interface_name = str(helper_fields.get('interfaceName', ""))
|
|
112
|
+
if site_id == network_range_site_id and interfaceName == network_range_interface_name and range_name == "Native Range":
|
|
113
|
+
cur_lan_interface['subnet'] = helper_fields.get('subnet', "")
|
|
114
|
+
cur_lan_interface['vlanTag'] = helper_fields.get('vlanTag', "")
|
|
115
|
+
cur_lan_interface['microsegmentation'] = helper_fields.get('microsegmentation', "")
|
|
116
|
+
|
|
100
117
|
# Create a composite key for interface mapping that includes site_id
|
|
101
118
|
interface_key = f"{site_id}_{interfaceName}"
|
|
102
119
|
interface_map[interface_key] = id
|
|
@@ -141,7 +158,7 @@ def export_socket_site_to_json(args, configuration):
|
|
|
141
158
|
cur_range['microsegmentation'] = helper_fields.get('microsegmentation', "")
|
|
142
159
|
|
|
143
160
|
# Safely add to processed_data with existence checks
|
|
144
|
-
if site_id and interface_id and range_id:
|
|
161
|
+
if site_id and interface_id and range_id and cur_range['rangeName'] != "Native Range":
|
|
145
162
|
site_entry = next((site for site in processed_data['sites'] if site['id'] == site_id), None)
|
|
146
163
|
if not site_entry:
|
|
147
164
|
# print(f"WARNING: Site ID {site_id} not found in processed_data")
|
|
@@ -107,6 +107,9 @@ def run_terraform_import(resource_address, resource_id, timeout=60, verbose=Fals
|
|
|
107
107
|
print(f"Error: {result.stderr}")
|
|
108
108
|
return False, result.stdout, result.stderr
|
|
109
109
|
|
|
110
|
+
except KeyboardInterrupt:
|
|
111
|
+
print(f"\nImport cancelled by user (Ctrl+C)")
|
|
112
|
+
raise # Re-raise to allow higher-level handling
|
|
110
113
|
except subprocess.TimeoutExpired:
|
|
111
114
|
print(f"Timeout: {resource_address} (exceeded {timeout}s)")
|
|
112
115
|
return False, "", f"Command timed out after {timeout} seconds"
|
|
@@ -267,7 +270,11 @@ def import_if_rules_to_tf(args, configuration):
|
|
|
267
270
|
"total_failed": total_failed,
|
|
268
271
|
"module_name": args.module_name
|
|
269
272
|
}]
|
|
270
|
-
|
|
273
|
+
|
|
274
|
+
except KeyboardInterrupt:
|
|
275
|
+
print("\nImport process cancelled by user (Ctrl+C).")
|
|
276
|
+
print("Partial imports may have been completed.")
|
|
277
|
+
return [{"success": False, "error": "Import cancelled by user"}]
|
|
271
278
|
except Exception as e:
|
|
272
279
|
print(f"ERROR: {str(e)}")
|
|
273
280
|
return [{"success": False, "error": str(e)}]
|
|
@@ -445,7 +452,11 @@ def import_wf_rules_to_tf(args, configuration):
|
|
|
445
452
|
"total_failed": total_failed,
|
|
446
453
|
"module_name": args.module_name
|
|
447
454
|
}]
|
|
448
|
-
|
|
455
|
+
|
|
456
|
+
except KeyboardInterrupt:
|
|
457
|
+
print("\nImport process cancelled by user (Ctrl+C).")
|
|
458
|
+
print("Partial imports may have been completed.")
|
|
459
|
+
return [{"success": False, "error": "Import cancelled by user"}]
|
|
449
460
|
except Exception as e:
|
|
450
461
|
print(f"ERROR: {str(e)}")
|
|
451
462
|
return [{"success": False, "error": str(e)}]
|
|
@@ -33,8 +33,10 @@ def site_import_parse(subparsers, import_parser):
|
|
|
33
33
|
help='Delay between batches in seconds (default: 2)')
|
|
34
34
|
socket_sites_parser.add_argument('--sites-only', action='store_true',
|
|
35
35
|
help='Import only sites, skip interfaces and network ranges')
|
|
36
|
-
socket_sites_parser.add_argument('--interfaces-only', action='store_true',
|
|
36
|
+
socket_sites_parser.add_argument('--wan-interfaces-only', action='store_true',
|
|
37
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')
|
|
38
40
|
socket_sites_parser.add_argument('--network-ranges-only', action='store_true',
|
|
39
41
|
help='Import only network ranges, skip sites and interfaces')
|
|
40
42
|
socket_sites_parser.add_argument('-v', '--verbose', action='store_true', help='Verbose output')
|
|
@@ -47,6 +47,7 @@ def sanitize_name_for_terraform(name):
|
|
|
47
47
|
def extract_socket_sites_data(sites_data):
|
|
48
48
|
"""Extract socket sites, WAN interfaces, and network ranges from the sites data"""
|
|
49
49
|
sites = []
|
|
50
|
+
lan_interfaces = []
|
|
50
51
|
wan_interfaces = []
|
|
51
52
|
network_ranges = []
|
|
52
53
|
|
|
@@ -110,6 +111,14 @@ def extract_socket_sites_data(sites_data):
|
|
|
110
111
|
for lan_interface in site.get('lan_interfaces', []):
|
|
111
112
|
interface_id = lan_interface.get('id', '')
|
|
112
113
|
interface_name = lan_interface.get('name', '')
|
|
114
|
+
lan_interfaces.append({
|
|
115
|
+
'site_id': site['id'],
|
|
116
|
+
'interface_id': lan_interface['id'],
|
|
117
|
+
'name': lan_interface['name'],
|
|
118
|
+
'dest_type': lan_interface.get('destType', 'CATO'),
|
|
119
|
+
'subnet': lan_interface.get('subnet', ''),
|
|
120
|
+
'local_ip': lan_interface.get('local_ip', ''),
|
|
121
|
+
})
|
|
113
122
|
|
|
114
123
|
for network_range in lan_interface.get('network_ranges', []):
|
|
115
124
|
if network_range.get('id') and network_range.get('subnet'):
|
|
@@ -165,6 +174,9 @@ def run_terraform_import(resource_address, resource_id, timeout=60, verbose=Fals
|
|
|
165
174
|
print(f"Error: {result.stderr}")
|
|
166
175
|
return False, result.stdout, result.stderr
|
|
167
176
|
|
|
177
|
+
except KeyboardInterrupt:
|
|
178
|
+
print(f"\nImport cancelled by user (Ctrl+C)")
|
|
179
|
+
raise # Re-raise to allow higher-level handling
|
|
168
180
|
except subprocess.TimeoutExpired:
|
|
169
181
|
print(f"Timeout: {resource_address} (exceeded {timeout}s)")
|
|
170
182
|
return False, "", f"Command timed out after {timeout} seconds"
|
|
@@ -608,6 +620,54 @@ def import_wan_interfaces(wan_interfaces, module_name, verbose=False,
|
|
|
608
620
|
print(f"\nWAN Interface Import Summary: {successful_imports} successful, {failed_imports} failed")
|
|
609
621
|
return successful_imports, failed_imports
|
|
610
622
|
|
|
623
|
+
def import_lan_interfaces(lan_interfaces, module_name, verbose=False,
|
|
624
|
+
resource_type="cato_lan_interface", resource_name="lan_interfaces",
|
|
625
|
+
batch_size=10, delay_between_batches=2, auto_approve=False):
|
|
626
|
+
"""Import all WAN interfaces in batches"""
|
|
627
|
+
print("\nStarting WAN interface imports...")
|
|
628
|
+
successful_imports = 0
|
|
629
|
+
failed_imports = 0
|
|
630
|
+
total_interfaces = len(lan_interfaces)
|
|
631
|
+
|
|
632
|
+
for i, interface in enumerate(lan_interfaces):
|
|
633
|
+
site_id = interface['site_id']
|
|
634
|
+
interface_id = interface['id']
|
|
635
|
+
interface_index = interface['index']
|
|
636
|
+
interface_name = interface['name']
|
|
637
|
+
site_name = interface['site_name']
|
|
638
|
+
|
|
639
|
+
# Add module. prefix if not present
|
|
640
|
+
if not module_name.startswith('module.'):
|
|
641
|
+
module_name = f'module.{module_name}'
|
|
642
|
+
|
|
643
|
+
# Use correct resource addressing for WAN interfaces
|
|
644
|
+
# WAN interfaces use the interface role as the key
|
|
645
|
+
lan_role = interface['role']
|
|
646
|
+
resource_address = f'{module_name}.module.socket-site["{site_name}"].cato_lan_interface.lan["{interface_index}"]'
|
|
647
|
+
|
|
648
|
+
print(f"\n[{i+1}/{total_interfaces}] LAN Interface: {interface_name} on {site_name} (ID: {interface_id})")
|
|
649
|
+
|
|
650
|
+
success, stdout, stderr = run_terraform_import(resource_address, interface_id, verbose=verbose)
|
|
651
|
+
|
|
652
|
+
if success:
|
|
653
|
+
successful_imports += 1
|
|
654
|
+
else:
|
|
655
|
+
failed_imports += 1
|
|
656
|
+
|
|
657
|
+
# Ask user if they want to continue on failure (unless auto-approved)
|
|
658
|
+
if failed_imports <= 3 and not auto_approve: # Only prompt for first few failures
|
|
659
|
+
response = input(f"\nContinue with remaining imports? (y/n): ").lower()
|
|
660
|
+
if response == 'n':
|
|
661
|
+
print("Import process stopped by user.")
|
|
662
|
+
break
|
|
663
|
+
|
|
664
|
+
# Delay between batches
|
|
665
|
+
if (i + 1) % batch_size == 0 and i < total_interfaces - 1:
|
|
666
|
+
print(f"\n Batch complete. Waiting {delay_between_batches}s before next batch...")
|
|
667
|
+
time.sleep(delay_between_batches)
|
|
668
|
+
|
|
669
|
+
print(f"\nWAN Interface Import Summary: {successful_imports} successful, {failed_imports} failed")
|
|
670
|
+
return successful_imports, failed_imports
|
|
611
671
|
|
|
612
672
|
def import_network_ranges(network_ranges, module_name, verbose=False,
|
|
613
673
|
resource_type="cato_network_range", resource_name="network_ranges",
|
|
@@ -640,9 +700,9 @@ def import_network_ranges(network_ranges, module_name, verbose=False,
|
|
|
640
700
|
else:
|
|
641
701
|
terraform_interface_id = interface_id
|
|
642
702
|
|
|
643
|
-
resource_address = f'{module_name}.module.socket-site["{site_name}"].module.lan_interfaces["{terraform_interface_id}"].module.network_range["{
|
|
703
|
+
resource_address = f'{module_name}.module.socket-site["{site_name}"].module.lan_interfaces["{terraform_interface_id}"].module.network_range["{network_range_id}"].cato_network_range.no_dhcp[0]'
|
|
644
704
|
|
|
645
|
-
print(f"\n[{i+1}/{total_ranges}] Network Range: {range_name}
|
|
705
|
+
print(f"\n[{i+1}/{total_ranges}] Network Range: {range_name} - {subnet} ({network_range_id}) on {site_name} (ID: {network_range_id})")
|
|
646
706
|
|
|
647
707
|
success, stdout, stderr = run_terraform_import(resource_address, network_range_id, verbose=verbose)
|
|
648
708
|
|
|
@@ -825,8 +885,8 @@ def import_socket_sites_to_tf(args, configuration):
|
|
|
825
885
|
import_summary.append(f"{len(network_ranges)} network ranges")
|
|
826
886
|
elif args.sites_only:
|
|
827
887
|
import_summary.append(f"{len(sites)} sites only")
|
|
828
|
-
elif args.
|
|
829
|
-
import_summary.append(f"{len(
|
|
888
|
+
elif args.lan_interfaces_only:
|
|
889
|
+
import_summary.append(f"{len(lan_interfaces)} LAN interfaces only")
|
|
830
890
|
elif args.network_ranges_only:
|
|
831
891
|
import_summary.append(f"{len(network_ranges)} network ranges only")
|
|
832
892
|
|
|
@@ -860,7 +920,16 @@ def import_socket_sites_to_tf(args, configuration):
|
|
|
860
920
|
auto_approve=getattr(args, 'auto_approve', False))
|
|
861
921
|
total_successful += successful
|
|
862
922
|
total_failed += failed
|
|
863
|
-
|
|
923
|
+
|
|
924
|
+
# Import LAN interfaces (if not skipped)
|
|
925
|
+
if not args.sites_only and not args.network_ranges_only and lan_interfaces:
|
|
926
|
+
successful, failed = import_lan_interfaces(lan_interfaces, module_name=args.module_name,
|
|
927
|
+
verbose=args.verbose, batch_size=args.batch_size,
|
|
928
|
+
delay_between_batches=args.delay,
|
|
929
|
+
auto_approve=getattr(args, 'auto_approve', False))
|
|
930
|
+
total_successful += successful
|
|
931
|
+
total_failed += failed
|
|
932
|
+
|
|
864
933
|
# Import network ranges (if not skipped)
|
|
865
934
|
if not args.sites_only and not args.interfaces_only and network_ranges:
|
|
866
935
|
successful, failed = import_network_ranges(network_ranges, module_name=args.module_name,
|
|
@@ -885,7 +954,11 @@ def import_socket_sites_to_tf(args, configuration):
|
|
|
885
954
|
"total_failed": total_failed,
|
|
886
955
|
"module_name": args.module_name
|
|
887
956
|
}]
|
|
888
|
-
|
|
957
|
+
|
|
958
|
+
except KeyboardInterrupt:
|
|
959
|
+
print("\nImport process cancelled by user (Ctrl+C).")
|
|
960
|
+
print("Partial imports may have been completed.")
|
|
961
|
+
return [{"success": False, "error": "Import cancelled by user"}]
|
|
889
962
|
except Exception as e:
|
|
890
963
|
print(f"ERROR: {str(e)}")
|
|
891
964
|
return [{"success": False, "error": str(e)}]
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Private commands parser for custom GraphQL payloads
|
|
4
|
+
Dynamically loads commands from ~/.cato/settings.json
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import os
|
|
8
|
+
import json
|
|
9
|
+
import argparse
|
|
10
|
+
from ..parserApiClient import createPrivateRequest, get_private_help
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def load_private_settings():
|
|
14
|
+
"""Load private settings from ~/.cato/settings.json"""
|
|
15
|
+
settings_file = os.path.expanduser("~/.cato/settings.json")
|
|
16
|
+
try:
|
|
17
|
+
with open(settings_file, 'r') as f:
|
|
18
|
+
settings = json.load(f)
|
|
19
|
+
return settings.get('privateCommands', {})
|
|
20
|
+
except (FileNotFoundError, json.JSONDecodeError, KeyError):
|
|
21
|
+
return {}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def private_parse(subparsers):
|
|
25
|
+
"""Check for private settings and create private parser if found"""
|
|
26
|
+
private_commands = load_private_settings()
|
|
27
|
+
|
|
28
|
+
if not private_commands:
|
|
29
|
+
return None
|
|
30
|
+
|
|
31
|
+
# Create the private subparser
|
|
32
|
+
private_parser = subparsers.add_parser(
|
|
33
|
+
'private',
|
|
34
|
+
help='Private custom commands (configured in ~/.cato/settings.json)',
|
|
35
|
+
usage='catocli private <command> [options]'
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
private_subparsers = private_parser.add_subparsers(
|
|
39
|
+
description='Available private commands',
|
|
40
|
+
help='Private command help'
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
# Dynamically create subparsers for each private command
|
|
44
|
+
for command_name, command_config in private_commands.items():
|
|
45
|
+
create_private_command_parser(
|
|
46
|
+
private_subparsers,
|
|
47
|
+
command_name,
|
|
48
|
+
command_config
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
return private_parser
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def create_private_command_parser(subparsers, command_name, command_config):
|
|
55
|
+
"""Create a parser for a specific private command"""
|
|
56
|
+
|
|
57
|
+
# Create the command parser
|
|
58
|
+
cmd_parser = subparsers.add_parser(
|
|
59
|
+
command_name,
|
|
60
|
+
help=f'Execute private command: {command_name}',
|
|
61
|
+
usage=get_private_help(command_name, command_config)
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
# Add standard arguments
|
|
65
|
+
cmd_parser.add_argument(
|
|
66
|
+
'json',
|
|
67
|
+
nargs='?',
|
|
68
|
+
default='{}',
|
|
69
|
+
help='Variables in JSON format (defaults to empty object if not provided).'
|
|
70
|
+
)
|
|
71
|
+
cmd_parser.add_argument(
|
|
72
|
+
'-t',
|
|
73
|
+
const=True,
|
|
74
|
+
default=False,
|
|
75
|
+
nargs='?',
|
|
76
|
+
help='Print GraphQL query without sending API call'
|
|
77
|
+
)
|
|
78
|
+
cmd_parser.add_argument(
|
|
79
|
+
'-v',
|
|
80
|
+
const=True,
|
|
81
|
+
default=False,
|
|
82
|
+
nargs='?',
|
|
83
|
+
help='Verbose output'
|
|
84
|
+
)
|
|
85
|
+
cmd_parser.add_argument(
|
|
86
|
+
'-p',
|
|
87
|
+
const=True,
|
|
88
|
+
default=False,
|
|
89
|
+
nargs='?',
|
|
90
|
+
help='Pretty print'
|
|
91
|
+
)
|
|
92
|
+
cmd_parser.add_argument(
|
|
93
|
+
'-H', '--header',
|
|
94
|
+
action='append',
|
|
95
|
+
dest='headers',
|
|
96
|
+
help='Add custom headers in "Key: Value" format. Can be used multiple times.'
|
|
97
|
+
)
|
|
98
|
+
cmd_parser.add_argument(
|
|
99
|
+
'--headers-file',
|
|
100
|
+
dest='headers_file',
|
|
101
|
+
help='Load headers from a file. Each line should contain a header in "Key: Value" format.'
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
# Add standard accountID argument (like other commands)
|
|
105
|
+
cmd_parser.add_argument(
|
|
106
|
+
'-accountID',
|
|
107
|
+
help='Override the account ID from profile with this value.'
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
# Add dynamic arguments based on command configuration (excluding accountId since it's handled above)
|
|
111
|
+
if 'arguments' in command_config:
|
|
112
|
+
for arg in command_config['arguments']:
|
|
113
|
+
arg_name = arg.get('name')
|
|
114
|
+
# Skip accountId since it's handled by the standard -accountID argument
|
|
115
|
+
if arg_name and arg_name.lower() != 'accountid':
|
|
116
|
+
arg_type = arg.get('type', 'string')
|
|
117
|
+
arg_default = arg.get('default')
|
|
118
|
+
arg_help = f"Argument: {arg_name}"
|
|
119
|
+
|
|
120
|
+
if arg_default:
|
|
121
|
+
arg_help += f" (default: {arg_default})"
|
|
122
|
+
|
|
123
|
+
cmd_parser.add_argument(
|
|
124
|
+
f'--{arg_name}',
|
|
125
|
+
help=arg_help,
|
|
126
|
+
default=arg_default
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
# Set the function to handle this command
|
|
130
|
+
cmd_parser.set_defaults(
|
|
131
|
+
func=createPrivateRequest,
|
|
132
|
+
private_command=command_name,
|
|
133
|
+
private_config=command_config
|
|
134
|
+
)
|
|
@@ -21,6 +21,19 @@ def mutation_accountManagement_parse(mutation_subparsers):
|
|
|
21
21
|
mutation_accountManagement_addAccount_parser.add_argument('--headers-file', dest='headers_file', help='Load headers from a file. Each line should contain a header in "Key: Value" format.')
|
|
22
22
|
mutation_accountManagement_addAccount_parser.set_defaults(func=createRequest,operation_name='mutation.accountManagement.addAccount')
|
|
23
23
|
|
|
24
|
+
mutation_accountManagement_disableAccount_parser = mutation_accountManagement_subparsers.add_parser('disableAccount',
|
|
25
|
+
help='disableAccount() accountManagement operation',
|
|
26
|
+
usage=get_help("mutation_accountManagement_disableAccount"))
|
|
27
|
+
|
|
28
|
+
mutation_accountManagement_disableAccount_parser.add_argument('json', nargs='?', default='{}', help='Variables in JSON format (defaults to empty object if not provided).')
|
|
29
|
+
mutation_accountManagement_disableAccount_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
30
|
+
mutation_accountManagement_disableAccount_parser.add_argument('-t', const=True, default=False, nargs='?', help='Print GraphQL query without sending API call')
|
|
31
|
+
mutation_accountManagement_disableAccount_parser.add_argument('-v', const=True, default=False, nargs='?', help='Verbose output')
|
|
32
|
+
mutation_accountManagement_disableAccount_parser.add_argument('-p', const=True, default=False, nargs='?', help='Pretty print')
|
|
33
|
+
mutation_accountManagement_disableAccount_parser.add_argument('-H', '--header', action='append', dest='headers', help='Add custom headers in "Key: Value" format. Can be used multiple times.')
|
|
34
|
+
mutation_accountManagement_disableAccount_parser.add_argument('--headers-file', dest='headers_file', help='Load headers from a file. Each line should contain a header in "Key: Value" format.')
|
|
35
|
+
mutation_accountManagement_disableAccount_parser.set_defaults(func=createRequest,operation_name='mutation.accountManagement.disableAccount')
|
|
36
|
+
|
|
24
37
|
mutation_accountManagement_removeAccount_parser = mutation_accountManagement_subparsers.add_parser('removeAccount',
|
|
25
38
|
help='removeAccount() accountManagement operation',
|
|
26
39
|
usage=get_help("mutation_accountManagement_removeAccount"))
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
## CATO-CLI - mutation.accountManagement.disableAccount:
|
|
3
|
+
[Click here](https://api.catonetworks.com/documentation/#mutation-disableAccount) for documentation on this operation.
|
|
4
|
+
|
|
5
|
+
### Usage for mutation.accountManagement.disableAccount:
|
|
6
|
+
|
|
7
|
+
`catocli mutation accountManagement disableAccount -h`
|
|
8
|
+
|
|
9
|
+
`catocli mutation accountManagement disableAccount <json>`
|
|
10
|
+
|
|
11
|
+
`catocli mutation accountManagement disableAccount "$(cat < disableAccount.json)"`
|
|
12
|
+
|
|
13
|
+
`catocli mutation accountManagement disableAccount '{}'`
|
|
14
|
+
|
|
15
|
+
#### Operation Arguments for mutation.accountManagement.disableAccount ####
|
|
16
|
+
`accountId` [ID] - (required) N/A
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
from ..parserApiClient import createRequest, get_help
|
|
3
|
+
|
|
4
|
+
def mutation_groups_parse(mutation_subparsers):
|
|
5
|
+
mutation_groups_parser = mutation_subparsers.add_parser('groups',
|
|
6
|
+
help='groups() mutation operation',
|
|
7
|
+
usage=get_help("mutation_groups"))
|
|
8
|
+
|
|
9
|
+
mutation_groups_subparsers = mutation_groups_parser.add_subparsers()
|
|
10
|
+
|
|
11
|
+
mutation_groups_createGroup_parser = mutation_groups_subparsers.add_parser('createGroup',
|
|
12
|
+
help='createGroup() groups operation',
|
|
13
|
+
usage=get_help("mutation_groups_createGroup"))
|
|
14
|
+
|
|
15
|
+
mutation_groups_createGroup_parser.add_argument('json', nargs='?', default='{}', help='Variables in JSON format (defaults to empty object if not provided).')
|
|
16
|
+
mutation_groups_createGroup_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
17
|
+
mutation_groups_createGroup_parser.add_argument('-t', const=True, default=False, nargs='?', help='Print GraphQL query without sending API call')
|
|
18
|
+
mutation_groups_createGroup_parser.add_argument('-v', const=True, default=False, nargs='?', help='Verbose output')
|
|
19
|
+
mutation_groups_createGroup_parser.add_argument('-p', const=True, default=False, nargs='?', help='Pretty print')
|
|
20
|
+
mutation_groups_createGroup_parser.add_argument('-H', '--header', action='append', dest='headers', help='Add custom headers in "Key: Value" format. Can be used multiple times.')
|
|
21
|
+
mutation_groups_createGroup_parser.add_argument('--headers-file', dest='headers_file', help='Load headers from a file. Each line should contain a header in "Key: Value" format.')
|
|
22
|
+
mutation_groups_createGroup_parser.set_defaults(func=createRequest,operation_name='mutation.groups.createGroup')
|
|
23
|
+
|
|
24
|
+
mutation_groups_deleteGroup_parser = mutation_groups_subparsers.add_parser('deleteGroup',
|
|
25
|
+
help='deleteGroup() groups operation',
|
|
26
|
+
usage=get_help("mutation_groups_deleteGroup"))
|
|
27
|
+
|
|
28
|
+
mutation_groups_deleteGroup_parser.add_argument('json', nargs='?', default='{}', help='Variables in JSON format (defaults to empty object if not provided).')
|
|
29
|
+
mutation_groups_deleteGroup_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
30
|
+
mutation_groups_deleteGroup_parser.add_argument('-t', const=True, default=False, nargs='?', help='Print GraphQL query without sending API call')
|
|
31
|
+
mutation_groups_deleteGroup_parser.add_argument('-v', const=True, default=False, nargs='?', help='Verbose output')
|
|
32
|
+
mutation_groups_deleteGroup_parser.add_argument('-p', const=True, default=False, nargs='?', help='Pretty print')
|
|
33
|
+
mutation_groups_deleteGroup_parser.add_argument('-H', '--header', action='append', dest='headers', help='Add custom headers in "Key: Value" format. Can be used multiple times.')
|
|
34
|
+
mutation_groups_deleteGroup_parser.add_argument('--headers-file', dest='headers_file', help='Load headers from a file. Each line should contain a header in "Key: Value" format.')
|
|
35
|
+
mutation_groups_deleteGroup_parser.set_defaults(func=createRequest,operation_name='mutation.groups.deleteGroup')
|
|
36
|
+
|
|
37
|
+
mutation_groups_updateGroup_parser = mutation_groups_subparsers.add_parser('updateGroup',
|
|
38
|
+
help='updateGroup() groups operation',
|
|
39
|
+
usage=get_help("mutation_groups_updateGroup"))
|
|
40
|
+
|
|
41
|
+
mutation_groups_updateGroup_parser.add_argument('json', nargs='?', default='{}', help='Variables in JSON format (defaults to empty object if not provided).')
|
|
42
|
+
mutation_groups_updateGroup_parser.add_argument('-accountID', help='Override the CATO_ACCOUNT_ID environment variable with this value.')
|
|
43
|
+
mutation_groups_updateGroup_parser.add_argument('-t', const=True, default=False, nargs='?', help='Print GraphQL query without sending API call')
|
|
44
|
+
mutation_groups_updateGroup_parser.add_argument('-v', const=True, default=False, nargs='?', help='Verbose output')
|
|
45
|
+
mutation_groups_updateGroup_parser.add_argument('-p', const=True, default=False, nargs='?', help='Pretty print')
|
|
46
|
+
mutation_groups_updateGroup_parser.add_argument('-H', '--header', action='append', dest='headers', help='Add custom headers in "Key: Value" format. Can be used multiple times.')
|
|
47
|
+
mutation_groups_updateGroup_parser.add_argument('--headers-file', dest='headers_file', help='Load headers from a file. Each line should contain a header in "Key: Value" format.')
|
|
48
|
+
mutation_groups_updateGroup_parser.set_defaults(func=createRequest,operation_name='mutation.groups.updateGroup')
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
## CATO-CLI - mutation.groups.createGroup:
|
|
3
|
+
[Click here](https://api.catonetworks.com/documentation/#mutation-createGroup) for documentation on this operation.
|
|
4
|
+
|
|
5
|
+
### Usage for mutation.groups.createGroup:
|
|
6
|
+
|
|
7
|
+
`catocli mutation groups createGroup -h`
|
|
8
|
+
|
|
9
|
+
`catocli mutation groups createGroup <json>`
|
|
10
|
+
|
|
11
|
+
`catocli mutation groups createGroup "$(cat < createGroup.json)"`
|
|
12
|
+
|
|
13
|
+
`catocli mutation groups createGroup '{"createGroupInput": {"description": {"description": "String"}, "groupMemberRefTypedInput": {"by": {"by": "enum(ObjectRefBy)"}, "input": {"input": "String"}, "type": {"type": "enum(GroupMemberRefType)"}}, "name": {"name": "String"}}, "groupMembersListInput": {"groupMembersListFilterInput": {"name": {"eq": {"eq": "String"}, "in": {"in": ["String"]}, "neq": {"neq": "String"}, "nin": {"nin": ["String"]}, "regex": {"regex": "String"}}, "type": {"eq": {"eq": "enum(GroupMemberRefType)"}, "in": {"in": "enum(GroupMemberRefType)"}, "neq": {"neq": "enum(GroupMemberRefType)"}, "nin": {"nin": "enum(GroupMemberRefType)"}}}, "groupMembersListSortInput": {"name": {"direction": {"direction": "enum(SortOrder)"}, "priority": {"priority": "Int"}}, "type": {"direction": {"direction": "enum(SortOrder)"}, "priority": {"priority": "Int"}}}, "pagingInput": {"from": {"from": "Int"}, "limit": {"limit": "Int"}}}}'`
|
|
14
|
+
|
|
15
|
+
#### Operation Arguments for mutation.groups.createGroup ####
|
|
16
|
+
`accountId` [ID] - (required) N/A
|
|
17
|
+
`createGroupInput` [CreateGroupInput] - (required) N/A
|
|
18
|
+
`groupMembersListInput` [GroupMembersListInput] - (required) N/A
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
## CATO-CLI - mutation.groups.deleteGroup:
|
|
3
|
+
[Click here](https://api.catonetworks.com/documentation/#mutation-deleteGroup) for documentation on this operation.
|
|
4
|
+
|
|
5
|
+
### Usage for mutation.groups.deleteGroup:
|
|
6
|
+
|
|
7
|
+
`catocli mutation groups deleteGroup -h`
|
|
8
|
+
|
|
9
|
+
`catocli mutation groups deleteGroup <json>`
|
|
10
|
+
|
|
11
|
+
`catocli mutation groups deleteGroup "$(cat < deleteGroup.json)"`
|
|
12
|
+
|
|
13
|
+
`catocli mutation groups deleteGroup '{"groupMembersListInput": {"groupMembersListFilterInput": {"name": {"eq": {"eq": "String"}, "in": {"in": ["String"]}, "neq": {"neq": "String"}, "nin": {"nin": ["String"]}, "regex": {"regex": "String"}}, "type": {"eq": {"eq": "enum(GroupMemberRefType)"}, "in": {"in": "enum(GroupMemberRefType)"}, "neq": {"neq": "enum(GroupMemberRefType)"}, "nin": {"nin": "enum(GroupMemberRefType)"}}}, "groupMembersListSortInput": {"name": {"direction": {"direction": "enum(SortOrder)"}, "priority": {"priority": "Int"}}, "type": {"direction": {"direction": "enum(SortOrder)"}, "priority": {"priority": "Int"}}}, "pagingInput": {"from": {"from": "Int"}, "limit": {"limit": "Int"}}}, "groupRefInput": {"by": {"by": "enum(ObjectRefBy)"}, "input": {"input": "String"}}}'`
|
|
14
|
+
|
|
15
|
+
#### Operation Arguments for mutation.groups.deleteGroup ####
|
|
16
|
+
`accountId` [ID] - (required) N/A
|
|
17
|
+
`groupMembersListInput` [GroupMembersListInput] - (required) N/A
|
|
18
|
+
`groupRefInput` [GroupRefInput] - (required) N/A
|