cortexapps-cli 0.26.4__tar.gz → 0.26.6__tar.gz
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.
- {cortexapps_cli-0.26.4 → cortexapps_cli-0.26.6}/PKG-INFO +1 -1
- {cortexapps_cli-0.26.4 → cortexapps_cli-0.26.6}/cortexapps_cli/cortex.py +13 -4
- {cortexapps_cli-0.26.4 → cortexapps_cli-0.26.6}/pyproject.toml +1 -1
- {cortexapps_cli-0.26.4 → cortexapps_cli-0.26.6}/LICENSE +0 -0
- {cortexapps_cli-0.26.4 → cortexapps_cli-0.26.6}/README.rst +0 -0
|
@@ -423,13 +423,13 @@ def add_argument_page(subparser, help_text='Page number to return, 0 indexed'):
|
|
|
423
423
|
metavar=''
|
|
424
424
|
)
|
|
425
425
|
|
|
426
|
-
def add_argument_page_size(subparser, help_text='Page size for results
|
|
426
|
+
def add_argument_page_size(subparser, help_text='Page size for results'):
|
|
427
427
|
subparser.add_argument(
|
|
428
428
|
'-z',
|
|
429
429
|
'--pageSize',
|
|
430
430
|
help=help_text,
|
|
431
431
|
required=False,
|
|
432
|
-
default=
|
|
432
|
+
default=argparse.SUPPRESS,
|
|
433
433
|
metavar=''
|
|
434
434
|
)
|
|
435
435
|
|
|
@@ -607,7 +607,8 @@ def exit(r, method, expected_rc=200, err=None):
|
|
|
607
607
|
debug_json(r, method)
|
|
608
608
|
if err:
|
|
609
609
|
print(f'{method} {r.url} => {r.status_code} {r.reason}')
|
|
610
|
-
|
|
610
|
+
if err != None:
|
|
611
|
+
print(err)
|
|
611
612
|
|
|
612
613
|
if not config.get('is_importing', False) or r.status_code != 409 or r.status_code != 400:
|
|
613
614
|
sys.exit(r.status_code)
|
|
@@ -643,12 +644,17 @@ def get(url, headers={}):
|
|
|
643
644
|
api_key(headers)
|
|
644
645
|
|
|
645
646
|
err = None
|
|
647
|
+
details = None
|
|
646
648
|
try:
|
|
647
649
|
r = requests.get(config['url'] + url, headers=headers)
|
|
648
650
|
r.raise_for_status()
|
|
649
651
|
except requests.exceptions.RequestException as e:
|
|
650
652
|
err = e.response.text
|
|
651
|
-
|
|
653
|
+
if err != "":
|
|
654
|
+
if details in e.response.json():
|
|
655
|
+
details = e.response.json()['details']
|
|
656
|
+
exit(r, 'GET', err = details)
|
|
657
|
+
|
|
652
658
|
|
|
653
659
|
def put(url, headers={}, payload=""):
|
|
654
660
|
api_key(headers)
|
|
@@ -809,6 +815,9 @@ def export(args):
|
|
|
809
815
|
f1 = open(catalog_directory + "/" + output_tag + ".yaml", 'w')
|
|
810
816
|
f1.write(str(descriptor) + "\n")
|
|
811
817
|
|
|
818
|
+
# Remove page from args so we don't paginate subsequent calls.
|
|
819
|
+
delattr(args, 'page')
|
|
820
|
+
|
|
812
821
|
if any(export_type == "ALL" or export_type == "ip-allowlist" for export_type in args.types.split()):
|
|
813
822
|
print("Getting IP Allowlist definitions")
|
|
814
823
|
ip_allowlist_json=json_directory + "/ip-allowlist.json"
|
|
File without changes
|
|
File without changes
|