catocli 2.1.4__py3-none-any.whl → 2.1.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of catocli might be problematic. Click here for more details.
- catocli/Utils/clidriver.py +10 -8
- catocli/Utils/cliutils.py +48 -5
- catocli/__init__.py +2 -2
- catocli/clisettings.json +35 -0
- catocli/parsers/custom/export_sites/__init__.py +14 -3
- catocli/parsers/custom/export_sites/export_sites.py +644 -12
- catocli/parsers/custom/import_sites_to_tf/__init__.py +44 -16
- catocli/parsers/custom/import_sites_to_tf/import_sites_to_tf.py +732 -395
- catocli/parsers/customParserApiClient.py +14 -7
- catocli/parsers/mutation_licensing/__init__.py +24 -0
- catocli/parsers/mutation_licensing_updateCommercialLicense/README.md +19 -0
- catocli/parsers/mutation_policy/__init__.py +509 -509
- catocli/parsers/query_devices/README.md +1 -1
- catocli/parsers/query_eventsFeed/README.md +1 -1
- catocli/parsers/query_policy/__init__.py +55 -55
- {catocli-2.1.4.dist-info → catocli-2.1.8.dist-info}/METADATA +1 -1
- {catocli-2.1.4.dist-info → catocli-2.1.8.dist-info}/RECORD +27 -23
- models/mutation.licensing.updateCommercialLicense.json +931 -0
- models/query.devices.json +199 -60
- models/query.events.json +216 -0
- models/query.eventsFeed.json +48 -0
- models/query.eventsTimeSeries.json +144 -0
- schema/catolib.py +3 -3
- {catocli-2.1.4.dist-info → catocli-2.1.8.dist-info}/WHEEL +0 -0
- {catocli-2.1.4.dist-info → catocli-2.1.8.dist-info}/entry_points.txt +0 -0
- {catocli-2.1.4.dist-info → catocli-2.1.8.dist-info}/licenses/LICENSE +0 -0
- {catocli-2.1.4.dist-info → catocli-2.1.8.dist-info}/top_level.txt +0 -0
|
@@ -695,23 +695,30 @@ def loadJSON(file):
|
|
|
695
695
|
Enhanced JSON loading with better error handling and path resolution
|
|
696
696
|
"""
|
|
697
697
|
module_dir = os.path.dirname(__file__)
|
|
698
|
-
# Navigate up two directory levels (from parsers/ to catocli/ to root)
|
|
699
|
-
module_dir = os.path.dirname(module_dir) # Go up from parsers/
|
|
700
|
-
module_dir = os.path.dirname(module_dir) # Go up from catocli/
|
|
701
698
|
|
|
702
|
-
|
|
699
|
+
# Special handling for clisettings.json - it's in catocli/ directory
|
|
700
|
+
if file == "clisettings.json":
|
|
701
|
+
# From parsers/ go up to catocli/ and look for clisettings.json
|
|
702
|
+
catocli_dir = os.path.dirname(module_dir) # Go up from parsers/ to catocli/
|
|
703
|
+
file_path = os.path.join(catocli_dir, file)
|
|
704
|
+
else:
|
|
705
|
+
# For other files (like models), navigate up two directory levels (from parsers/ to catocli/ to root)
|
|
706
|
+
module_dir = os.path.dirname(module_dir) # Go up from parsers/
|
|
707
|
+
module_dir = os.path.dirname(module_dir) # Go up from catocli/
|
|
703
708
|
file_path = os.path.join(module_dir, file)
|
|
709
|
+
|
|
710
|
+
try:
|
|
704
711
|
with open(file_path, 'r') as data:
|
|
705
712
|
config = json.load(data)
|
|
706
713
|
return config
|
|
707
714
|
except FileNotFoundError:
|
|
708
|
-
logging.error(f"File \"{
|
|
715
|
+
logging.error(f"File \"{file_path}\" not found.")
|
|
709
716
|
raise
|
|
710
717
|
except json.JSONDecodeError as e:
|
|
711
|
-
logging.error(f"Invalid JSON in file \"{
|
|
718
|
+
logging.error(f"Invalid JSON in file \"{file_path}\": {e}")
|
|
712
719
|
raise
|
|
713
720
|
except Exception as e:
|
|
714
|
-
logging.error(f"Error loading file \"{
|
|
721
|
+
logging.error(f"Error loading file \"{file_path}\": {e}")
|
|
715
722
|
raise
|
|
716
723
|
|
|
717
724
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
from ..customParserApiClient import createRequest, get_help
|
|
3
|
+
|
|
4
|
+
def mutation_licensing_parse(mutation_subparsers):
|
|
5
|
+
mutation_licensing_parser = mutation_subparsers.add_parser('licensing',
|
|
6
|
+
help='licensing() mutation operation',
|
|
7
|
+
usage=get_help("mutation_licensing"))
|
|
8
|
+
|
|
9
|
+
mutation_licensing_subparsers = mutation_licensing_parser.add_subparsers()
|
|
10
|
+
|
|
11
|
+
mutation_licensing_updateCommercialLicense_parser = mutation_licensing_subparsers.add_parser('updateCommercialLicense',
|
|
12
|
+
help='updateCommercialLicense() licensing operation',
|
|
13
|
+
usage=get_help("mutation_licensing_updateCommercialLicense"))
|
|
14
|
+
|
|
15
|
+
mutation_licensing_updateCommercialLicense_parser.add_argument('json', nargs='?', default='{}', help='Variables in JSON format (defaults to empty object if not provided).')
|
|
16
|
+
mutation_licensing_updateCommercialLicense_parser.add_argument('-accountID', help='The cato account ID to use for this operation. Overrides the account_id value in the profile setting. This is use for reseller and MSP accounts to run queries against cato sub accounts from the parent account.')
|
|
17
|
+
mutation_licensing_updateCommercialLicense_parser.add_argument('-t', const=True, default=False, nargs='?', help='Print GraphQL query without sending API call')
|
|
18
|
+
mutation_licensing_updateCommercialLicense_parser.add_argument('-v', const=True, default=False, nargs='?', help='Verbose output')
|
|
19
|
+
mutation_licensing_updateCommercialLicense_parser.add_argument('-p', const=True, default=False, nargs='?', help='Pretty print')
|
|
20
|
+
mutation_licensing_updateCommercialLicense_parser.add_argument('-n', '--stream-events', dest='stream_events', help='Send events over network to host:port TCP')
|
|
21
|
+
mutation_licensing_updateCommercialLicense_parser.add_argument('-z', '--sentinel', dest='sentinel', help='Send events to Sentinel customerid:sharedkey')
|
|
22
|
+
mutation_licensing_updateCommercialLicense_parser.add_argument('-H', '--header', action='append', dest='headers', help='Add custom headers in "Key: Value" format. Can be used multiple times.')
|
|
23
|
+
mutation_licensing_updateCommercialLicense_parser.add_argument('--headers-file', dest='headers_file', help='Load headers from a file. Each line should contain a header in "Key: Value" format.')
|
|
24
|
+
mutation_licensing_updateCommercialLicense_parser.set_defaults(func=createRequest,operation_name='mutation.licensing.updateCommercialLicense')
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
## CATO-CLI - mutation.licensing.updateCommercialLicense:
|
|
3
|
+
[Click here](https://api.catonetworks.com/documentation/#mutation-mutation.licensing.updateCommercialLicense) for documentation on this operation.
|
|
4
|
+
|
|
5
|
+
### Usage for mutation.licensing.updateCommercialLicense:
|
|
6
|
+
|
|
7
|
+
`catocli mutation licensing updateCommercialLicense -h`
|
|
8
|
+
|
|
9
|
+
`catocli mutation licensing updateCommercialLicense <json>`
|
|
10
|
+
|
|
11
|
+
`catocli mutation licensing updateCommercialLicense "$(cat < mutation.licensing.updateCommercialLicense.json)"`
|
|
12
|
+
|
|
13
|
+
`catocli mutation licensing updateCommercialLicense '{"updateCommercialLicenseInput":{"licenseId":"id","startDate":"example_value"}}'`
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
#### Operation Arguments for mutation.licensing.updateCommercialLicense ####
|
|
17
|
+
|
|
18
|
+
`accountId` [ID] - (required) N/A
|
|
19
|
+
`updateCommercialLicenseInput` [UpdateCommercialLicenseInput] - (required) N/A
|