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.

@@ -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
- try:
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 \"{os.path.join(module_dir, file)}\" not found.")
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 \"{os.path.join(module_dir, file)}\": {e}")
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 \"{os.path.join(module_dir, file)}\": {e}")
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