catocli 3.0.10__py3-none-any.whl → 3.0.13__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 +4 -4
- catocli/Utils/graphql_utils.py +15 -5
- catocli/Utils/help_formatter.py +62 -17
- catocli/__init__.py +1 -1
- catocli/parsers/custom/__init__.py +1 -1
- catocli/parsers/custom/customLib.py +3 -1
- catocli/parsers/mutation_groups_createGroup/README.md +39 -1
- catocli/parsers/mutation_groups_deleteGroup/README.md +39 -1
- catocli/parsers/mutation_groups_updateGroup/README.md +39 -1
- catocli/parsers/query_accountMetrics/README.md +29 -2
- catocli/parsers/query_accountSnapshot/README.md +16 -0
- catocli/parsers/query_appStats/README.md +11 -1
- catocli/parsers/query_appStatsTimeSeries/README.md +16 -2
- catocli/parsers/query_auditFeed/README.md +3 -1
- catocli/parsers/query_catalogs/README.md +178 -0
- catocli/parsers/query_container/README.md +49 -0
- catocli/parsers/query_devices/README.md +728 -0
- catocli/parsers/query_enterpriseDirectory/README.md +83 -0
- catocli/parsers/query_events/README.md +5 -1
- catocli/parsers/query_eventsTimeSeries/README.md +10 -2
- catocli/parsers/query_groups_groupList/README.md +39 -1
- catocli/parsers/query_hardware/README.md +153 -0
- catocli/parsers/query_hardwareManagement/README.md +56 -0
- catocli/parsers/query_popLocations/README.md +63 -0
- catocli/parsers/query_sandbox/README.md +69 -0
- catocli/parsers/query_socketPortMetrics/README.md +5 -1
- catocli/parsers/query_socketPortMetricsTimeSeries/README.md +10 -2
- catocli/parsers/query_xdr_stories/README.md +7 -2
- {catocli-3.0.10.dist-info → catocli-3.0.13.dist-info}/METADATA +1 -1
- {catocli-3.0.10.dist-info → catocli-3.0.13.dist-info}/RECORD +59 -59
- models/mutation.accountManagement.disableAccount.json +2 -2
- models/mutation.accountManagement.removeAccount.json +2 -2
- models/mutation.groups.createGroup.json +810 -0
- models/mutation.groups.deleteGroup.json +810 -0
- models/mutation.groups.updateGroup.json +810 -0
- models/query.accountMetrics.json +333 -1
- models/query.accountSnapshot.json +50 -1
- models/query.appStats.json +38 -0
- models/query.appStatsTimeSeries.json +78 -1
- models/query.auditFeed.json +105 -0
- models/query.catalogs.json +2708 -1
- models/query.container.json +793 -1
- models/query.devices.json +10338 -1
- models/query.enterpriseDirectory.json +1315 -1
- models/query.events.json +38 -0
- models/query.eventsFeed.json +1587 -0
- models/query.eventsTimeSeries.json +78 -1
- models/query.groups.groupList.json +810 -0
- models/query.hardware.json +2333 -1
- models/query.hardwareManagement.json +1086 -1
- models/query.popLocations.json +1172 -1
- models/query.sandbox.json +825 -1
- models/query.socketPortMetrics.json +38 -0
- models/query.socketPortMetricsTimeSeries.json +78 -1
- schema/catolib.py +107 -37
- {catocli-3.0.10.dist-info → catocli-3.0.13.dist-info}/WHEEL +0 -0
- {catocli-3.0.10.dist-info → catocli-3.0.13.dist-info}/entry_points.txt +0 -0
- {catocli-3.0.10.dist-info → catocli-3.0.13.dist-info}/licenses/LICENSE +0 -0
- {catocli-3.0.10.dist-info → catocli-3.0.13.dist-info}/top_level.txt +0 -0
catocli/Utils/clidriver.py
CHANGED
|
@@ -53,8 +53,8 @@ from ..parsers.query_xdr import query_xdr_parse
|
|
|
53
53
|
from ..parsers.query_policy import query_policy_parse
|
|
54
54
|
from ..parsers.query_groups import query_groups_parse
|
|
55
55
|
from ..parsers.mutation_xdr import mutation_xdr_parse
|
|
56
|
-
from ..parsers.mutation_site import mutation_site_parse
|
|
57
56
|
from ..parsers.mutation_policy import mutation_policy_parse
|
|
57
|
+
from ..parsers.mutation_site import mutation_site_parse
|
|
58
58
|
from ..parsers.mutation_sites import mutation_sites_parse
|
|
59
59
|
from ..parsers.mutation_container import mutation_container_parse
|
|
60
60
|
from ..parsers.mutation_admin import mutation_admin_parse
|
|
@@ -188,8 +188,8 @@ query_xdr_parser = query_xdr_parse(query_subparsers)
|
|
|
188
188
|
query_policy_parser = query_policy_parse(query_subparsers)
|
|
189
189
|
query_groups_parser = query_groups_parse(query_subparsers)
|
|
190
190
|
mutation_xdr_parser = mutation_xdr_parse(mutation_subparsers)
|
|
191
|
-
mutation_site_parser = mutation_site_parse(mutation_subparsers)
|
|
192
191
|
mutation_policy_parser = mutation_policy_parse(mutation_subparsers)
|
|
192
|
+
mutation_site_parser = mutation_site_parse(mutation_subparsers)
|
|
193
193
|
mutation_sites_parser = mutation_sites_parse(mutation_subparsers)
|
|
194
194
|
mutation_container_parser = mutation_container_parse(mutation_subparsers)
|
|
195
195
|
mutation_admin_parser = mutation_admin_parse(mutation_subparsers)
|
|
@@ -269,7 +269,7 @@ def main(args=None):
|
|
|
269
269
|
if custom_headers:
|
|
270
270
|
configuration.custom_headers.update(custom_headers)
|
|
271
271
|
# Handle account ID override (applies to all commands except raw)
|
|
272
|
-
if args.func.__name__ not in ["createRawRequest"]:
|
|
272
|
+
if hasattr(args, 'func') and args.func.__name__ not in ["createRawRequest"]:
|
|
273
273
|
if hasattr(args, 'accountID') and args.accountID is not None:
|
|
274
274
|
# Command line override takes precedence
|
|
275
275
|
configuration.accountID = args.accountID
|
|
@@ -295,7 +295,7 @@ def main(args=None):
|
|
|
295
295
|
except Exception as e:
|
|
296
296
|
if isinstance(e, AttributeError):
|
|
297
297
|
print('Missing arguments. Usage: catocli <operation> -h')
|
|
298
|
-
if args.v==True:
|
|
298
|
+
if hasattr(args, 'v') and args.v==True:
|
|
299
299
|
print('ERROR: ',e)
|
|
300
300
|
traceback.print_exc()
|
|
301
301
|
else:
|
catocli/Utils/graphql_utils.py
CHANGED
|
@@ -347,11 +347,12 @@ def generateGraphqlPayload(variables_obj, operation, operation_name, renderArgsA
|
|
|
347
347
|
query_str += f" ( VARIABLES_PLACEHOLDER) {{\n"
|
|
348
348
|
query_str += f"{indent}{operation['name']} ( "
|
|
349
349
|
|
|
350
|
-
# Add operation arguments - only include arguments that
|
|
351
|
-
#
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
350
|
+
# Add main operation arguments - only include arguments that belong to the root operation field
|
|
351
|
+
# Arguments for nested fields (like updateRule.input) will be handled in the field rendering process
|
|
352
|
+
# Use args (not operationArgs) to only get main-level arguments for the root operation field
|
|
353
|
+
main_args = operation.get("args", {})
|
|
354
|
+
for arg_name in main_args:
|
|
355
|
+
arg = main_args[arg_name]
|
|
355
356
|
# Include required arguments always, and optional arguments only when they have meaningful values
|
|
356
357
|
var_name = arg["varName"]
|
|
357
358
|
is_required = arg.get("required", False)
|
|
@@ -860,6 +861,10 @@ def renderArgsAndFields(response_arg_str, variables_obj, cur_operation, definiti
|
|
|
860
861
|
if dynamic_operation_args is not None and isinstance(dynamic_operation_args, dict):
|
|
861
862
|
dynamic_operation_args[arg["varName"]] = arg
|
|
862
863
|
|
|
864
|
+
# CRITICAL FIX: Match JavaScript logic exactly - regenerate responseStr here
|
|
865
|
+
# JavaScript line 868: arg.responseStr = arg.name + ":$" + arg.varName + " ";
|
|
866
|
+
arg['responseStr'] = arg['name'] + ":$" + arg['varName'] + " "
|
|
867
|
+
|
|
863
868
|
# Only include arguments that are present in variables_obj and have values
|
|
864
869
|
# This matches the JavaScript implementation behavior
|
|
865
870
|
if arg["varName"] in variables_obj and variables_obj[arg["varName"]] is not None and variables_obj[arg["varName"]] != "" and variables_obj[arg["varName"]] != [] and variables_obj[arg["varName"]] != {}:
|
|
@@ -955,6 +960,11 @@ def renderArgsAndFields(response_arg_str, variables_obj, cur_operation, definiti
|
|
|
955
960
|
for arg_name in subfield['args']:
|
|
956
961
|
arg = subfield['args'][arg_name]
|
|
957
962
|
|
|
963
|
+
# CRITICAL: Match JavaScript logic exactly - DO NOT regenerate responseStr for subfield arguments
|
|
964
|
+
# JavaScript implementation (lines 901, 904) uses the existing arg.responseStr without modification
|
|
965
|
+
# The responseStr should have been set correctly during schema generation
|
|
966
|
+
# We only regenerate for NEW arguments discovered dynamically
|
|
967
|
+
|
|
958
968
|
# NEW: Dynamic argument collection for subfield arguments too
|
|
959
969
|
if dynamic_operation_args is not None and isinstance(dynamic_operation_args, dict):
|
|
960
970
|
dynamic_operation_args[arg["varName"]] = arg
|
catocli/Utils/help_formatter.py
CHANGED
|
@@ -226,18 +226,23 @@ class UniversalHelpFormatter:
|
|
|
226
226
|
readme_examples = self._extract_from_readme(command_path)
|
|
227
227
|
if readme_examples:
|
|
228
228
|
for example in readme_examples:
|
|
229
|
-
# Check if this
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
# Create JSONExample and apply platform-specific formatting
|
|
233
|
-
json_example = JSONExample(json_match)
|
|
234
|
-
formatted_examples = json_example.format_for_platform(self.platform_info, command_name)
|
|
235
|
-
help_lines.extend(formatted_examples)
|
|
236
|
-
elif not ('{' in example and '}' in example):
|
|
237
|
-
# Simple command examples without JSON
|
|
229
|
+
# Check if this example starts with a comment (lines starting with #)
|
|
230
|
+
if example.startswith('#') and '\n' in example:
|
|
231
|
+
# This is a comment followed by a command - preserve as-is
|
|
238
232
|
help_lines.append(example)
|
|
233
|
+
elif '{' in example and '}' in example:
|
|
234
|
+
# Check if this is a multi-line JSON example that can be platform-formatted
|
|
235
|
+
json_match = self._extract_json_from_example(example)
|
|
236
|
+
if json_match and not example.startswith('#'):
|
|
237
|
+
# Create JSONExample and apply platform-specific formatting
|
|
238
|
+
json_example = JSONExample(json_match)
|
|
239
|
+
formatted_examples = json_example.format_for_platform(self.platform_info, command_name)
|
|
240
|
+
help_lines.extend(formatted_examples)
|
|
241
|
+
else:
|
|
242
|
+
# Preserve as-is if it has comments or JSON extraction fails
|
|
243
|
+
help_lines.append(example)
|
|
239
244
|
else:
|
|
240
|
-
#
|
|
245
|
+
# Simple command examples without JSON
|
|
241
246
|
help_lines.append(example)
|
|
242
247
|
help_lines.append("") # Add spacing between examples
|
|
243
248
|
|
|
@@ -273,15 +278,20 @@ class UniversalHelpFormatter:
|
|
|
273
278
|
return "\n".join(help_lines)
|
|
274
279
|
|
|
275
280
|
def _extract_from_readme(self, command_path: str) -> List[str]:
|
|
276
|
-
"""Extract all catocli examples from README.md files"""
|
|
281
|
+
"""Extract all catocli examples from README.md files with comments"""
|
|
277
282
|
examples = []
|
|
278
283
|
|
|
279
284
|
# Find README.md file
|
|
280
285
|
base_dir = os.path.dirname(os.path.dirname(__file__)) # Go up from Utils to catocli
|
|
281
286
|
readme_path = os.path.join(base_dir, "parsers", command_path, "README.md")
|
|
282
287
|
|
|
288
|
+
# If not found, try custom path (for commands like query_eventsFeed)
|
|
283
289
|
if not os.path.exists(readme_path):
|
|
284
|
-
|
|
290
|
+
custom_readme_path = os.path.join(base_dir, "parsers", "custom", command_path, "README.md")
|
|
291
|
+
if os.path.exists(custom_readme_path):
|
|
292
|
+
readme_path = custom_readme_path
|
|
293
|
+
else:
|
|
294
|
+
return examples
|
|
285
295
|
|
|
286
296
|
try:
|
|
287
297
|
with open(readme_path, "r", encoding='utf-8') as f:
|
|
@@ -289,24 +299,47 @@ class UniversalHelpFormatter:
|
|
|
289
299
|
|
|
290
300
|
command_name = command_path.replace('_', ' ')
|
|
291
301
|
|
|
302
|
+
# Check if "### Examples Summary" or "### Additional Examples" sections exist
|
|
303
|
+
has_examples_summary = "### Examples Summary" in content or "### Additional Examples" in content
|
|
304
|
+
if has_examples_summary:
|
|
305
|
+
# Extract and display the examples summary section
|
|
306
|
+
summary_pattern = r'### (?:Examples Summary|Additional Examples)\n(.*?)(?=\n###|\n## |\Z)'
|
|
307
|
+
summary_match = re.search(summary_pattern, content, re.DOTALL)
|
|
308
|
+
if summary_match:
|
|
309
|
+
summary_content = summary_match.group(1).strip()
|
|
310
|
+
examples.append(f"\n### Examples Summary")
|
|
311
|
+
examples.append(summary_content)
|
|
312
|
+
examples.append("") # Add spacing
|
|
313
|
+
|
|
292
314
|
# Extract ALL catocli commands from markdown code blocks
|
|
293
315
|
code_block_pattern = r'```(?:bash|shell|json)?\n(.*?)```'
|
|
294
316
|
matches = re.findall(code_block_pattern, content, re.DOTALL)
|
|
295
317
|
|
|
296
318
|
for match in matches:
|
|
297
|
-
# Split the match into individual lines and extract catocli commands
|
|
319
|
+
# Split the match into individual lines and extract catocli commands with comments
|
|
298
320
|
lines = match.split('\n')
|
|
299
321
|
current_command = None
|
|
322
|
+
current_comment = None
|
|
300
323
|
in_multiline_json = False
|
|
301
324
|
|
|
302
325
|
for i, line in enumerate(lines):
|
|
303
326
|
stripped_line = line.strip()
|
|
304
327
|
|
|
305
|
-
|
|
328
|
+
# Check for comments that precede catocli commands
|
|
329
|
+
if stripped_line.startswith('# ') and not current_command:
|
|
330
|
+
current_comment = stripped_line
|
|
331
|
+
elif stripped_line.startswith('catocli') and command_name in stripped_line:
|
|
306
332
|
if current_command:
|
|
307
333
|
# Save previous multi-line command
|
|
308
334
|
examples.append(current_command)
|
|
309
|
-
|
|
335
|
+
|
|
336
|
+
# Include comment if it exists
|
|
337
|
+
if current_comment:
|
|
338
|
+
current_command = current_comment + '\n' + stripped_line
|
|
339
|
+
current_comment = None # Reset comment
|
|
340
|
+
else:
|
|
341
|
+
current_command = stripped_line
|
|
342
|
+
|
|
310
343
|
# Check if this starts a multi-line JSON command (ends with '{' with optional flags before it)
|
|
311
344
|
if stripped_line.endswith("'{"):
|
|
312
345
|
in_multiline_json = True
|
|
@@ -320,7 +353,7 @@ class UniversalHelpFormatter:
|
|
|
320
353
|
else:
|
|
321
354
|
# Continue multi-line JSON with exact indentation
|
|
322
355
|
current_command += '\n' + line
|
|
323
|
-
elif current_command and not in_multiline_json and stripped_line and not stripped_line.startswith('catocli'):
|
|
356
|
+
elif current_command and not in_multiline_json and stripped_line and not stripped_line.startswith('catocli') and not stripped_line.startswith('# '):
|
|
324
357
|
# This could be continuation of a single-line command
|
|
325
358
|
current_command += ' ' + stripped_line
|
|
326
359
|
elif current_command and (stripped_line.startswith('catocli') or stripped_line == '' or i == len(lines) - 1):
|
|
@@ -328,6 +361,13 @@ class UniversalHelpFormatter:
|
|
|
328
361
|
if not in_multiline_json:
|
|
329
362
|
examples.append(current_command)
|
|
330
363
|
current_command = stripped_line if stripped_line.startswith('catocli') and command_name in stripped_line else None
|
|
364
|
+
# Reset comment when starting a new command
|
|
365
|
+
if not current_command:
|
|
366
|
+
current_comment = None
|
|
367
|
+
elif stripped_line == '':
|
|
368
|
+
# Reset comment on empty lines if no command is being processed
|
|
369
|
+
if not current_command:
|
|
370
|
+
current_comment = None
|
|
331
371
|
|
|
332
372
|
# Don't forget the last command
|
|
333
373
|
if current_command and not in_multiline_json:
|
|
@@ -388,8 +428,13 @@ class UniversalHelpFormatter:
|
|
|
388
428
|
base_dir = os.path.dirname(os.path.dirname(__file__)) # Go up from Utils to catocli
|
|
389
429
|
readme_path = os.path.join(base_dir, "parsers", command_path, "README.md")
|
|
390
430
|
|
|
431
|
+
# If not found, try custom path (for commands like query_eventsFeed)
|
|
391
432
|
if not os.path.exists(readme_path):
|
|
392
|
-
|
|
433
|
+
custom_readme_path = os.path.join(base_dir, "parsers", "custom", command_path, "README.md")
|
|
434
|
+
if os.path.exists(custom_readme_path):
|
|
435
|
+
readme_path = custom_readme_path
|
|
436
|
+
else:
|
|
437
|
+
return sections
|
|
393
438
|
|
|
394
439
|
try:
|
|
395
440
|
with open(readme_path, "r", encoding='utf-8') as f:
|
catocli/__init__.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "3.0.
|
|
1
|
+
__version__ = "3.0.13"
|
|
2
2
|
__cato_host__ = "https://api.catonetworks.com/api/v1/graphql2"
|
|
@@ -20,7 +20,7 @@ def custom_parse(subparsers):
|
|
|
20
20
|
help='entity'+entity+' list',
|
|
21
21
|
usage=get_help_custom("entity_"+entity+"_list"))
|
|
22
22
|
|
|
23
|
-
item_list_parser.add_argument('-accountID', help='The Account ID.')
|
|
23
|
+
item_list_parser.add_argument('-accountID', help='The Account ID (optional - defaults to profile setting).')
|
|
24
24
|
item_list_parser.add_argument('-s', help='Search string', default='', nargs='?')
|
|
25
25
|
item_list_parser.add_argument('-f', default="csv", choices=["json","csv"], nargs='?',
|
|
26
26
|
help='Specify format for output')
|
|
@@ -18,7 +18,9 @@ def entityTypeList(args, configuration):
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
# Use accountID from configuration (profile) or fall back to command line parameter
|
|
22
|
+
account_id = configuration.accountID if configuration and hasattr(configuration, 'accountID') else (params.get("accountID") or params.get("accountId"))
|
|
23
|
+
variablesObj = { "accountID": account_id }
|
|
22
24
|
|
|
23
25
|
# Create the API client instance
|
|
24
26
|
api_client = ApiClient(configuration)
|
|
@@ -11,7 +11,7 @@ catocli mutation groups createGroup <json>
|
|
|
11
11
|
|
|
12
12
|
catocli mutation groups createGroup "$(cat < mutation.groups.createGroup.json)"
|
|
13
13
|
|
|
14
|
-
catocli mutation groups createGroup '{"createGroupInput":{"description":"string","groupMemberRefTypedInput":{"by":"ID","input":"string","type":"SITE"},"name":"string"}}'
|
|
14
|
+
catocli mutation groups createGroup '{"createGroupInput":{"description":"string","groupMemberRefTypedInput":{"by":"ID","input":"string","type":"SITE"},"name":"string"},"groupMembersListInput":{"groupMembersListFilterInput":{"name":{"eq":"string","in":["string1","string2"],"neq":"string","nin":["string1","string2"],"regex":"string"},"type":{"eq":"SITE","in":"SITE","neq":"SITE","nin":"SITE"}},"groupMembersListSortInput":{"name":{"direction":"ASC","priority":1},"type":{"direction":"ASC","priority":1}},"pagingInput":{"from":1,"limit":1}}}'
|
|
15
15
|
|
|
16
16
|
catocli mutation groups createGroup '{
|
|
17
17
|
"createGroupInput": {
|
|
@@ -22,6 +22,43 @@ catocli mutation groups createGroup '{
|
|
|
22
22
|
"type": "SITE"
|
|
23
23
|
},
|
|
24
24
|
"name": "string"
|
|
25
|
+
},
|
|
26
|
+
"groupMembersListInput": {
|
|
27
|
+
"groupMembersListFilterInput": {
|
|
28
|
+
"name": {
|
|
29
|
+
"eq": "string",
|
|
30
|
+
"in": [
|
|
31
|
+
"string1",
|
|
32
|
+
"string2"
|
|
33
|
+
],
|
|
34
|
+
"neq": "string",
|
|
35
|
+
"nin": [
|
|
36
|
+
"string1",
|
|
37
|
+
"string2"
|
|
38
|
+
],
|
|
39
|
+
"regex": "string"
|
|
40
|
+
},
|
|
41
|
+
"type": {
|
|
42
|
+
"eq": "SITE",
|
|
43
|
+
"in": "SITE",
|
|
44
|
+
"neq": "SITE",
|
|
45
|
+
"nin": "SITE"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"groupMembersListSortInput": {
|
|
49
|
+
"name": {
|
|
50
|
+
"direction": "ASC",
|
|
51
|
+
"priority": 1
|
|
52
|
+
},
|
|
53
|
+
"type": {
|
|
54
|
+
"direction": "ASC",
|
|
55
|
+
"priority": 1
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"pagingInput": {
|
|
59
|
+
"from": 1,
|
|
60
|
+
"limit": 1
|
|
61
|
+
}
|
|
25
62
|
}
|
|
26
63
|
}'
|
|
27
64
|
```
|
|
@@ -30,3 +67,4 @@ catocli mutation groups createGroup '{
|
|
|
30
67
|
|
|
31
68
|
`accountId` [ID] - (required) N/A
|
|
32
69
|
`createGroupInput` [CreateGroupInput] - (required) N/A
|
|
70
|
+
`groupMembersListInput` [GroupMembersListInput] - (required) N/A
|
|
@@ -11,9 +11,46 @@ catocli mutation groups deleteGroup <json>
|
|
|
11
11
|
|
|
12
12
|
catocli mutation groups deleteGroup "$(cat < mutation.groups.deleteGroup.json)"
|
|
13
13
|
|
|
14
|
-
catocli mutation groups deleteGroup '{"groupRefInput":{"by":"ID","input":"string"}}'
|
|
14
|
+
catocli mutation groups deleteGroup '{"groupMembersListInput":{"groupMembersListFilterInput":{"name":{"eq":"string","in":["string1","string2"],"neq":"string","nin":["string1","string2"],"regex":"string"},"type":{"eq":"SITE","in":"SITE","neq":"SITE","nin":"SITE"}},"groupMembersListSortInput":{"name":{"direction":"ASC","priority":1},"type":{"direction":"ASC","priority":1}},"pagingInput":{"from":1,"limit":1}},"groupRefInput":{"by":"ID","input":"string"}}'
|
|
15
15
|
|
|
16
16
|
catocli mutation groups deleteGroup '{
|
|
17
|
+
"groupMembersListInput": {
|
|
18
|
+
"groupMembersListFilterInput": {
|
|
19
|
+
"name": {
|
|
20
|
+
"eq": "string",
|
|
21
|
+
"in": [
|
|
22
|
+
"string1",
|
|
23
|
+
"string2"
|
|
24
|
+
],
|
|
25
|
+
"neq": "string",
|
|
26
|
+
"nin": [
|
|
27
|
+
"string1",
|
|
28
|
+
"string2"
|
|
29
|
+
],
|
|
30
|
+
"regex": "string"
|
|
31
|
+
},
|
|
32
|
+
"type": {
|
|
33
|
+
"eq": "SITE",
|
|
34
|
+
"in": "SITE",
|
|
35
|
+
"neq": "SITE",
|
|
36
|
+
"nin": "SITE"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"groupMembersListSortInput": {
|
|
40
|
+
"name": {
|
|
41
|
+
"direction": "ASC",
|
|
42
|
+
"priority": 1
|
|
43
|
+
},
|
|
44
|
+
"type": {
|
|
45
|
+
"direction": "ASC",
|
|
46
|
+
"priority": 1
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"pagingInput": {
|
|
50
|
+
"from": 1,
|
|
51
|
+
"limit": 1
|
|
52
|
+
}
|
|
53
|
+
},
|
|
17
54
|
"groupRefInput": {
|
|
18
55
|
"by": "ID",
|
|
19
56
|
"input": "string"
|
|
@@ -24,4 +61,5 @@ catocli mutation groups deleteGroup '{
|
|
|
24
61
|
#### Operation Arguments for mutation.groups.deleteGroup ####
|
|
25
62
|
|
|
26
63
|
`accountId` [ID] - (required) N/A
|
|
64
|
+
`groupMembersListInput` [GroupMembersListInput] - (required) N/A
|
|
27
65
|
`groupRefInput` [GroupRefInput] - (required) N/A
|
|
@@ -11,9 +11,46 @@ catocli mutation groups updateGroup <json>
|
|
|
11
11
|
|
|
12
12
|
catocli mutation groups updateGroup "$(cat < mutation.groups.updateGroup.json)"
|
|
13
13
|
|
|
14
|
-
catocli mutation groups updateGroup '{"updateGroupInput":{"description":"string","groupMemberRefTypedInput":{"by":"ID","input":"string","type":"SITE"},"groupRefInput":{"by":"ID","input":"string"},"name":"string"}}'
|
|
14
|
+
catocli mutation groups updateGroup '{"groupMembersListInput":{"groupMembersListFilterInput":{"name":{"eq":"string","in":["string1","string2"],"neq":"string","nin":["string1","string2"],"regex":"string"},"type":{"eq":"SITE","in":"SITE","neq":"SITE","nin":"SITE"}},"groupMembersListSortInput":{"name":{"direction":"ASC","priority":1},"type":{"direction":"ASC","priority":1}},"pagingInput":{"from":1,"limit":1}},"updateGroupInput":{"description":"string","groupMemberRefTypedInput":{"by":"ID","input":"string","type":"SITE"},"groupRefInput":{"by":"ID","input":"string"},"name":"string"}}'
|
|
15
15
|
|
|
16
16
|
catocli mutation groups updateGroup '{
|
|
17
|
+
"groupMembersListInput": {
|
|
18
|
+
"groupMembersListFilterInput": {
|
|
19
|
+
"name": {
|
|
20
|
+
"eq": "string",
|
|
21
|
+
"in": [
|
|
22
|
+
"string1",
|
|
23
|
+
"string2"
|
|
24
|
+
],
|
|
25
|
+
"neq": "string",
|
|
26
|
+
"nin": [
|
|
27
|
+
"string1",
|
|
28
|
+
"string2"
|
|
29
|
+
],
|
|
30
|
+
"regex": "string"
|
|
31
|
+
},
|
|
32
|
+
"type": {
|
|
33
|
+
"eq": "SITE",
|
|
34
|
+
"in": "SITE",
|
|
35
|
+
"neq": "SITE",
|
|
36
|
+
"nin": "SITE"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"groupMembersListSortInput": {
|
|
40
|
+
"name": {
|
|
41
|
+
"direction": "ASC",
|
|
42
|
+
"priority": 1
|
|
43
|
+
},
|
|
44
|
+
"type": {
|
|
45
|
+
"direction": "ASC",
|
|
46
|
+
"priority": 1
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"pagingInput": {
|
|
50
|
+
"from": 1,
|
|
51
|
+
"limit": 1
|
|
52
|
+
}
|
|
53
|
+
},
|
|
17
54
|
"updateGroupInput": {
|
|
18
55
|
"description": "string",
|
|
19
56
|
"groupMemberRefTypedInput": {
|
|
@@ -33,4 +70,5 @@ catocli mutation groups updateGroup '{
|
|
|
33
70
|
#### Operation Arguments for mutation.groups.updateGroup ####
|
|
34
71
|
|
|
35
72
|
`accountId` [ID] - (required) N/A
|
|
73
|
+
`groupMembersListInput` [GroupMembersListInput] - (required) N/A
|
|
36
74
|
`updateGroupInput` [UpdateGroupInput] - (required) N/A
|
|
@@ -11,12 +11,30 @@ catocli query accountMetrics <json>
|
|
|
11
11
|
|
|
12
12
|
catocli query accountMetrics "$(cat < query.accountMetrics.json)"
|
|
13
13
|
|
|
14
|
-
catocli query accountMetrics '{"groupDevices":true,"groupInterfaces":true,"timeFrame":"example_value"}'
|
|
14
|
+
catocli query accountMetrics '{"buckets":1,"groupDevices":true,"groupInterfaces":true,"labels":"bytesUpstream","perSecond":true,"siteIDs":["id1","id2"],"timeFrame":"example_value","toRate":true,"types":["string1","string2"],"useDefaultSizeBucket":true,"userIDs":["id1","id2"],"withMissingData":true}'
|
|
15
15
|
|
|
16
16
|
catocli query accountMetrics '{
|
|
17
|
+
"buckets": 1,
|
|
17
18
|
"groupDevices": true,
|
|
18
19
|
"groupInterfaces": true,
|
|
19
|
-
"
|
|
20
|
+
"labels": "bytesUpstream",
|
|
21
|
+
"perSecond": true,
|
|
22
|
+
"siteIDs": [
|
|
23
|
+
"id1",
|
|
24
|
+
"id2"
|
|
25
|
+
],
|
|
26
|
+
"timeFrame": "example_value",
|
|
27
|
+
"toRate": true,
|
|
28
|
+
"types": [
|
|
29
|
+
"string1",
|
|
30
|
+
"string2"
|
|
31
|
+
],
|
|
32
|
+
"useDefaultSizeBucket": true,
|
|
33
|
+
"userIDs": [
|
|
34
|
+
"id1",
|
|
35
|
+
"id2"
|
|
36
|
+
],
|
|
37
|
+
"withMissingData": true
|
|
20
38
|
}'
|
|
21
39
|
```
|
|
22
40
|
|
|
@@ -44,6 +62,7 @@ Format: `"utc.YYYY-MM-{DD/HH:MM:SS--DD/HH:MM:SS}"`
|
|
|
44
62
|
#### Operation Arguments for query.accountMetrics ####
|
|
45
63
|
|
|
46
64
|
`accountID` [ID] - (required) Unique Identifier of Account.
|
|
65
|
+
`buckets` [Int] - (required) number of buckets, defaults to 10, max 1000
|
|
47
66
|
`groupDevices` [Boolean] - (required) When the boolean argument groupDevices is set to __true__, then the analytics for all the
|
|
48
67
|
Sockets (usually two in high availability) are aggregated as one result.
|
|
49
68
|
|
|
@@ -51,4 +70,12 @@ For the best results for aggregated Sockets, we recommend that there is consiste
|
|
|
51
70
|
names and functionality (for example Destination) for the links on both Sockets.
|
|
52
71
|
`groupInterfaces` [Boolean] - (required) When the boolean argument groupInterfaces is set to __true__, then the data for all the
|
|
53
72
|
interfaces are aggregated to a single interface.
|
|
73
|
+
`labels` [TimeseriesMetricType[]] - (required) N/A Default Value: ['bytesUpstream', 'bytesDownstream', 'bytesUpstreamMax', 'bytesDownstreamMax', 'packetsUpstream', 'packetsDownstream', 'lostUpstream', 'lostDownstream', 'lostUpstreamPcnt', 'lostDownstreamPcnt', 'packetsDiscardedDownstream', 'packetsDiscardedUpstream', 'packetsDiscardedUpstreamPcnt', 'packetsDiscardedDownstreamPcnt', 'jitterUpstream', 'jitterDownstream', 'bytesTotal', 'rtt', 'health', 'tunnelAge', 'lastMilePacketLoss', 'lastMileLatency']
|
|
74
|
+
`perSecond` [Boolean] - (required) whether to normalize the data into per second (i.e. divide by granularity)
|
|
75
|
+
`siteIDs` [ID[]] - (required) A list of unique IDs for each site. If specified, only sites in this list are returned. Otherwise, all sites are returned.
|
|
54
76
|
`timeFrame` [TimeFrame] - (required) The time frame for the data that the query returns. The argument is in the format type.time value. This argument is mandatory.
|
|
77
|
+
`toRate` [Boolean] - (required) Normalize collected metrics as per-second values
|
|
78
|
+
`types` [String[]] - (required) N/A
|
|
79
|
+
`useDefaultSizeBucket` [Boolean] - (required) In case we want to have the default size bucket (from properties)
|
|
80
|
+
`userIDs` [ID[]] - (required) A list of unique IDs for each user. If specified, only users in this list are returned. Otherwise, no user metrics are returned.
|
|
81
|
+
`withMissingData` [Boolean] - (required) If false, the data field will be set to '0' for buckets with no reported data. Otherwise it will be set to -1
|
|
@@ -11,6 +11,22 @@ catocli query accountSnapshot <json>
|
|
|
11
11
|
|
|
12
12
|
catocli query accountSnapshot "$(cat < query.accountSnapshot.json)"
|
|
13
13
|
|
|
14
|
+
catocli query accountSnapshot '{"siteIDs":["id1","id2"],"userIDs":["id1","id2"]}'
|
|
15
|
+
|
|
16
|
+
catocli query accountSnapshot '{
|
|
17
|
+
"siteIDs": [
|
|
18
|
+
"id1",
|
|
19
|
+
"id2"
|
|
20
|
+
],
|
|
21
|
+
"userIDs": [
|
|
22
|
+
"id1",
|
|
23
|
+
"id2"
|
|
24
|
+
]
|
|
25
|
+
}'
|
|
26
|
+
```
|
|
27
|
+
|
|
14
28
|
#### Operation Arguments for query.accountSnapshot ####
|
|
15
29
|
|
|
16
30
|
`accountID` [ID] - (required) Unique Identifier of Account.
|
|
31
|
+
`siteIDs` [ID[]] - (required) List of Unique Site Identifiers. If specified, only sites in list will be returned
|
|
32
|
+
`userIDs` [ID[]] - (required) request specific IDs, regardless of if connected or not
|
|
@@ -11,7 +11,7 @@ catocli query appStats <json>
|
|
|
11
11
|
|
|
12
12
|
catocli query appStats "$(cat < query.appStats.json)"
|
|
13
13
|
|
|
14
|
-
catocli query appStats '{"appStatsFilter":{"fieldName":"ad_name","operator":"is","values":["string1","string2"]},"appStatsSort":{"fieldName":"ad_name","order":"asc"},"dimension":{"fieldName":"ad_name"},"measure":{"aggType":"sum","fieldName":"ad_name","trend":true},"timeFrame":"example_value"}'
|
|
14
|
+
catocli query appStats '{"appStatsFilter":{"fieldName":"ad_name","operator":"is","values":["string1","string2"]},"appStatsSort":{"fieldName":"ad_name","order":"asc"},"dimension":{"fieldName":"ad_name"},"from":1,"limit":1,"measure":{"aggType":"sum","fieldName":"ad_name","trend":true},"timeFrame":"example_value"}'
|
|
15
15
|
|
|
16
16
|
catocli query appStats '{
|
|
17
17
|
"appStatsFilter": {
|
|
@@ -29,6 +29,8 @@ catocli query appStats '{
|
|
|
29
29
|
"dimension": {
|
|
30
30
|
"fieldName": "ad_name"
|
|
31
31
|
},
|
|
32
|
+
"from": 1,
|
|
33
|
+
"limit": 1,
|
|
32
34
|
"measure": {
|
|
33
35
|
"aggType": "sum",
|
|
34
36
|
"fieldName": "ad_name",
|
|
@@ -39,9 +41,14 @@ catocli query appStats '{
|
|
|
39
41
|
```
|
|
40
42
|
|
|
41
43
|
## Advanced Usage
|
|
44
|
+
### Additional Examples
|
|
45
|
+
- Query to export user activity as in flows_created, for distinct users (user_name) for the last day
|
|
46
|
+
- Query to export application_name, user_name and risk_score with traffic sum(upstream, downstream, trafffic) for last day
|
|
47
|
+
|
|
42
48
|
# Query to export user activity as in flows_created, for distinct users (user_name) for the last day
|
|
43
49
|
|
|
44
50
|
```bash
|
|
51
|
+
# Query to export user activity as in flows_created, for distinct users (user_name) for the last day
|
|
45
52
|
catocli query appStats '{
|
|
46
53
|
"appStatsFilter": [],
|
|
47
54
|
"appStatsSort": [],
|
|
@@ -67,6 +74,7 @@ catocli query appStats '{
|
|
|
67
74
|
# Query to export application_name, user_name and risk_score with traffic sum(upstream, downstream, trafffic) for last day
|
|
68
75
|
|
|
69
76
|
```bash
|
|
77
|
+
## Query to export application_name, user_name and risk_score with traffic sum(upstream, downstream, trafffic) for last day
|
|
70
78
|
catocli query appStats '{
|
|
71
79
|
"appStatsFilter": [],
|
|
72
80
|
"appStatsSort": [],
|
|
@@ -128,5 +136,7 @@ Format: `"utc.YYYY-MM-{DD/HH:MM:SS--DD/HH:MM:SS}"`
|
|
|
128
136
|
`appStatsFilter` [AppStatsFilter[]] - (required) N/A
|
|
129
137
|
`appStatsSort` [AppStatsSort[]] - (required) N/A
|
|
130
138
|
`dimension` [Dimension[]] - (required) N/A
|
|
139
|
+
`from` [Int] - (required) N/A
|
|
140
|
+
`limit` [Int] - (required) N/A
|
|
131
141
|
`measure` [Measure[]] - (required) N/A
|
|
132
142
|
`timeFrame` [TimeFrame] - (required) N/A
|
|
@@ -11,7 +11,7 @@ catocli query appStatsTimeSeries <json>
|
|
|
11
11
|
|
|
12
12
|
catocli query appStatsTimeSeries "$(cat < query.appStatsTimeSeries.json)"
|
|
13
13
|
|
|
14
|
-
catocli query appStatsTimeSeries '{"appStatsFilter":{"fieldName":"ad_name","operator":"is","values":["string1","string2"]},"dimension":{"fieldName":"ad_name"},"measure":{"aggType":"sum","fieldName":"ad_name","trend":true},"timeFrame":"example_value"}'
|
|
14
|
+
catocli query appStatsTimeSeries '{"appStatsFilter":{"fieldName":"ad_name","operator":"is","values":["string1","string2"]},"buckets":1,"dimension":{"fieldName":"ad_name"},"measure":{"aggType":"sum","fieldName":"ad_name","trend":true},"perSecond":true,"timeFrame":"example_value","useDefaultSizeBucket":true,"withMissingData":true}'
|
|
15
15
|
|
|
16
16
|
catocli query appStatsTimeSeries '{
|
|
17
17
|
"appStatsFilter": {
|
|
@@ -22,6 +22,7 @@ catocli query appStatsTimeSeries '{
|
|
|
22
22
|
"string2"
|
|
23
23
|
]
|
|
24
24
|
},
|
|
25
|
+
"buckets": 1,
|
|
25
26
|
"dimension": {
|
|
26
27
|
"fieldName": "ad_name"
|
|
27
28
|
},
|
|
@@ -30,14 +31,22 @@ catocli query appStatsTimeSeries '{
|
|
|
30
31
|
"fieldName": "ad_name",
|
|
31
32
|
"trend": true
|
|
32
33
|
},
|
|
33
|
-
"
|
|
34
|
+
"perSecond": true,
|
|
35
|
+
"timeFrame": "example_value",
|
|
36
|
+
"useDefaultSizeBucket": true,
|
|
37
|
+
"withMissingData": true
|
|
34
38
|
}'
|
|
35
39
|
```
|
|
36
40
|
|
|
37
41
|
## Advanced Usage
|
|
42
|
+
### Additional Examples
|
|
43
|
+
- Query to export upstream, downstream and traffic for user_name and application_name for last day broken into 1 hour buckets
|
|
44
|
+
- Query to export WANBOUND traffic including upstream, downstream and traffic for user_name and application_name for last day broken into 1 hour buckets
|
|
45
|
+
|
|
38
46
|
# Query to export upstream, downstream and traffic for user_name and application_name for last day broken into 1 hour buckets
|
|
39
47
|
|
|
40
48
|
```bash
|
|
49
|
+
# Query to export upstream, downstream and traffic for user_name and application_name for last day broken into 1 hour buckets
|
|
41
50
|
catocli query appStatsTimeSeries '{
|
|
42
51
|
"appStatsFilter": [],
|
|
43
52
|
"buckets": 24,
|
|
@@ -70,6 +79,7 @@ catocli query appStatsTimeSeries '{
|
|
|
70
79
|
# Query to export WANBOUND traffic including upstream, downstream and traffic for user_name and application_name for last day broken into 1 hour buckets
|
|
71
80
|
|
|
72
81
|
```bash
|
|
82
|
+
# Query to export WANBOUND traffic including upstream, downstream and traffic for user_name and application_name for last day broken into 1 hour buckets
|
|
73
83
|
catocli query appStatsTimeSeries '{
|
|
74
84
|
"appStatsFilter": [
|
|
75
85
|
{
|
|
@@ -133,6 +143,10 @@ Format: `"utc.YYYY-MM-{DD/HH:MM:SS--DD/HH:MM:SS}"`
|
|
|
133
143
|
|
|
134
144
|
`accountID` [ID] - (required) Account ID
|
|
135
145
|
`appStatsFilter` [AppStatsFilter[]] - (required) N/A
|
|
146
|
+
`buckets` [Int] - (required) N/A
|
|
136
147
|
`dimension` [Dimension[]] - (required) N/A
|
|
137
148
|
`measure` [Measure[]] - (required) N/A
|
|
149
|
+
`perSecond` [Boolean] - (required) whether to normalize the data into per second (i.e. divide by granularity)
|
|
138
150
|
`timeFrame` [TimeFrame] - (required) N/A
|
|
151
|
+
`useDefaultSizeBucket` [Boolean] - (required) In case we want to have the default size bucket (from properties)
|
|
152
|
+
`withMissingData` [Boolean] - (required) If false, the data field will be set to '0' for buckets with no reported data. Otherwise it will be set to -1
|
|
@@ -11,7 +11,7 @@ catocli query auditFeed <json>
|
|
|
11
11
|
|
|
12
12
|
catocli query auditFeed "$(cat < query.auditFeed.json)"
|
|
13
13
|
|
|
14
|
-
catocli query auditFeed '{"accountIDs":["id1","id2"],"auditFieldFilterInput":{"fieldNameInput":{"AuditFieldName":"admin"},"operator":"is","values":["string1","string2"]},"marker":"string","timeFrame":"example_value"}'
|
|
14
|
+
catocli query auditFeed '{"accountIDs":["id1","id2"],"auditFieldFilterInput":{"fieldNameInput":{"AuditFieldName":"admin"},"operator":"is","values":["string1","string2"]},"fieldNames":"admin","marker":"string","timeFrame":"example_value"}'
|
|
15
15
|
|
|
16
16
|
catocli query auditFeed '{
|
|
17
17
|
"accountIDs": [
|
|
@@ -28,6 +28,7 @@ catocli query auditFeed '{
|
|
|
28
28
|
"string2"
|
|
29
29
|
]
|
|
30
30
|
},
|
|
31
|
+
"fieldNames": "admin",
|
|
31
32
|
"marker": "string",
|
|
32
33
|
"timeFrame": "example_value"
|
|
33
34
|
}'
|
|
@@ -58,5 +59,6 @@ Format: `"utc.YYYY-MM-{DD/HH:MM:SS--DD/HH:MM:SS}"`
|
|
|
58
59
|
|
|
59
60
|
`accountIDs` [ID[]] - (required) List of Unique Account Identifiers.
|
|
60
61
|
`auditFieldFilterInput` [AuditFieldFilterInput[]] - (required) N/A
|
|
62
|
+
`fieldNames` [AuditFieldName[]] - (required) N/A Default Value: ['admin', 'apiKey', 'model_name', 'admin_id', 'module', 'audit_creation_type', 'insertion_date', 'change_type', 'creation_date', 'model_type', 'account', 'account_id']
|
|
61
63
|
`marker` [String] - (required) Marker to use to get results from
|
|
62
64
|
`timeFrame` [TimeFrame] - (required) N/A
|