catocli 2.1.1__py3-none-any.whl → 2.1.3__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 +207 -211
- catocli/Utils/cliutils.py +178 -0
- catocli/__init__.py +1 -1
- catocli/parsers/custom/customLib.py +1 -1
- catocli/parsers/custom/export_sites/export_sites.py +121 -133
- catocli/parsers/customParserApiClient.py +1195 -0
- catocli/parsers/custom_private/__init__.py +2 -14
- catocli/parsers/mutation_accountManagement/__init__.py +45 -58
- catocli/parsers/mutation_accountManagement_addAccount/README.md +7 -5
- catocli/parsers/mutation_accountManagement_removeAccount/README.md +4 -5
- catocli/parsers/mutation_accountManagement_updateAccount/README.md +7 -5
- catocli/parsers/mutation_admin/__init__.py +84 -45
- catocli/parsers/mutation_admin_addAdmin/README.md +7 -5
- catocli/parsers/mutation_admin_addServicePrincipalAdmin/README.md +19 -0
- catocli/parsers/mutation_admin_removeAdmin/README.md +7 -5
- catocli/parsers/mutation_admin_removeServicePrincipalAdmin/README.md +19 -0
- catocli/parsers/mutation_admin_updateAdmin/README.md +8 -6
- catocli/parsers/mutation_admin_updateServicePrincipalAdmin/README.md +20 -0
- catocli/parsers/mutation_container/__init__.py +135 -135
- catocli/parsers/mutation_container_delete/README.md +7 -5
- catocli/parsers/mutation_container_fqdn_addValues/README.md +7 -5
- catocli/parsers/mutation_container_fqdn_createFromFile/README.md +7 -5
- catocli/parsers/mutation_container_fqdn_removeValues/README.md +7 -5
- catocli/parsers/mutation_container_fqdn_updateFromFile/README.md +7 -5
- catocli/parsers/mutation_container_ipAddressRange_addValues/README.md +7 -5
- catocli/parsers/mutation_container_ipAddressRange_createFromFile/README.md +7 -5
- catocli/parsers/mutation_container_ipAddressRange_removeValues/README.md +7 -5
- catocli/parsers/mutation_container_ipAddressRange_updateFromFile/README.md +7 -5
- catocli/parsers/mutation_enterpriseDirectory/README.md +7 -0
- catocli/parsers/mutation_enterpriseDirectory/__init__.py +61 -0
- catocli/parsers/mutation_enterpriseDirectory_archiveLocation/README.md +19 -0
- catocli/parsers/mutation_enterpriseDirectory_createLocation/README.md +19 -0
- catocli/parsers/mutation_enterpriseDirectory_restoreLocation/README.md +19 -0
- catocli/parsers/mutation_enterpriseDirectory_updateLocation/README.md +19 -0
- catocli/parsers/mutation_groups/__init__.py +45 -45
- catocli/parsers/mutation_groups_createGroup/README.md +8 -6
- catocli/parsers/mutation_groups_deleteGroup/README.md +8 -6
- catocli/parsers/mutation_groups_updateGroup/README.md +8 -6
- catocli/parsers/mutation_hardware/__init__.py +16 -16
- catocli/parsers/mutation_hardware_updateHardwareShipping/README.md +7 -5
- catocli/parsers/mutation_policy/__init__.py +1302 -1302
- catocli/parsers/mutation_policy_appTenantRestriction_addRule/README.md +8 -6
- catocli/parsers/mutation_policy_appTenantRestriction_addSection/README.md +8 -6
- catocli/parsers/mutation_policy_appTenantRestriction_createPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_appTenantRestriction_discardPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_appTenantRestriction_moveRule/README.md +8 -6
- catocli/parsers/mutation_policy_appTenantRestriction_moveSection/README.md +8 -6
- catocli/parsers/mutation_policy_appTenantRestriction_publishPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_appTenantRestriction_removeRule/README.md +8 -6
- catocli/parsers/mutation_policy_appTenantRestriction_removeSection/README.md +8 -6
- catocli/parsers/mutation_policy_appTenantRestriction_updatePolicy/README.md +8 -6
- catocli/parsers/mutation_policy_appTenantRestriction_updateRule/README.md +8 -6
- catocli/parsers/mutation_policy_appTenantRestriction_updateSection/README.md +8 -6
- catocli/parsers/mutation_policy_dynamicIpAllocation_addRule/README.md +8 -6
- catocli/parsers/mutation_policy_dynamicIpAllocation_addSection/README.md +8 -6
- catocli/parsers/mutation_policy_dynamicIpAllocation_createPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_dynamicIpAllocation_discardPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_dynamicIpAllocation_moveRule/README.md +8 -6
- catocli/parsers/mutation_policy_dynamicIpAllocation_moveSection/README.md +8 -6
- catocli/parsers/mutation_policy_dynamicIpAllocation_publishPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_dynamicIpAllocation_removeRule/README.md +8 -6
- catocli/parsers/mutation_policy_dynamicIpAllocation_removeSection/README.md +8 -6
- catocli/parsers/mutation_policy_dynamicIpAllocation_updatePolicy/README.md +8 -6
- catocli/parsers/mutation_policy_dynamicIpAllocation_updateRule/README.md +8 -6
- catocli/parsers/mutation_policy_dynamicIpAllocation_updateSection/README.md +8 -6
- catocli/parsers/mutation_policy_internetFirewall_addRule/README.md +8 -6
- catocli/parsers/mutation_policy_internetFirewall_addSection/README.md +8 -6
- catocli/parsers/mutation_policy_internetFirewall_createPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_internetFirewall_discardPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_internetFirewall_moveRule/README.md +8 -6
- catocli/parsers/mutation_policy_internetFirewall_moveSection/README.md +8 -6
- catocli/parsers/mutation_policy_internetFirewall_publishPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_internetFirewall_removeRule/README.md +8 -6
- catocli/parsers/mutation_policy_internetFirewall_removeSection/README.md +8 -6
- catocli/parsers/mutation_policy_internetFirewall_updatePolicy/README.md +8 -6
- catocli/parsers/mutation_policy_internetFirewall_updateRule/README.md +8 -6
- catocli/parsers/mutation_policy_internetFirewall_updateSection/README.md +8 -6
- catocli/parsers/mutation_policy_remotePortFwd_addRule/README.md +8 -6
- catocli/parsers/mutation_policy_remotePortFwd_addSection/README.md +8 -6
- catocli/parsers/mutation_policy_remotePortFwd_createPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_remotePortFwd_discardPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_remotePortFwd_moveRule/README.md +8 -6
- catocli/parsers/mutation_policy_remotePortFwd_moveSection/README.md +8 -6
- catocli/parsers/mutation_policy_remotePortFwd_publishPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_remotePortFwd_removeRule/README.md +8 -6
- catocli/parsers/mutation_policy_remotePortFwd_removeSection/README.md +8 -6
- catocli/parsers/mutation_policy_remotePortFwd_updatePolicy/README.md +8 -6
- catocli/parsers/mutation_policy_remotePortFwd_updateRule/README.md +8 -6
- catocli/parsers/mutation_policy_remotePortFwd_updateSection/README.md +8 -6
- catocli/parsers/mutation_policy_socketLan_addRule/README.md +8 -6
- catocli/parsers/mutation_policy_socketLan_addSection/README.md +8 -6
- catocli/parsers/mutation_policy_socketLan_createPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_socketLan_discardPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_socketLan_moveRule/README.md +8 -6
- catocli/parsers/mutation_policy_socketLan_moveSection/README.md +8 -6
- catocli/parsers/mutation_policy_socketLan_publishPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_socketLan_removeRule/README.md +8 -6
- catocli/parsers/mutation_policy_socketLan_removeSection/README.md +8 -6
- catocli/parsers/mutation_policy_socketLan_updatePolicy/README.md +8 -6
- catocli/parsers/mutation_policy_socketLan_updateRule/README.md +8 -6
- catocli/parsers/mutation_policy_socketLan_updateSection/README.md +8 -6
- catocli/parsers/mutation_policy_terminalServer_addRule/README.md +8 -6
- catocli/parsers/mutation_policy_terminalServer_addSection/README.md +8 -6
- catocli/parsers/mutation_policy_terminalServer_createPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_terminalServer_discardPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_terminalServer_moveRule/README.md +8 -6
- catocli/parsers/mutation_policy_terminalServer_moveSection/README.md +8 -6
- catocli/parsers/mutation_policy_terminalServer_publishPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_terminalServer_removeRule/README.md +8 -6
- catocli/parsers/mutation_policy_terminalServer_removeSection/README.md +8 -6
- catocli/parsers/mutation_policy_terminalServer_updatePolicy/README.md +8 -6
- catocli/parsers/mutation_policy_terminalServer_updateRule/README.md +8 -6
- catocli/parsers/mutation_policy_terminalServer_updateSection/README.md +8 -6
- catocli/parsers/mutation_policy_wanFirewall_addRule/README.md +8 -6
- catocli/parsers/mutation_policy_wanFirewall_addSection/README.md +8 -6
- catocli/parsers/mutation_policy_wanFirewall_createPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_wanFirewall_discardPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_wanFirewall_moveRule/README.md +8 -6
- catocli/parsers/mutation_policy_wanFirewall_moveSection/README.md +8 -6
- catocli/parsers/mutation_policy_wanFirewall_publishPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_wanFirewall_removeRule/README.md +8 -6
- catocli/parsers/mutation_policy_wanFirewall_removeSection/README.md +8 -6
- catocli/parsers/mutation_policy_wanFirewall_updatePolicy/README.md +8 -6
- catocli/parsers/mutation_policy_wanFirewall_updateRule/README.md +8 -6
- catocli/parsers/mutation_policy_wanFirewall_updateSection/README.md +8 -6
- catocli/parsers/mutation_policy_wanNetwork_addRule/README.md +8 -6
- catocli/parsers/mutation_policy_wanNetwork_addSection/README.md +8 -6
- catocli/parsers/mutation_policy_wanNetwork_createPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_wanNetwork_discardPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_wanNetwork_moveRule/README.md +8 -6
- catocli/parsers/mutation_policy_wanNetwork_moveSection/README.md +8 -6
- catocli/parsers/mutation_policy_wanNetwork_publishPolicyRevision/README.md +8 -6
- catocli/parsers/mutation_policy_wanNetwork_removeRule/README.md +8 -6
- catocli/parsers/mutation_policy_wanNetwork_removeSection/README.md +8 -6
- catocli/parsers/mutation_policy_wanNetwork_updatePolicy/README.md +8 -6
- catocli/parsers/mutation_policy_wanNetwork_updateRule/README.md +8 -6
- catocli/parsers/mutation_policy_wanNetwork_updateSection/README.md +8 -6
- catocli/parsers/mutation_sandbox/__init__.py +27 -27
- catocli/parsers/mutation_sandbox_deleteReport/README.md +7 -5
- catocli/parsers/mutation_sandbox_uploadFile/README.md +7 -5
- catocli/parsers/mutation_site/__init__.py +474 -474
- catocli/parsers/mutation_site_addBgpPeer/README.md +7 -5
- catocli/parsers/mutation_site_addCloudInterconnectPhysicalConnection/README.md +7 -5
- catocli/parsers/mutation_site_addCloudInterconnectSite/README.md +7 -5
- catocli/parsers/mutation_site_addIpsecIkeV2Site/README.md +7 -5
- catocli/parsers/mutation_site_addIpsecIkeV2SiteTunnels/README.md +8 -6
- catocli/parsers/mutation_site_addNetworkRange/README.md +8 -6
- catocli/parsers/mutation_site_addSecondaryAwsVSocket/README.md +7 -5
- catocli/parsers/mutation_site_addSecondaryAzureVSocket/README.md +7 -5
- catocli/parsers/mutation_site_addSocketAddOnCard/README.md +7 -5
- catocli/parsers/mutation_site_addSocketSite/README.md +7 -5
- catocli/parsers/mutation_site_addStaticHost/README.md +8 -6
- catocli/parsers/mutation_site_assignSiteBwLicense/README.md +7 -5
- catocli/parsers/mutation_site_removeBgpPeer/README.md +7 -5
- catocli/parsers/mutation_site_removeCloudInterconnectPhysicalConnection/README.md +7 -5
- catocli/parsers/mutation_site_removeIpsecIkeV2SiteTunnels/README.md +8 -6
- catocli/parsers/mutation_site_removeNetworkRange/README.md +7 -5
- catocli/parsers/mutation_site_removeSecondaryAwsVSocket/README.md +7 -5
- catocli/parsers/mutation_site_removeSecondaryAzureVSocket/README.md +7 -5
- catocli/parsers/mutation_site_removeSite/README.md +7 -5
- catocli/parsers/mutation_site_removeSiteBwLicense/README.md +7 -5
- catocli/parsers/mutation_site_removeSocketAddOnCard/README.md +7 -5
- catocli/parsers/mutation_site_removeStaticHost/README.md +7 -5
- catocli/parsers/mutation_site_replaceSiteBwLicense/README.md +7 -5
- catocli/parsers/mutation_site_startSiteUpgrade/README.md +7 -5
- catocli/parsers/mutation_site_updateBgpPeer/README.md +7 -5
- catocli/parsers/mutation_site_updateCloudInterconnectPhysicalConnection/README.md +7 -5
- catocli/parsers/mutation_site_updateHa/README.md +8 -6
- catocli/parsers/mutation_site_updateIpsecIkeV2SiteGeneralDetails/README.md +8 -6
- catocli/parsers/mutation_site_updateIpsecIkeV2SiteTunnels/README.md +8 -6
- catocli/parsers/mutation_site_updateNetworkRange/README.md +8 -6
- catocli/parsers/mutation_site_updateSecondaryAwsVSocket/README.md +7 -5
- catocli/parsers/mutation_site_updateSecondaryAzureVSocket/README.md +7 -5
- catocli/parsers/mutation_site_updateSiteBwLicense/README.md +7 -5
- catocli/parsers/mutation_site_updateSiteGeneralDetails/README.md +8 -6
- catocli/parsers/mutation_site_updateSocketInterface/README.md +9 -7
- catocli/parsers/mutation_site_updateStaticHost/README.md +8 -6
- catocli/parsers/mutation_sites/__init__.py +474 -474
- catocli/parsers/mutation_sites_addBgpPeer/README.md +7 -5
- catocli/parsers/mutation_sites_addCloudInterconnectPhysicalConnection/README.md +7 -5
- catocli/parsers/mutation_sites_addCloudInterconnectSite/README.md +7 -5
- catocli/parsers/mutation_sites_addIpsecIkeV2Site/README.md +7 -5
- catocli/parsers/mutation_sites_addIpsecIkeV2SiteTunnels/README.md +8 -6
- catocli/parsers/mutation_sites_addNetworkRange/README.md +8 -6
- catocli/parsers/mutation_sites_addSecondaryAwsVSocket/README.md +7 -5
- catocli/parsers/mutation_sites_addSecondaryAzureVSocket/README.md +7 -5
- catocli/parsers/mutation_sites_addSocketAddOnCard/README.md +7 -5
- catocli/parsers/mutation_sites_addSocketSite/README.md +7 -5
- catocli/parsers/mutation_sites_addStaticHost/README.md +8 -6
- catocli/parsers/mutation_sites_assignSiteBwLicense/README.md +7 -5
- catocli/parsers/mutation_sites_removeBgpPeer/README.md +7 -5
- catocli/parsers/mutation_sites_removeCloudInterconnectPhysicalConnection/README.md +7 -5
- catocli/parsers/mutation_sites_removeIpsecIkeV2SiteTunnels/README.md +8 -6
- catocli/parsers/mutation_sites_removeNetworkRange/README.md +7 -5
- catocli/parsers/mutation_sites_removeSecondaryAwsVSocket/README.md +7 -5
- catocli/parsers/mutation_sites_removeSecondaryAzureVSocket/README.md +7 -5
- catocli/parsers/mutation_sites_removeSite/README.md +7 -5
- catocli/parsers/mutation_sites_removeSiteBwLicense/README.md +7 -5
- catocli/parsers/mutation_sites_removeSocketAddOnCard/README.md +7 -5
- catocli/parsers/mutation_sites_removeStaticHost/README.md +7 -5
- catocli/parsers/mutation_sites_replaceSiteBwLicense/README.md +7 -5
- catocli/parsers/mutation_sites_startSiteUpgrade/README.md +7 -5
- catocli/parsers/mutation_sites_updateBgpPeer/README.md +7 -5
- catocli/parsers/mutation_sites_updateCloudInterconnectPhysicalConnection/README.md +7 -5
- catocli/parsers/mutation_sites_updateHa/README.md +8 -6
- catocli/parsers/mutation_sites_updateIpsecIkeV2SiteGeneralDetails/README.md +8 -6
- catocli/parsers/mutation_sites_updateIpsecIkeV2SiteTunnels/README.md +8 -6
- catocli/parsers/mutation_sites_updateNetworkRange/README.md +8 -6
- catocli/parsers/mutation_sites_updateSecondaryAwsVSocket/README.md +7 -5
- catocli/parsers/mutation_sites_updateSecondaryAzureVSocket/README.md +7 -5
- catocli/parsers/mutation_sites_updateSiteBwLicense/README.md +7 -5
- catocli/parsers/mutation_sites_updateSiteGeneralDetails/README.md +8 -6
- catocli/parsers/mutation_sites_updateSocketInterface/README.md +9 -7
- catocli/parsers/mutation_sites_updateStaticHost/README.md +8 -6
- catocli/parsers/mutation_xdr/__init__.py +45 -45
- catocli/parsers/mutation_xdr_addStoryComment/README.md +7 -5
- catocli/parsers/mutation_xdr_analystFeedback/README.md +7 -6
- catocli/parsers/mutation_xdr_deleteStoryComment/README.md +7 -5
- catocli/parsers/query_accountBySubdomain/README.md +7 -5
- catocli/parsers/query_accountBySubdomain/__init__.py +12 -12
- catocli/parsers/query_accountManagement/README.md +4 -5
- catocli/parsers/query_accountManagement/__init__.py +12 -12
- catocli/parsers/query_accountMetrics/README.md +20 -18
- catocli/parsers/query_accountMetrics/__init__.py +12 -12
- catocli/parsers/query_accountRoles/README.md +7 -5
- catocli/parsers/query_accountRoles/__init__.py +12 -12
- catocli/parsers/query_accountSnapshot/README.md +8 -6
- catocli/parsers/query_accountSnapshot/__init__.py +12 -12
- catocli/parsers/query_admin/README.md +7 -5
- catocli/parsers/query_admin/__init__.py +12 -12
- catocli/parsers/query_admins/README.md +11 -9
- catocli/parsers/query_admins/__init__.py +12 -12
- catocli/parsers/query_appStats/README.md +20 -11
- catocli/parsers/query_appStats/__init__.py +12 -12
- catocli/parsers/query_appStatsTimeSeries/README.md +21 -12
- catocli/parsers/query_appStatsTimeSeries/__init__.py +12 -12
- catocli/parsers/query_auditFeed/README.md +10 -8
- catocli/parsers/query_auditFeed/__init__.py +12 -12
- catocli/parsers/query_catalogs/README.md +9 -7
- catocli/parsers/query_catalogs/__init__.py +12 -12
- catocli/parsers/query_container/README.md +13 -11
- catocli/parsers/query_container/__init__.py +12 -12
- catocli/parsers/query_devices/README.md +10 -8
- catocli/parsers/query_devices/__init__.py +12 -12
- catocli/parsers/query_enterpriseDirectory/README.md +19 -0
- catocli/parsers/query_enterpriseDirectory/__init__.py +16 -0
- catocli/parsers/query_entityLookup/README.md +19 -17
- catocli/parsers/query_entityLookup/__init__.py +12 -12
- catocli/parsers/query_events/README.md +13 -11
- catocli/parsers/query_events/__init__.py +12 -12
- catocli/parsers/query_eventsFeed/README.md +9 -7
- catocli/parsers/query_eventsFeed/__init__.py +12 -12
- catocli/parsers/query_eventsTimeSeries/README.md +14 -12
- catocli/parsers/query_eventsTimeSeries/__init__.py +12 -12
- catocli/parsers/query_groups/__init__.py +51 -51
- catocli/parsers/query_groups_groupList/README.md +8 -6
- catocli/parsers/query_groups_group_members/README.md +8 -6
- catocli/parsers/query_groups_whereUsed/README.md +7 -5
- catocli/parsers/query_hardware/README.md +7 -5
- catocli/parsers/query_hardware/__init__.py +12 -12
- catocli/parsers/query_hardwareManagement/README.md +7 -5
- catocli/parsers/query_hardwareManagement/__init__.py +12 -12
- catocli/parsers/query_licensing/README.md +4 -5
- catocli/parsers/query_licensing/__init__.py +12 -12
- catocli/parsers/query_policy/__init__.py +158 -158
- catocli/parsers/query_policy_appTenantRestriction_policy/README.md +7 -5
- catocli/parsers/query_policy_dynamicIpAllocation_policy/README.md +7 -5
- catocli/parsers/query_policy_internetFirewall_policy/README.md +7 -5
- catocli/parsers/query_policy_remotePortFwd_policy/README.md +7 -5
- catocli/parsers/query_policy_socketLan_policy/README.md +7 -5
- catocli/parsers/query_policy_terminalServer_policy/README.md +7 -5
- catocli/parsers/query_policy_wanFirewall_policy/README.md +7 -5
- catocli/parsers/query_policy_wanNetwork_policy/README.md +7 -5
- catocli/parsers/query_popLocations/README.md +7 -5
- catocli/parsers/query_popLocations/__init__.py +12 -12
- catocli/parsers/query_sandbox/README.md +7 -5
- catocli/parsers/query_sandbox/__init__.py +12 -12
- catocli/parsers/query_servicePrincipalAdmin/README.md +19 -0
- catocli/parsers/query_servicePrincipalAdmin/__init__.py +16 -0
- catocli/parsers/query_site/__init__.py +123 -123
- catocli/parsers/query_siteLocation/__init__.py +10 -10
- catocli/parsers/query_site_availableVersionList/README.md +7 -5
- catocli/parsers/query_site_bgpPeer/README.md +7 -5
- catocli/parsers/query_site_bgpPeerList/README.md +7 -5
- catocli/parsers/query_site_cloudInterconnectConnectionConnectivity/README.md +7 -5
- catocli/parsers/query_site_cloudInterconnectPhysicalConnection/README.md +7 -5
- catocli/parsers/query_site_cloudInterconnectPhysicalConnectionId/README.md +7 -5
- catocli/parsers/query_site_secondaryAwsVSocket/README.md +7 -5
- catocli/parsers/query_site_secondaryAzureVSocket/README.md +7 -5
- catocli/parsers/query_site_siteBgpStatus/README.md +7 -5
- catocli/parsers/query_socketPortMetrics/README.md +13 -11
- catocli/parsers/query_socketPortMetrics/__init__.py +12 -12
- catocli/parsers/query_socketPortMetricsTimeSeries/README.md +14 -12
- catocli/parsers/query_socketPortMetricsTimeSeries/__init__.py +12 -12
- catocli/parsers/query_subDomains/README.md +7 -5
- catocli/parsers/query_subDomains/__init__.py +12 -12
- catocli/parsers/query_xdr/__init__.py +27 -27
- catocli/parsers/query_xdr_stories/README.md +7 -6
- catocli/parsers/query_xdr_story/README.md +9 -8
- catocli/parsers/raw/__init__.py +9 -9
- {catocli-2.1.1.dist-info → catocli-2.1.3.dist-info}/METADATA +1 -1
- catocli-2.1.3.dist-info/RECORD +660 -0
- models/mutation.accountManagement.addAccount.json +5 -15
- models/mutation.accountManagement.updateAccount.json +1 -3
- models/mutation.admin.addAdmin.json +14 -35
- models/mutation.admin.addServicePrincipalAdmin.json +2554 -0
- models/mutation.admin.removeAdmin.json +1 -1
- models/mutation.admin.removeServicePrincipalAdmin.json +201 -0
- models/mutation.admin.updateAdmin.json +13 -30
- models/mutation.admin.updateServicePrincipalAdmin.json +2554 -0
- models/mutation.container.delete.json +9 -435
- models/mutation.container.fqdn.addValues.json +6 -11
- models/mutation.container.fqdn.createFromFile.json +4 -12
- models/mutation.container.fqdn.removeValues.json +6 -11
- models/mutation.container.fqdn.updateFromFile.json +5 -15
- models/mutation.container.ipAddressRange.addValues.json +4 -12
- models/mutation.container.ipAddressRange.createFromFile.json +4 -12
- models/mutation.container.ipAddressRange.removeValues.json +4 -12
- models/mutation.container.ipAddressRange.updateFromFile.json +5 -15
- models/mutation.enterpriseDirectory.archiveLocation.json +1046 -0
- models/mutation.enterpriseDirectory.createLocation.json +2521 -0
- models/mutation.enterpriseDirectory.restoreLocation.json +1046 -0
- models/mutation.enterpriseDirectory.updateLocation.json +2567 -0
- models/mutation.groups.createGroup.json +39 -171
- models/mutation.groups.deleteGroup.json +36 -162
- models/mutation.groups.updateGroup.json +41 -177
- models/mutation.hardware.updateHardwareShipping.json +18 -47
- models/mutation.policy.appTenantRestriction.addRule.json +50 -136
- models/mutation.policy.appTenantRestriction.addSection.json +4 -12
- models/mutation.policy.appTenantRestriction.createPolicyRevision.json +3 -9
- models/mutation.policy.appTenantRestriction.discardPolicyRevision.json +2 -6
- models/mutation.policy.appTenantRestriction.moveRule.json +4 -12
- models/mutation.policy.appTenantRestriction.moveSection.json +4 -12
- models/mutation.policy.appTenantRestriction.publishPolicyRevision.json +3 -9
- models/mutation.policy.appTenantRestriction.removeRule.json +2 -6
- models/mutation.policy.appTenantRestriction.removeSection.json +2 -6
- models/mutation.policy.appTenantRestriction.updatePolicy.json +2 -6
- models/mutation.policy.appTenantRestriction.updateRule.json +49 -133
- models/mutation.policy.appTenantRestriction.updateSection.json +3 -9
- models/mutation.policy.dynamicIpAllocation.addRule.json +15 -45
- models/mutation.policy.dynamicIpAllocation.addSection.json +4 -12
- models/mutation.policy.dynamicIpAllocation.createPolicyRevision.json +3 -9
- models/mutation.policy.dynamicIpAllocation.discardPolicyRevision.json +2 -6
- models/mutation.policy.dynamicIpAllocation.moveRule.json +4 -12
- models/mutation.policy.dynamicIpAllocation.moveSection.json +4 -12
- models/mutation.policy.dynamicIpAllocation.publishPolicyRevision.json +3 -9
- models/mutation.policy.dynamicIpAllocation.removeRule.json +2 -6
- models/mutation.policy.dynamicIpAllocation.removeSection.json +2 -6
- models/mutation.policy.dynamicIpAllocation.updatePolicy.json +2 -6
- models/mutation.policy.dynamicIpAllocation.updateRule.json +14 -42
- models/mutation.policy.dynamicIpAllocation.updateSection.json +3 -9
- models/mutation.policy.internetFirewall.addRule.json +248 -542
- models/mutation.policy.internetFirewall.addSection.json +4 -12
- models/mutation.policy.internetFirewall.createPolicyRevision.json +3 -9
- models/mutation.policy.internetFirewall.discardPolicyRevision.json +2 -6
- models/mutation.policy.internetFirewall.moveRule.json +4 -12
- models/mutation.policy.internetFirewall.moveSection.json +4 -12
- models/mutation.policy.internetFirewall.publishPolicyRevision.json +3 -9
- models/mutation.policy.internetFirewall.removeRule.json +2 -6
- models/mutation.policy.internetFirewall.removeSection.json +2 -6
- models/mutation.policy.internetFirewall.updatePolicy.json +2 -6
- models/mutation.policy.internetFirewall.updateRule.json +247 -539
- models/mutation.policy.internetFirewall.updateSection.json +3 -9
- models/mutation.policy.remotePortFwd.addRule.json +35 -91
- models/mutation.policy.remotePortFwd.addSection.json +4 -12
- models/mutation.policy.remotePortFwd.createPolicyRevision.json +3 -9
- models/mutation.policy.remotePortFwd.discardPolicyRevision.json +2 -6
- models/mutation.policy.remotePortFwd.moveRule.json +4 -12
- models/mutation.policy.remotePortFwd.moveSection.json +4 -12
- models/mutation.policy.remotePortFwd.publishPolicyRevision.json +3 -9
- models/mutation.policy.remotePortFwd.removeRule.json +2 -6
- models/mutation.policy.remotePortFwd.removeSection.json +2 -6
- models/mutation.policy.remotePortFwd.updatePolicy.json +2 -6
- models/mutation.policy.remotePortFwd.updateRule.json +34 -88
- models/mutation.policy.remotePortFwd.updateSection.json +3 -9
- models/mutation.policy.socketLan.addRule.json +78 -185
- models/mutation.policy.socketLan.addSection.json +4 -12
- models/mutation.policy.socketLan.createPolicyRevision.json +3 -9
- models/mutation.policy.socketLan.discardPolicyRevision.json +2 -6
- models/mutation.policy.socketLan.moveRule.json +4 -12
- models/mutation.policy.socketLan.moveSection.json +4 -12
- models/mutation.policy.socketLan.publishPolicyRevision.json +3 -9
- models/mutation.policy.socketLan.removeRule.json +2 -6
- models/mutation.policy.socketLan.removeSection.json +2 -6
- models/mutation.policy.socketLan.updatePolicy.json +2 -6
- models/mutation.policy.socketLan.updateRule.json +77 -182
- models/mutation.policy.socketLan.updateSection.json +3 -9
- models/mutation.policy.terminalServer.addRule.json +10 -30
- models/mutation.policy.terminalServer.addSection.json +4 -12
- models/mutation.policy.terminalServer.createPolicyRevision.json +3 -9
- models/mutation.policy.terminalServer.discardPolicyRevision.json +2 -6
- models/mutation.policy.terminalServer.moveRule.json +4 -12
- models/mutation.policy.terminalServer.moveSection.json +4 -12
- models/mutation.policy.terminalServer.publishPolicyRevision.json +3 -9
- models/mutation.policy.terminalServer.removeRule.json +2 -6
- models/mutation.policy.terminalServer.removeSection.json +2 -6
- models/mutation.policy.terminalServer.updatePolicy.json +2 -6
- models/mutation.policy.terminalServer.updateRule.json +9 -27
- models/mutation.policy.terminalServer.updateSection.json +3 -9
- models/mutation.policy.wanFirewall.addRule.json +290 -654
- models/mutation.policy.wanFirewall.addSection.json +4 -12
- models/mutation.policy.wanFirewall.createPolicyRevision.json +3 -9
- models/mutation.policy.wanFirewall.discardPolicyRevision.json +2 -6
- models/mutation.policy.wanFirewall.moveRule.json +4 -12
- models/mutation.policy.wanFirewall.moveSection.json +4 -12
- models/mutation.policy.wanFirewall.publishPolicyRevision.json +3 -9
- models/mutation.policy.wanFirewall.removeRule.json +2 -6
- models/mutation.policy.wanFirewall.removeSection.json +2 -6
- models/mutation.policy.wanFirewall.updatePolicy.json +2 -6
- models/mutation.policy.wanFirewall.updateRule.json +289 -651
- models/mutation.policy.wanFirewall.updateSection.json +3 -9
- models/mutation.policy.wanNetwork.addRule.json +204 -514
- models/mutation.policy.wanNetwork.addSection.json +4 -12
- models/mutation.policy.wanNetwork.createPolicyRevision.json +3 -9
- models/mutation.policy.wanNetwork.discardPolicyRevision.json +2 -6
- models/mutation.policy.wanNetwork.moveRule.json +4 -12
- models/mutation.policy.wanNetwork.moveSection.json +4 -12
- models/mutation.policy.wanNetwork.publishPolicyRevision.json +3 -9
- models/mutation.policy.wanNetwork.removeRule.json +2 -6
- models/mutation.policy.wanNetwork.removeSection.json +2 -6
- models/mutation.policy.wanNetwork.updatePolicy.json +2 -6
- models/mutation.policy.wanNetwork.updateRule.json +203 -511
- models/mutation.policy.wanNetwork.updateSection.json +3 -9
- models/mutation.sandbox.deleteReport.json +1 -3
- models/mutation.sandbox.uploadFile.json +1 -3
- models/mutation.site.addBgpPeer.json +48 -123
- models/mutation.site.addCloudInterconnectPhysicalConnection.json +12 -36
- models/mutation.site.addCloudInterconnectSite.json +8 -24
- models/mutation.site.addIpsecIkeV2Site.json +10 -30
- models/mutation.site.addIpsecIkeV2SiteTunnels.json +14 -40
- models/mutation.site.addNetworkRange.json +15 -43
- models/mutation.site.addSecondaryAwsVSocket.json +5 -15
- models/mutation.site.addSecondaryAzureVSocket.json +4 -12
- models/mutation.site.addSocketAddOnCard.json +4 -12
- models/mutation.site.addSocketSite.json +12 -36
- models/mutation.site.addStaticHost.json +4 -10
- models/mutation.site.assignSiteBwLicense.json +120 -11782
- models/mutation.site.removeBgpPeer.json +1 -3
- models/mutation.site.removeCloudInterconnectPhysicalConnection.json +1 -3
- models/mutation.site.removeIpsecIkeV2SiteTunnels.json +2 -4
- models/mutation.site.removeNetworkRange.json +1 -1
- models/mutation.site.removeSecondaryAwsVSocket.json +1 -1
- models/mutation.site.removeSecondaryAzureVSocket.json +1 -1
- models/mutation.site.removeSite.json +1 -1
- models/mutation.site.removeSiteBwLicense.json +119 -11779
- models/mutation.site.removeSocketAddOnCard.json +3 -9
- models/mutation.site.removeStaticHost.json +1 -1
- models/mutation.site.replaceSiteBwLicense.json +121 -11785
- models/mutation.site.startSiteUpgrade.json +3 -9
- models/mutation.site.updateBgpPeer.json +47 -120
- models/mutation.site.updateCloudInterconnectPhysicalConnection.json +10 -30
- models/mutation.site.updateHa.json +4 -10
- models/mutation.site.updateIpsecIkeV2SiteGeneralDetails.json +11 -24
- models/mutation.site.updateIpsecIkeV2SiteTunnels.json +15 -43
- models/mutation.site.updateNetworkRange.json +15 -43
- models/mutation.site.updateSecondaryAwsVSocket.json +4 -12
- models/mutation.site.updateSecondaryAzureVSocket.json +3 -9
- models/mutation.site.updateSiteBwLicense.json +120 -11782
- models/mutation.site.updateSiteGeneralDetails.json +14 -40
- models/mutation.site.updateSocketInterface.json +26 -74
- models/mutation.site.updateStaticHost.json +4 -10
- models/mutation.sites.addBgpPeer.json +48 -123
- models/mutation.sites.addCloudInterconnectPhysicalConnection.json +12 -36
- models/mutation.sites.addCloudInterconnectSite.json +8 -24
- models/mutation.sites.addIpsecIkeV2Site.json +10 -30
- models/mutation.sites.addIpsecIkeV2SiteTunnels.json +14 -40
- models/mutation.sites.addNetworkRange.json +15 -43
- models/mutation.sites.addSecondaryAwsVSocket.json +5 -15
- models/mutation.sites.addSecondaryAzureVSocket.json +4 -12
- models/mutation.sites.addSocketAddOnCard.json +4 -12
- models/mutation.sites.addSocketSite.json +12 -36
- models/mutation.sites.addStaticHost.json +4 -10
- models/mutation.sites.assignSiteBwLicense.json +120 -11782
- models/mutation.sites.removeBgpPeer.json +1 -3
- models/mutation.sites.removeCloudInterconnectPhysicalConnection.json +1 -3
- models/mutation.sites.removeIpsecIkeV2SiteTunnels.json +2 -4
- models/mutation.sites.removeNetworkRange.json +1 -1
- models/mutation.sites.removeSecondaryAwsVSocket.json +1 -1
- models/mutation.sites.removeSecondaryAzureVSocket.json +1 -1
- models/mutation.sites.removeSite.json +1 -1
- models/mutation.sites.removeSiteBwLicense.json +119 -11779
- models/mutation.sites.removeSocketAddOnCard.json +3 -9
- models/mutation.sites.removeStaticHost.json +1 -1
- models/mutation.sites.replaceSiteBwLicense.json +121 -11785
- models/mutation.sites.startSiteUpgrade.json +3 -9
- models/mutation.sites.updateBgpPeer.json +47 -120
- models/mutation.sites.updateCloudInterconnectPhysicalConnection.json +10 -30
- models/mutation.sites.updateHa.json +4 -10
- models/mutation.sites.updateIpsecIkeV2SiteGeneralDetails.json +11 -24
- models/mutation.sites.updateIpsecIkeV2SiteTunnels.json +15 -43
- models/mutation.sites.updateNetworkRange.json +15 -43
- models/mutation.sites.updateSecondaryAwsVSocket.json +4 -12
- models/mutation.sites.updateSecondaryAzureVSocket.json +3 -9
- models/mutation.sites.updateSiteBwLicense.json +120 -11782
- models/mutation.sites.updateSiteGeneralDetails.json +14 -40
- models/mutation.sites.updateSocketInterface.json +26 -74
- models/mutation.sites.updateStaticHost.json +4 -10
- models/mutation.xdr.addStoryComment.json +15 -113
- models/mutation.xdr.analystFeedback.json +229 -26307
- models/mutation.xdr.deleteStoryComment.json +15 -113
- models/query.accountBySubdomain.json +2 -1
- models/query.accountMetrics.json +15 -12
- models/query.accountRoles.json +1 -1
- models/query.accountSnapshot.json +4 -2
- models/query.admin.json +1 -1
- models/query.admins.json +7 -10
- models/query.appStats.json +633 -33
- models/query.appStatsTimeSeries.json +15 -28
- models/query.auditFeed.json +225 -16
- models/query.catalogs.json +106 -215
- models/query.container.json +21 -471
- models/query.devices.json +333 -620
- models/query.enterpriseDirectory.json +3596 -0
- models/query.entityLookup.json +15 -27
- models/query.events.json +1875 -33
- models/query.eventsFeed.json +30 -14
- models/query.eventsTimeSeries.json +15 -28
- models/query.groups.group.members.json +23 -55
- models/query.groups.groupList.json +87 -266
- models/query.groups.whereUsed.json +2 -6
- models/query.hardware.json +92 -192
- models/query.hardwareManagement.json +21 -63
- models/query.licensing.json +76 -11721
- models/query.policy.appTenantRestriction.policy.json +2 -6
- models/query.policy.dynamicIpAllocation.policy.json +2 -6
- models/query.policy.internetFirewall.policy.json +2 -6
- models/query.policy.remotePortFwd.policy.json +2 -6
- models/query.policy.socketLan.policy.json +2 -6
- models/query.policy.terminalServer.policy.json +2 -6
- models/query.policy.wanFirewall.policy.json +2 -6
- models/query.policy.wanNetwork.policy.json +2 -6
- models/query.popLocations.json +34 -74
- models/query.sandbox.json +44 -83
- models/query.servicePrincipalAdmin.json +1098 -0
- models/query.site.availableVersionList.json +4 -5
- models/query.site.bgpPeer.json +2 -6
- models/query.site.bgpPeerList.json +2 -6
- models/query.site.cloudInterconnectConnectionConnectivity.json +1 -3
- models/query.site.cloudInterconnectPhysicalConnection.json +1 -3
- models/query.site.cloudInterconnectPhysicalConnectionId.json +3 -9
- models/query.site.secondaryAwsVSocket.json +1 -1
- models/query.site.secondaryAzureVSocket.json +1 -1
- models/query.site.siteBgpStatus.json +2 -6
- models/query.socketPortMetrics.json +465 -33
- models/query.socketPortMetricsTimeSeries.json +15 -28
- models/query.subDomains.json +1 -1
- models/query.xdr.stories.json +306 -26440
- models/query.xdr.story.json +40 -26100
- schema/catolib.py +1255 -972
- schema/importSchema.py +53 -48
- catocli/parsers/mutation/README.md +0 -4
- catocli/parsers/mutation_accountManagement_disableAccount/README.md +0 -16
- catocli/parsers/parserApiClient.py +0 -948
- catocli/parsers/query/README.md +0 -3
- catocli-2.1.1.dist-info/RECORD +0 -645
- models/mutation.accountManagement.disableAccount.json +0 -545
- models/query.policy.json +0 -40899
- models/query.site.json +0 -5688
- schema/remove_policyid.py +0 -89
- schema/remove_policyid_mutations.py +0 -89
- {catocli-2.1.1.dist-info → catocli-2.1.3.dist-info}/WHEEL +0 -0
- {catocli-2.1.1.dist-info → catocli-2.1.3.dist-info}/entry_points.txt +0 -0
- {catocli-2.1.1.dist-info → catocli-2.1.3.dist-info}/licenses/LICENSE +0 -0
- {catocli-2.1.1.dist-info → catocli-2.1.3.dist-info}/top_level.txt +0 -0
catocli/Utils/clidriver.py
CHANGED
|
@@ -5,7 +5,7 @@ import json
|
|
|
5
5
|
import catocli
|
|
6
6
|
from graphql_client import Configuration
|
|
7
7
|
from graphql_client.api_client import ApiException
|
|
8
|
-
from ..parsers.
|
|
8
|
+
from ..parsers.customParserApiClient import get_help
|
|
9
9
|
from .profile_manager import get_profile_manager
|
|
10
10
|
from .version_checker import check_for_updates, force_check_updates
|
|
11
11
|
import traceback
|
|
@@ -20,110 +20,104 @@ from ..parsers.raw import raw_parse
|
|
|
20
20
|
from ..parsers.custom import custom_parse
|
|
21
21
|
from ..parsers.custom_private import private_parse
|
|
22
22
|
from ..parsers.query_siteLocation import query_siteLocation_parse
|
|
23
|
-
from ..parsers.
|
|
24
|
-
from ..parsers.
|
|
25
|
-
from ..parsers.mutation_container import mutation_container_parse
|
|
26
|
-
from ..parsers.mutation_groups import mutation_groups_parse
|
|
27
|
-
from ..parsers.mutation_hardware import mutation_hardware_parse
|
|
28
|
-
from ..parsers.mutation_policy import mutation_policy_parse
|
|
29
|
-
from ..parsers.mutation_sandbox import mutation_sandbox_parse
|
|
30
|
-
from ..parsers.mutation_site import mutation_site_parse
|
|
31
|
-
from ..parsers.mutation_sites import mutation_sites_parse
|
|
32
|
-
from ..parsers.mutation_xdr import mutation_xdr_parse
|
|
33
|
-
from ..parsers.query_accountBySubdomain import query_accountBySubdomain_parse
|
|
34
|
-
from ..parsers.query_accountManagement import query_accountManagement_parse
|
|
23
|
+
from ..parsers.query_socketPortMetrics import query_socketPortMetrics_parse
|
|
24
|
+
from ..parsers.query_socketPortMetricsTimeSeries import query_socketPortMetricsTimeSeries_parse
|
|
35
25
|
from ..parsers.query_accountMetrics import query_accountMetrics_parse
|
|
36
|
-
from ..parsers.query_accountRoles import query_accountRoles_parse
|
|
37
26
|
from ..parsers.query_accountSnapshot import query_accountSnapshot_parse
|
|
38
|
-
from ..parsers.
|
|
39
|
-
from ..parsers.
|
|
40
|
-
from ..parsers.
|
|
41
|
-
from ..parsers.
|
|
27
|
+
from ..parsers.query_eventsFeed import query_eventsFeed_parse
|
|
28
|
+
from ..parsers.query_hardwareManagement import query_hardwareManagement_parse
|
|
29
|
+
from ..parsers.query_events import query_events_parse
|
|
30
|
+
from ..parsers.query_eventsTimeSeries import query_eventsTimeSeries_parse
|
|
42
31
|
from ..parsers.query_auditFeed import query_auditFeed_parse
|
|
43
|
-
from ..parsers.query_catalogs import query_catalogs_parse
|
|
44
32
|
from ..parsers.query_container import query_container_parse
|
|
45
|
-
from ..parsers.
|
|
33
|
+
from ..parsers.query_admins import query_admins_parse
|
|
46
34
|
from ..parsers.query_entityLookup import query_entityLookup_parse
|
|
47
|
-
from ..parsers.
|
|
48
|
-
from ..parsers.
|
|
49
|
-
from ..parsers.
|
|
50
|
-
from ..parsers.
|
|
51
|
-
from ..parsers.
|
|
52
|
-
from ..parsers.
|
|
53
|
-
from ..parsers.
|
|
54
|
-
from ..parsers.
|
|
55
|
-
from ..parsers.query_popLocations import query_popLocations_parse
|
|
35
|
+
from ..parsers.query_accountRoles import query_accountRoles_parse
|
|
36
|
+
from ..parsers.query_accountBySubdomain import query_accountBySubdomain_parse
|
|
37
|
+
from ..parsers.query_subDomains import query_subDomains_parse
|
|
38
|
+
from ..parsers.query_appStats import query_appStats_parse
|
|
39
|
+
from ..parsers.query_appStatsTimeSeries import query_appStatsTimeSeries_parse
|
|
40
|
+
from ..parsers.query_admin import query_admin_parse
|
|
41
|
+
from ..parsers.query_servicePrincipalAdmin import query_servicePrincipalAdmin_parse
|
|
42
|
+
from ..parsers.query_accountManagement import query_accountManagement_parse
|
|
56
43
|
from ..parsers.query_sandbox import query_sandbox_parse
|
|
44
|
+
from ..parsers.query_popLocations import query_popLocations_parse
|
|
45
|
+
from ..parsers.query_licensing import query_licensing_parse
|
|
46
|
+
from ..parsers.query_hardware import query_hardware_parse
|
|
47
|
+
from ..parsers.query_enterpriseDirectory import query_enterpriseDirectory_parse
|
|
48
|
+
from ..parsers.query_devices import query_devices_parse
|
|
49
|
+
from ..parsers.query_catalogs import query_catalogs_parse
|
|
57
50
|
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
|
|
60
|
-
from ..parsers.query_subDomains import query_subDomains_parse
|
|
61
51
|
from ..parsers.query_xdr import query_xdr_parse
|
|
52
|
+
from ..parsers.query_policy import query_policy_parse
|
|
53
|
+
from ..parsers.query_groups import query_groups_parse
|
|
54
|
+
from ..parsers.mutation_xdr import mutation_xdr_parse
|
|
55
|
+
from ..parsers.mutation_site import mutation_site_parse
|
|
56
|
+
from ..parsers.mutation_sites import mutation_sites_parse
|
|
57
|
+
from ..parsers.mutation_container import mutation_container_parse
|
|
58
|
+
from ..parsers.mutation_admin import mutation_admin_parse
|
|
59
|
+
from ..parsers.mutation_policy import mutation_policy_parse
|
|
60
|
+
from ..parsers.mutation_accountManagement import mutation_accountManagement_parse
|
|
61
|
+
from ..parsers.mutation_sandbox import mutation_sandbox_parse
|
|
62
|
+
from ..parsers.mutation_hardware import mutation_hardware_parse
|
|
63
|
+
from ..parsers.mutation_groups import mutation_groups_parse
|
|
64
|
+
from ..parsers.mutation_enterpriseDirectory import mutation_enterpriseDirectory_parse
|
|
62
65
|
|
|
63
66
|
def show_version_info(args, configuration=None):
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
67
|
+
print(f"catocli version {catocli.__version__}")
|
|
68
|
+
|
|
69
|
+
if not args.current_only:
|
|
70
|
+
if args.check_updates:
|
|
71
|
+
# Force check for updates
|
|
72
|
+
is_newer, latest_version, source = force_check_updates()
|
|
73
|
+
else:
|
|
74
|
+
# Regular check (uses cache)
|
|
75
|
+
is_newer, latest_version, source = check_for_updates(show_if_available=False)
|
|
76
|
+
|
|
77
|
+
if latest_version:
|
|
78
|
+
if is_newer:
|
|
79
|
+
print(f"Latest version: {latest_version} (from {source}) - UPDATE AVAILABLE!")
|
|
80
|
+
print()
|
|
81
|
+
print("To upgrade, run:")
|
|
82
|
+
print("pip install --upgrade catocli")
|
|
83
|
+
else:
|
|
84
|
+
print(f"Latest version: {latest_version} (from {source}) - You are up to date!")
|
|
85
|
+
else:
|
|
86
|
+
print("Unable to check for updates (check your internet connection)")
|
|
87
|
+
return [{"success": True, "current_version": catocli.__version__, "latest_version": latest_version if not args.current_only else None}]
|
|
88
|
+
|
|
95
89
|
def get_configuration(skip_api_key=False):
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
90
|
+
configuration = Configuration()
|
|
91
|
+
configuration.verify_ssl = False
|
|
92
|
+
configuration.debug = CATO_DEBUG
|
|
93
|
+
configuration.version = "{}".format(catocli.__version__)
|
|
94
|
+
|
|
95
|
+
# Try to migrate from environment variables first
|
|
96
|
+
profile_manager.migrate_from_environment()
|
|
97
|
+
|
|
98
|
+
# Get credentials from profile
|
|
99
|
+
credentials = profile_manager.get_credentials()
|
|
100
|
+
if not credentials:
|
|
101
|
+
print("No Cato CLI profile configured.")
|
|
102
|
+
print("Run 'catocli configure set' to set up your credentials.")
|
|
103
|
+
exit(1)
|
|
110
104
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
105
|
+
if not credentials.get('cato_token') or not credentials.get('account_id'):
|
|
106
|
+
profile_name = profile_manager.get_current_profile()
|
|
107
|
+
print(f"Profile '{profile_name}' is missing required credentials.")
|
|
108
|
+
print(f"Run 'catocli configure set --profile {profile_name}' to update your credentials.")
|
|
109
|
+
exit(1)
|
|
110
|
+
|
|
111
|
+
# Use standard endpoint from profile for regular API calls
|
|
112
|
+
configuration.host = credentials['endpoint']
|
|
113
|
+
|
|
114
|
+
# Only set API key if not using custom headers file
|
|
115
|
+
# (Private settings are handled separately in createPrivateRequest)
|
|
116
|
+
if not skip_api_key:
|
|
117
|
+
configuration.api_key["x-api-key"] = credentials['cato_token']
|
|
118
|
+
configuration.accountID = credentials['account_id']
|
|
119
|
+
|
|
120
|
+
return configuration
|
|
127
121
|
|
|
128
122
|
defaultReadmeStr = """
|
|
129
123
|
The Cato CLI is a command-line interface tool designed to simplify the management and automation of Cato Networks’ configurations and operations.
|
|
@@ -158,139 +152,141 @@ query_siteLocation_parser = query_siteLocation_parse(query_subparsers)
|
|
|
158
152
|
mutation_parser = subparsers.add_parser('mutation', help='Mutation', usage='catocli mutation <operationName> [options]')
|
|
159
153
|
mutation_subparsers = mutation_parser.add_subparsers(description='valid subcommands', help='additional help')
|
|
160
154
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
mutation_container_parser = mutation_container_parse(mutation_subparsers)
|
|
164
|
-
mutation_groups_parser = mutation_groups_parse(mutation_subparsers)
|
|
165
|
-
mutation_hardware_parser = mutation_hardware_parse(mutation_subparsers)
|
|
166
|
-
mutation_policy_parser = mutation_policy_parse(mutation_subparsers)
|
|
167
|
-
mutation_sandbox_parser = mutation_sandbox_parse(mutation_subparsers)
|
|
168
|
-
mutation_site_parser = mutation_site_parse(mutation_subparsers)
|
|
169
|
-
mutation_sites_parser = mutation_sites_parse(mutation_subparsers)
|
|
170
|
-
mutation_xdr_parser = mutation_xdr_parse(mutation_subparsers)
|
|
171
|
-
query_accountBySubdomain_parser = query_accountBySubdomain_parse(query_subparsers)
|
|
172
|
-
query_accountManagement_parser = query_accountManagement_parse(query_subparsers)
|
|
155
|
+
query_socketPortMetrics_parser = query_socketPortMetrics_parse(query_subparsers)
|
|
156
|
+
query_socketPortMetricsTimeSeries_parser = query_socketPortMetricsTimeSeries_parse(query_subparsers)
|
|
173
157
|
query_accountMetrics_parser = query_accountMetrics_parse(query_subparsers)
|
|
174
|
-
query_accountRoles_parser = query_accountRoles_parse(query_subparsers)
|
|
175
158
|
query_accountSnapshot_parser = query_accountSnapshot_parse(query_subparsers)
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
159
|
+
query_eventsFeed_parser = query_eventsFeed_parse(query_subparsers)
|
|
160
|
+
query_hardwareManagement_parser = query_hardwareManagement_parse(query_subparsers)
|
|
161
|
+
query_events_parser = query_events_parse(query_subparsers)
|
|
162
|
+
query_eventsTimeSeries_parser = query_eventsTimeSeries_parse(query_subparsers)
|
|
180
163
|
query_auditFeed_parser = query_auditFeed_parse(query_subparsers)
|
|
181
|
-
query_catalogs_parser = query_catalogs_parse(query_subparsers)
|
|
182
164
|
query_container_parser = query_container_parse(query_subparsers)
|
|
183
|
-
|
|
165
|
+
query_admins_parser = query_admins_parse(query_subparsers)
|
|
184
166
|
query_entityLookup_parser = query_entityLookup_parse(query_subparsers)
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
query_popLocations_parser = query_popLocations_parse(query_subparsers)
|
|
167
|
+
query_accountRoles_parser = query_accountRoles_parse(query_subparsers)
|
|
168
|
+
query_accountBySubdomain_parser = query_accountBySubdomain_parse(query_subparsers)
|
|
169
|
+
query_subDomains_parser = query_subDomains_parse(query_subparsers)
|
|
170
|
+
query_appStats_parser = query_appStats_parse(query_subparsers)
|
|
171
|
+
query_appStatsTimeSeries_parser = query_appStatsTimeSeries_parse(query_subparsers)
|
|
172
|
+
query_admin_parser = query_admin_parse(query_subparsers)
|
|
173
|
+
query_servicePrincipalAdmin_parser = query_servicePrincipalAdmin_parse(query_subparsers)
|
|
174
|
+
query_accountManagement_parser = query_accountManagement_parse(query_subparsers)
|
|
194
175
|
query_sandbox_parser = query_sandbox_parse(query_subparsers)
|
|
176
|
+
query_popLocations_parser = query_popLocations_parse(query_subparsers)
|
|
177
|
+
query_licensing_parser = query_licensing_parse(query_subparsers)
|
|
178
|
+
query_hardware_parser = query_hardware_parse(query_subparsers)
|
|
179
|
+
query_enterpriseDirectory_parser = query_enterpriseDirectory_parse(query_subparsers)
|
|
180
|
+
query_devices_parser = query_devices_parse(query_subparsers)
|
|
181
|
+
query_catalogs_parser = query_catalogs_parse(query_subparsers)
|
|
195
182
|
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)
|
|
198
|
-
query_subDomains_parser = query_subDomains_parse(query_subparsers)
|
|
199
183
|
query_xdr_parser = query_xdr_parse(query_subparsers)
|
|
184
|
+
query_policy_parser = query_policy_parse(query_subparsers)
|
|
185
|
+
query_groups_parser = query_groups_parse(query_subparsers)
|
|
186
|
+
mutation_xdr_parser = mutation_xdr_parse(mutation_subparsers)
|
|
187
|
+
mutation_site_parser = mutation_site_parse(mutation_subparsers)
|
|
188
|
+
mutation_sites_parser = mutation_sites_parse(mutation_subparsers)
|
|
189
|
+
mutation_container_parser = mutation_container_parse(mutation_subparsers)
|
|
190
|
+
mutation_admin_parser = mutation_admin_parse(mutation_subparsers)
|
|
191
|
+
mutation_policy_parser = mutation_policy_parse(mutation_subparsers)
|
|
192
|
+
mutation_accountManagement_parser = mutation_accountManagement_parse(mutation_subparsers)
|
|
193
|
+
mutation_sandbox_parser = mutation_sandbox_parse(mutation_subparsers)
|
|
194
|
+
mutation_hardware_parser = mutation_hardware_parse(mutation_subparsers)
|
|
195
|
+
mutation_groups_parser = mutation_groups_parse(mutation_subparsers)
|
|
196
|
+
mutation_enterpriseDirectory_parser = mutation_enterpriseDirectory_parse(mutation_subparsers)
|
|
200
197
|
|
|
201
198
|
|
|
202
199
|
def parse_headers(header_strings):
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
200
|
+
headers = {}
|
|
201
|
+
if header_strings:
|
|
202
|
+
for header_string in header_strings:
|
|
203
|
+
if ':' not in header_string:
|
|
204
|
+
print(f"ERROR: Invalid header format '{header_string}'. Use 'Key: Value' format.")
|
|
205
|
+
exit(1)
|
|
206
|
+
key, value = header_string.split(':', 1)
|
|
207
|
+
headers[key.strip()] = value.strip()
|
|
208
|
+
return headers
|
|
212
209
|
|
|
213
210
|
def parse_headers_from_file(file_path):
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
return headers
|
|
211
|
+
headers = {}
|
|
212
|
+
try:
|
|
213
|
+
with open(file_path, 'r') as f:
|
|
214
|
+
for line_num, line in enumerate(f, 1):
|
|
215
|
+
line = line.strip()
|
|
216
|
+
if not line or line.startswith('#'):
|
|
217
|
+
continue
|
|
218
|
+
if ':' not in line:
|
|
219
|
+
print(f"ERROR: Invalid header format in {file_path} at line {line_num}: '{line}'. Use 'Key: Value' format.")
|
|
220
|
+
exit(1)
|
|
221
|
+
key, value = line.split(':', 1)
|
|
222
|
+
headers[key.strip()] = value.strip()
|
|
223
|
+
except FileNotFoundError:
|
|
224
|
+
print(f"ERROR: Headers file '{file_path}' not found.")
|
|
225
|
+
exit(1)
|
|
226
|
+
except IOError as e:
|
|
227
|
+
print(f"ERROR: Could not read headers file '{file_path}': {e}")
|
|
228
|
+
exit(1)
|
|
229
|
+
return headers
|
|
234
230
|
|
|
235
231
|
def main(args=None):
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
232
|
+
# Check if no arguments provided or help is requested
|
|
233
|
+
if args is None:
|
|
234
|
+
args = sys.argv[1:]
|
|
239
235
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
236
|
+
# Show version check when displaying help or when no command specified
|
|
237
|
+
if not args or '-h' in args or '--help' in args:
|
|
238
|
+
# Check for updates in background (non-blocking)
|
|
239
|
+
try:
|
|
240
|
+
check_for_updates(show_if_available=True)
|
|
241
|
+
except Exception:
|
|
242
|
+
# Don't let version check interfere with CLI operation
|
|
243
|
+
pass
|
|
248
244
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
245
|
+
args = parser.parse_args(args=args)
|
|
246
|
+
try:
|
|
247
|
+
# Skip authentication for configure commands
|
|
248
|
+
if hasattr(args, 'func') and hasattr(args.func, '__module__') and 'configure' in str(args.func.__module__):
|
|
249
|
+
response = args.func(args, None)
|
|
250
|
+
else:
|
|
251
|
+
# Check if using headers file to determine if we should skip API key
|
|
252
|
+
# Note: Private settings should NOT affect regular API calls - only private commands
|
|
253
|
+
using_headers_file = hasattr(args, 'headers_file') and args.headers_file
|
|
254
|
+
|
|
255
|
+
# Get configuration from profiles
|
|
256
|
+
configuration = get_configuration(skip_api_key=using_headers_file)
|
|
257
|
+
|
|
258
|
+
# Parse custom headers if provided
|
|
259
|
+
custom_headers = {}
|
|
260
|
+
if hasattr(args, 'headers') and args.headers:
|
|
261
|
+
custom_headers.update(parse_headers(args.headers))
|
|
262
|
+
if hasattr(args, 'headers_file') and args.headers_file:
|
|
263
|
+
custom_headers.update(parse_headers_from_file(args.headers_file))
|
|
264
|
+
if custom_headers:
|
|
265
|
+
configuration.custom_headers.update(custom_headers)
|
|
266
|
+
# Handle account ID override (applies to all commands except raw)
|
|
267
|
+
if args.func.__name__ not in ["createRawRequest"]:
|
|
268
|
+
if hasattr(args, 'accountID') and args.accountID is not None:
|
|
269
|
+
# Command line override takes precedence
|
|
270
|
+
configuration.accountID = args.accountID
|
|
271
|
+
# Otherwise use the account ID from the profile (already set in get_configuration)
|
|
272
|
+
response = args.func(args, configuration)
|
|
277
273
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
274
|
+
if type(response) == ApiException:
|
|
275
|
+
print("ERROR! Status code: {}".format(response.status))
|
|
276
|
+
print(response)
|
|
277
|
+
else:
|
|
278
|
+
if response!=None:
|
|
279
|
+
print(json.dumps(response[0], sort_keys=True, indent=4))
|
|
280
|
+
except KeyboardInterrupt:
|
|
281
|
+
print('Operation cancelled by user (Ctrl+C).')
|
|
282
|
+
exit(130) # Standard exit code for SIGINT
|
|
283
|
+
except Exception as e:
|
|
284
|
+
if isinstance(e, AttributeError):
|
|
285
|
+
print('Missing arguments. Usage: catocli <operation> -h')
|
|
286
|
+
if args.v==True:
|
|
287
|
+
print('ERROR: ',e)
|
|
288
|
+
traceback.print_exc()
|
|
289
|
+
else:
|
|
290
|
+
print('ERROR: ',e)
|
|
291
|
+
traceback.print_exc()
|
|
292
|
+
exit(1)
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
General CLI utilities for catocli
|
|
4
|
+
|
|
5
|
+
This module contains general-purpose utility functions used across the catocli
|
|
6
|
+
package, including settings loading and configuration management.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import os
|
|
10
|
+
import json
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# Import for resource handling
|
|
14
|
+
try:
|
|
15
|
+
# Python 3.9+
|
|
16
|
+
from importlib.resources import files
|
|
17
|
+
def get_package_resource(package, filename):
|
|
18
|
+
return files(package).joinpath(filename).read_text(encoding='utf-8')
|
|
19
|
+
except ImportError:
|
|
20
|
+
try:
|
|
21
|
+
# Python 3.7-3.8
|
|
22
|
+
from importlib.resources import read_text
|
|
23
|
+
def get_package_resource(package, filename):
|
|
24
|
+
return read_text(package, filename, encoding='utf-8')
|
|
25
|
+
except ImportError:
|
|
26
|
+
try:
|
|
27
|
+
# Fallback to pkg_resources
|
|
28
|
+
import pkg_resources
|
|
29
|
+
def get_package_resource(package, filename):
|
|
30
|
+
return pkg_resources.resource_string(package, filename).decode('utf-8')
|
|
31
|
+
except ImportError:
|
|
32
|
+
# Final fallback - no package resources available
|
|
33
|
+
def get_package_resource(package, filename):
|
|
34
|
+
raise ImportError("No resource handling module available")
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def load_cli_settings():
|
|
38
|
+
"""
|
|
39
|
+
Load clisettings.json from multiple possible locations:
|
|
40
|
+
1. Package resource (for installed packages)
|
|
41
|
+
2. Repository location (for development)
|
|
42
|
+
|
|
43
|
+
Returns:
|
|
44
|
+
dict: The loaded settings or default settings if loading fails
|
|
45
|
+
"""
|
|
46
|
+
settings_locations = [
|
|
47
|
+
# Try package resource first (for installed packages)
|
|
48
|
+
lambda: json.loads(get_package_resource('catocli', 'clisettings.json')),
|
|
49
|
+
# Try repository location (for development)
|
|
50
|
+
lambda: json.load(open(os.path.join(os.path.dirname(__file__), '../../clisettings.json'), 'r', encoding='utf-8'))
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
for i, load_func in enumerate(settings_locations):
|
|
54
|
+
try:
|
|
55
|
+
settings = load_func()
|
|
56
|
+
if settings:
|
|
57
|
+
return settings
|
|
58
|
+
except (FileNotFoundError, json.JSONDecodeError, ImportError, OSError, ModuleNotFoundError) as e:
|
|
59
|
+
# Continue to next location
|
|
60
|
+
continue
|
|
61
|
+
|
|
62
|
+
# If all locations fail, return default settings for socket export
|
|
63
|
+
return {
|
|
64
|
+
"export_by_socket_type": {
|
|
65
|
+
"SOCKET_X1500": True,
|
|
66
|
+
"SOCKET_X1600": True,
|
|
67
|
+
"SOCKET_X1600_LTE": True,
|
|
68
|
+
"SOCKET_X1700": True
|
|
69
|
+
},
|
|
70
|
+
"default_socket_interface_map": {
|
|
71
|
+
"SOCKET_X1500": "LAN1",
|
|
72
|
+
"SOCKET_X1600": "INT_5",
|
|
73
|
+
"SOCKET_X1600_LTE": "INT_5",
|
|
74
|
+
"SOCKET_X1700": "INT_3"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def get_cli_settings_path():
|
|
80
|
+
"""
|
|
81
|
+
Get the path to the CLI settings file, trying different locations.
|
|
82
|
+
|
|
83
|
+
Returns:
|
|
84
|
+
str or None: Path to the settings file if found, None otherwise
|
|
85
|
+
"""
|
|
86
|
+
possible_paths = [
|
|
87
|
+
# Repository location (for development)
|
|
88
|
+
os.path.join(os.path.dirname(__file__), '../../clisettings.json'),
|
|
89
|
+
# Current directory
|
|
90
|
+
os.path.join(os.getcwd(), 'clisettings.json'),
|
|
91
|
+
]
|
|
92
|
+
|
|
93
|
+
for path in possible_paths:
|
|
94
|
+
if os.path.exists(path):
|
|
95
|
+
return path
|
|
96
|
+
|
|
97
|
+
return None
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def load_json_file(file_path, encoding='utf-8'):
|
|
101
|
+
"""
|
|
102
|
+
Load a JSON file with error handling.
|
|
103
|
+
|
|
104
|
+
Args:
|
|
105
|
+
file_path (str): Path to the JSON file
|
|
106
|
+
encoding (str): File encoding (default: utf-8)
|
|
107
|
+
|
|
108
|
+
Returns:
|
|
109
|
+
dict or None: The loaded JSON data, or None if loading fails
|
|
110
|
+
"""
|
|
111
|
+
try:
|
|
112
|
+
with open(file_path, 'r', encoding=encoding) as f:
|
|
113
|
+
return json.load(f)
|
|
114
|
+
except (FileNotFoundError, json.JSONDecodeError, OSError) as e:
|
|
115
|
+
return None
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def save_json_file(data, file_path, encoding='utf-8', indent=2):
|
|
119
|
+
"""
|
|
120
|
+
Save data to a JSON file with error handling.
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
data: Data to save
|
|
124
|
+
file_path (str): Path to save the JSON file
|
|
125
|
+
encoding (str): File encoding (default: utf-8)
|
|
126
|
+
indent (int): JSON indentation (default: 2)
|
|
127
|
+
|
|
128
|
+
Returns:
|
|
129
|
+
bool: True if successful, False otherwise
|
|
130
|
+
"""
|
|
131
|
+
try:
|
|
132
|
+
# Ensure the directory exists
|
|
133
|
+
os.makedirs(os.path.dirname(file_path), exist_ok=True)
|
|
134
|
+
|
|
135
|
+
with open(file_path, 'w', encoding=encoding) as f:
|
|
136
|
+
json.dump(data, f, indent=indent, ensure_ascii=False)
|
|
137
|
+
return True
|
|
138
|
+
except (OSError, TypeError, ValueError) as e:
|
|
139
|
+
return False
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def load_private_settings():
|
|
143
|
+
"""
|
|
144
|
+
Load private settings from ~/.cato/settings.json in an OS-compatible way.
|
|
145
|
+
|
|
146
|
+
This function constructs the path to ~/.cato/settings.json using os.path methods
|
|
147
|
+
for cross-platform compatibility (Windows, Mac, Linux).
|
|
148
|
+
|
|
149
|
+
Returns:
|
|
150
|
+
dict: The privateCommands section from the settings file, or empty dict if not found
|
|
151
|
+
"""
|
|
152
|
+
# Use os.path.join for OS-compatible path construction
|
|
153
|
+
cato_dir = os.path.join(os.path.expanduser("~"), ".cato")
|
|
154
|
+
settings_file = os.path.join(cato_dir, "settings.json")
|
|
155
|
+
|
|
156
|
+
try:
|
|
157
|
+
with open(settings_file, 'r', encoding='utf-8') as f:
|
|
158
|
+
settings = json.load(f)
|
|
159
|
+
return settings.get('privateCommands', {})
|
|
160
|
+
except (FileNotFoundError, json.JSONDecodeError, KeyError, OSError):
|
|
161
|
+
return {}
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
def ensure_directory_exists(directory_path):
|
|
165
|
+
"""
|
|
166
|
+
Ensure a directory exists, creating it if necessary.
|
|
167
|
+
|
|
168
|
+
Args:
|
|
169
|
+
directory_path (str): Path to the directory
|
|
170
|
+
|
|
171
|
+
Returns:
|
|
172
|
+
bool: True if directory exists or was created successfully
|
|
173
|
+
"""
|
|
174
|
+
try:
|
|
175
|
+
os.makedirs(directory_path, exist_ok=True)
|
|
176
|
+
return True
|
|
177
|
+
except OSError:
|
|
178
|
+
return False
|
catocli/__init__.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "2.1.
|
|
1
|
+
__version__ = "2.1.3"
|
|
2
2
|
__cato_host__ = "https://api.catonetworks.com/api/v1/graphql2"
|
|
@@ -6,7 +6,7 @@ from pathlib import Path
|
|
|
6
6
|
from graphql_client.api.call_api import ApiClient, CallApi
|
|
7
7
|
from graphql_client.api_client import ApiException
|
|
8
8
|
import logging
|
|
9
|
-
from ..
|
|
9
|
+
from ..customParserApiClient import validateArgs
|
|
10
10
|
|
|
11
11
|
def entityTypeList(args, configuration):
|
|
12
12
|
params = vars(args)
|