cortexapps-cli 0.24.1__tar.gz → 0.24.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cortexapps-cli
3
- Version: 0.24.1
3
+ Version: 0.24.3
4
4
  Summary: Command Line Interface for cortexapps
5
5
  License: MIT
6
6
  Author: Cortex Apps
@@ -251,6 +251,125 @@ Your cortex config file will require api keys for both tenants. It would look l
251
251
  are automatically imported by Cortex. Cortex does not have access to any keys, so it cannot export any
252
252
  integration configurations.
253
253
 
254
+
255
+ ---------------------------------------------------------
256
+ Export all services from one tenant; import into another
257
+ ---------------------------------------------------------
258
+
259
+ This example shows how to export services from a tenant named :code:`myTenant-dev` and import those services into a tenant
260
+ named :code:`myTenant`. It is similar to the full export example "`Export from one tenant; import into another`_", but only
261
+ exports/imports services.
262
+
263
+ Your cortex config file will require api keys for both tenants. It would look like this:
264
+
265
+ .. code-block::
266
+
267
+ [myTenant]
268
+ api_key = <your API Key for myTenant>
269
+
270
+ [myTenant-dev]
271
+ api_key = <your API Key for myTenant-dev>
272
+
273
+
274
+ **Option 1: export service YAMLs to a directory and then import them**
275
+
276
+ This option is helpful in case you want to save the entity YAML files. It makes it easy to restart or retry an import
277
+ because you will have all YAMLs saved on disk.
278
+
279
+ **Export**
280
+
281
+ .. code:: bash
282
+
283
+ mkdir -p /tmp/cortex-export
284
+ cd /tmp/cortex-export
285
+ for service in `cortex -t myTenant catalog list -t service | jq -r ".entities[].tag" | sort`
286
+ do
287
+ cortex -t myTenant catalog descriptor -y -t ${service} > ${service}.yaml
288
+ done
289
+
290
+ **Import**
291
+
292
+ .. code:: bash
293
+
294
+ cd /tmp/cortex-export
295
+ for file in `ls -1 *.yaml`
296
+ do
297
+ cortex -t myTenant-dev catalog create -f ${file}
298
+ done
299
+
300
+ **Option 2: combine the export and import in a single command**
301
+
302
+ This option is simpler and doesn't require any disk operations. However, if it fails for any reason you have to run the
303
+ entire export/import in its entirety.
304
+
305
+ .. code:: bash
306
+
307
+ for service in `cortex -t myTenant catalog list -t service | jq -r ".entities[].tag" | sort`
308
+ do
309
+ echo "Processing service: ${service}"
310
+ cortex -t myTenant catalog descriptor -y -t ${service} | cortex -t myTenant-dev catalog create -f-
311
+ done
312
+
313
+ ---------------------------------------------------------
314
+ Export all domains from one tenant; import into another
315
+ ---------------------------------------------------------
316
+
317
+ This example shows how to export domains from a tenant named :code:`myTenant-dev` and import those domains into a tenant
318
+ named :code:`myTenant`. It is similar to the full export example "`Export from one tenant; import into another`_", but only
319
+ exports/imports domains.
320
+
321
+ Your cortex config file will require api keys for both tenants. It would look like this:
322
+
323
+ .. code-block::
324
+
325
+ [myTenant]
326
+ api_key = <your API Key for myTenant>
327
+
328
+ [myTenant-dev]
329
+ api_key = <your API Key for myTenant-dev>
330
+
331
+
332
+ **Option 1: export domain YAMLs to a directory and then import them**
333
+
334
+ This option is helpful in case you want to save the entity YAML files. It makes it easy to restart or retry an import
335
+ because you will have all YAMLs saved on disk.
336
+
337
+ **Export**
338
+
339
+ .. code:: bash
340
+
341
+ mkdir -p /tmp/cortex-export
342
+ cd /tmp/cortex-export
343
+ for domain in `cortex -t myTenant catalog list -t domain | jq -r ".entities[].tag" | sort`
344
+ do
345
+ echo "creating ${domain}.yaml"
346
+ cortex -t myTenant catalog descriptor -y -t ${domain} > ${domain}.yaml
347
+ done
348
+
349
+ **Import**
350
+
351
+ .. code:: bash
352
+
353
+ cd /tmp/cortex-export
354
+ for file in `ls -1 *.yaml`
355
+ do
356
+ cortex -t myTenant-dev catalog create -f ${file}
357
+ done
358
+
359
+ **Option 2: combine the export and import in a single command**
360
+
361
+ This option is simpler and doesn't require any disk operations. However, if it fails for any reason you have to run the
362
+ entire export/import in its entirety.
363
+
364
+ .. code:: bash
365
+
366
+ for domain in `cortex -t myTenant catalog list -t domain | jq -r ".entities[].tag" | sort`
367
+ do
368
+ echo "Processing domain: ${domain}"
369
+ cortex -t myTenant catalog descriptor -y -t ${domain} | cortex -t myTenant-dev catalog create -f-
370
+ done
371
+
372
+
254
373
  ------------------------
255
374
  Iterate over all domains
256
375
  ------------------------
@@ -480,6 +599,37 @@ Run this command for two different scorecards and diff the csv files to compare
480
599
 
481
600
  sdiff -s /tmp/scorecard1.csv /tmp/scorecard2.csv
482
601
 
602
+ -----------------------------------------------------------------------------
603
+ Backup all Workday teams
604
+ -----------------------------------------------------------------------------
605
+
606
+ This recipe is helpful if you change your Workday report and want to save your existing teams in case you want to restore them.
607
+
608
+ For each team it will create two files:
609
+ - a JSON file that contains the Workday data
610
+ - a Cortex team YAML file that refers to the Workday team
611
+
612
+ .. code:: bash
613
+
614
+ for team in `cortex teams list | jq -r '.teams[] | select (.type == "IDP") | select (.idpGroup.provider == "WORKDAY") | .teamTag'`
615
+ do
616
+ cortex teams get -t ${team} > ${team}.json
617
+ cortex catalog descriptor -y -t ${team} > ${team}.yaml
618
+ done
619
+
620
+ -----------------------------------------------------------------------------
621
+ Delete all Workday teams
622
+ -----------------------------------------------------------------------------
623
+
624
+ This recipe is helpful if you want to remove all Workday teams and import from scratch.
625
+
626
+ .. code:: bash
627
+
628
+ for team in `cortex teams list | jq -r '.teams[] | select (.type == "IDP") | select (.idpGroup.provider == "WORKDAY") | .teamTag'`
629
+ do
630
+ cortex teams delete -t ${team}
631
+ done
632
+
483
633
  ====================================
484
634
 
485
635
  .. |PyPI download month| image:: https://img.shields.io/pypi/dm/cortexapps-cli.svg
@@ -230,6 +230,125 @@ Your cortex config file will require api keys for both tenants. It would look l
230
230
  are automatically imported by Cortex. Cortex does not have access to any keys, so it cannot export any
231
231
  integration configurations.
232
232
 
233
+
234
+ ---------------------------------------------------------
235
+ Export all services from one tenant; import into another
236
+ ---------------------------------------------------------
237
+
238
+ This example shows how to export services from a tenant named :code:`myTenant-dev` and import those services into a tenant
239
+ named :code:`myTenant`. It is similar to the full export example "`Export from one tenant; import into another`_", but only
240
+ exports/imports services.
241
+
242
+ Your cortex config file will require api keys for both tenants. It would look like this:
243
+
244
+ .. code-block::
245
+
246
+ [myTenant]
247
+ api_key = <your API Key for myTenant>
248
+
249
+ [myTenant-dev]
250
+ api_key = <your API Key for myTenant-dev>
251
+
252
+
253
+ **Option 1: export service YAMLs to a directory and then import them**
254
+
255
+ This option is helpful in case you want to save the entity YAML files. It makes it easy to restart or retry an import
256
+ because you will have all YAMLs saved on disk.
257
+
258
+ **Export**
259
+
260
+ .. code:: bash
261
+
262
+ mkdir -p /tmp/cortex-export
263
+ cd /tmp/cortex-export
264
+ for service in `cortex -t myTenant catalog list -t service | jq -r ".entities[].tag" | sort`
265
+ do
266
+ cortex -t myTenant catalog descriptor -y -t ${service} > ${service}.yaml
267
+ done
268
+
269
+ **Import**
270
+
271
+ .. code:: bash
272
+
273
+ cd /tmp/cortex-export
274
+ for file in `ls -1 *.yaml`
275
+ do
276
+ cortex -t myTenant-dev catalog create -f ${file}
277
+ done
278
+
279
+ **Option 2: combine the export and import in a single command**
280
+
281
+ This option is simpler and doesn't require any disk operations. However, if it fails for any reason you have to run the
282
+ entire export/import in its entirety.
283
+
284
+ .. code:: bash
285
+
286
+ for service in `cortex -t myTenant catalog list -t service | jq -r ".entities[].tag" | sort`
287
+ do
288
+ echo "Processing service: ${service}"
289
+ cortex -t myTenant catalog descriptor -y -t ${service} | cortex -t myTenant-dev catalog create -f-
290
+ done
291
+
292
+ ---------------------------------------------------------
293
+ Export all domains from one tenant; import into another
294
+ ---------------------------------------------------------
295
+
296
+ This example shows how to export domains from a tenant named :code:`myTenant-dev` and import those domains into a tenant
297
+ named :code:`myTenant`. It is similar to the full export example "`Export from one tenant; import into another`_", but only
298
+ exports/imports domains.
299
+
300
+ Your cortex config file will require api keys for both tenants. It would look like this:
301
+
302
+ .. code-block::
303
+
304
+ [myTenant]
305
+ api_key = <your API Key for myTenant>
306
+
307
+ [myTenant-dev]
308
+ api_key = <your API Key for myTenant-dev>
309
+
310
+
311
+ **Option 1: export domain YAMLs to a directory and then import them**
312
+
313
+ This option is helpful in case you want to save the entity YAML files. It makes it easy to restart or retry an import
314
+ because you will have all YAMLs saved on disk.
315
+
316
+ **Export**
317
+
318
+ .. code:: bash
319
+
320
+ mkdir -p /tmp/cortex-export
321
+ cd /tmp/cortex-export
322
+ for domain in `cortex -t myTenant catalog list -t domain | jq -r ".entities[].tag" | sort`
323
+ do
324
+ echo "creating ${domain}.yaml"
325
+ cortex -t myTenant catalog descriptor -y -t ${domain} > ${domain}.yaml
326
+ done
327
+
328
+ **Import**
329
+
330
+ .. code:: bash
331
+
332
+ cd /tmp/cortex-export
333
+ for file in `ls -1 *.yaml`
334
+ do
335
+ cortex -t myTenant-dev catalog create -f ${file}
336
+ done
337
+
338
+ **Option 2: combine the export and import in a single command**
339
+
340
+ This option is simpler and doesn't require any disk operations. However, if it fails for any reason you have to run the
341
+ entire export/import in its entirety.
342
+
343
+ .. code:: bash
344
+
345
+ for domain in `cortex -t myTenant catalog list -t domain | jq -r ".entities[].tag" | sort`
346
+ do
347
+ echo "Processing domain: ${domain}"
348
+ cortex -t myTenant catalog descriptor -y -t ${domain} | cortex -t myTenant-dev catalog create -f-
349
+ done
350
+
351
+
233
352
  ------------------------
234
353
  Iterate over all domains
235
354
  ------------------------
@@ -459,6 +578,37 @@ Run this command for two different scorecards and diff the csv files to compare
459
578
 
460
579
  sdiff -s /tmp/scorecard1.csv /tmp/scorecard2.csv
461
580
 
581
+ -----------------------------------------------------------------------------
582
+ Backup all Workday teams
583
+ -----------------------------------------------------------------------------
584
+
585
+ This recipe is helpful if you change your Workday report and want to save your existing teams in case you want to restore them.
586
+
587
+ For each team it will create two files:
588
+ - a JSON file that contains the Workday data
589
+ - a Cortex team YAML file that refers to the Workday team
590
+
591
+ .. code:: bash
592
+
593
+ for team in `cortex teams list | jq -r '.teams[] | select (.type == "IDP") | select (.idpGroup.provider == "WORKDAY") | .teamTag'`
594
+ do
595
+ cortex teams get -t ${team} > ${team}.json
596
+ cortex catalog descriptor -y -t ${team} > ${team}.yaml
597
+ done
598
+
599
+ -----------------------------------------------------------------------------
600
+ Delete all Workday teams
601
+ -----------------------------------------------------------------------------
602
+
603
+ This recipe is helpful if you want to remove all Workday teams and import from scratch.
604
+
605
+ .. code:: bash
606
+
607
+ for team in `cortex teams list | jq -r '.teams[] | select (.type == "IDP") | select (.idpGroup.provider == "WORKDAY") | .teamTag'`
608
+ do
609
+ cortex teams delete -t ${team}
610
+ done
611
+
462
612
  ====================================
463
613
 
464
614
  .. |PyPI download month| image:: https://img.shields.io/pypi/dm/cortexapps-cli.svg
@@ -106,6 +106,10 @@ def check_config_file(config_file, replace_string):
106
106
  # config file.
107
107
  def get_config(config, args, argv, parser, replace_string):
108
108
  if os.environ.get('CORTEX_API_KEY'):
109
+ if args.tenant:
110
+ if not args.quiet:
111
+ print("WARNING: tenant setting overidden by CORTEX_API_KEY", file=sys.stderr)
112
+
109
113
  cortex_base_url = os.environ.get('CORTEX_BASE_URL', default='https://api.getcortexapp.com')
110
114
  config.update({"url": cortex_base_url})
111
115
  config.update({"api_key": os.environ.get("CORTEX_API_KEY")})
@@ -582,15 +586,37 @@ def exit(r, method, expected_rc=200, err=None):
582
586
  sys.stderr.write("\nCheck your api_key in " + config['config_file'] + ".\n")
583
587
  debug_json(r, method)
584
588
  if err:
589
+ print(f'{method} {r.url} => {r.status_code} {r.reason}')
585
590
  print(err)
586
- sys.exit(r.status_code)
591
+
592
+ if not config.get('is_importing', False) or r.status_code != 409 or r.status_code != 400:
593
+ sys.exit(r.status_code)
587
594
  else:
588
595
  debug_json(r, method)
589
596
  print(r.text)
590
597
 
598
+
591
599
  def api_key(headers):
592
600
  headers.update({"Authorization": "Bearer " + config['api_key']})
593
601
 
602
+
603
+ charset_utf8 = "charset=UTF-8"
604
+
605
+
606
+ def default_headers(content_type='application/json', other={}):
607
+
608
+ if not content_type.endswith(charset_utf8):
609
+ content_type = content_type + ";" + charset_utf8
610
+
611
+ h = {
612
+ 'Content-Type': content_type
613
+ }
614
+
615
+ for k, v in other.items():
616
+ h[k] = v
617
+
618
+ return h
619
+
594
620
  # There might be a more efficient use of the requests library to combine
595
621
  # these methods into a single generic method.
596
622
  def get(url, headers={}):
@@ -838,6 +864,7 @@ def import_from_export(args):
838
864
  scorecard_directory = args.directory + "/scorecards"
839
865
  teams_directory = args.directory + "/teams"
840
866
  resource_definitions_directory = args.directory + "/resource-definitions"
867
+ config.update({"is_importing": True})
841
868
 
842
869
  # Default behavior is to output to terminal, so redirect stdout so it
843
870
  # can be captured as a string.
@@ -950,8 +977,10 @@ def subparser_catalog_create_or_update(subparser):
950
977
  sp.set_defaults(func=catalog_create_or_update)
951
978
 
952
979
  def catalog_create_or_update(args):
953
- headers = { 'Content-Type': 'application/openapi;charset=UTF-8' }
954
- post("/api/v1/open-api" + parse_opts(args), headers, read_file(args))
980
+ post(
981
+ "/api/v1/open-api" + parse_opts(args),
982
+ default_headers('application/openapi'), read_file(args)
983
+ )
955
984
 
956
985
  def subparser_catalog_delete(subparser):
957
986
  sp = subparser.add_parser('delete', help='delete entity')
@@ -1174,8 +1203,7 @@ def subparser_custom_data_add(subparser):
1174
1203
  sp.set_defaults(func=custom_data_add)
1175
1204
 
1176
1205
  def custom_data_add(args):
1177
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
1178
- post("/api/v1/catalog/" + args.tag + "/custom-data", headers, read_file(args))
1206
+ post("/api/v1/catalog/" + args.tag + "/custom-data", default_headers(), read_file(args))
1179
1207
 
1180
1208
  def subparser_custom_data_bulk(subparser):
1181
1209
  sp = subparser.add_parser('bulk', help='Add multiple key/values of custom data to multiple entities')
@@ -1184,8 +1212,7 @@ def subparser_custom_data_bulk(subparser):
1184
1212
  sp.set_defaults(func=custom_data_bulk)
1185
1213
 
1186
1214
  def custom_data_bulk(args):
1187
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
1188
- put("/api/v1/catalog/custom-data", headers, read_file(args))
1215
+ put("/api/v1/catalog/custom-data", default_headers(), read_file(args))
1189
1216
 
1190
1217
  def subparser_custom_data_delete(subparser):
1191
1218
  sp = subparser.add_parser('delete', help='Delete custom data for entity')
@@ -1255,8 +1282,7 @@ def subparser_custom_events_create(subparser):
1255
1282
  sp.set_defaults(func=custom_events_create)
1256
1283
 
1257
1284
  def custom_events_create(args):
1258
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
1259
- post("/api/v1/catalog/" + args.tag + "/custom-events", headers, read_file(args))
1285
+ post("/api/v1/catalog/" + args.tag + "/custom-events", default_headers(), read_file(args))
1260
1286
 
1261
1287
  def subparser_custom_events_delete_all(subparser):
1262
1288
  sp = subparser.add_parser('delete-all', help='Delete all custom events for an entity')
@@ -1304,8 +1330,7 @@ def subparser_custom_events_update_by_uuid(subparser):
1304
1330
  sp.set_defaults(func=custom_events_update_by_uuid)
1305
1331
 
1306
1332
  def custom_events_update_by_uuid(args):
1307
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
1308
- put("/api/v1/catalog/" + args.tag + "/custom-events/" + args.uuid, headers, read_file(args))
1333
+ put("/api/v1/catalog/" + args.tag + "/custom-events/" + args.uuid, default_headers(), read_file(args))
1309
1334
  # Custom Events end
1310
1335
 
1311
1336
  # Groups start
@@ -1323,8 +1348,7 @@ def subparser_groups_add(subparser):
1323
1348
  sp.set_defaults(func=groups_add)
1324
1349
 
1325
1350
  def groups_add(args):
1326
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
1327
- put("/api/v1/catalog/"+ args.tag + "/groups", headers, payload=read_file(args))
1351
+ put("/api/v1/catalog/"+ args.tag + "/groups", default_headers(), payload=read_file(args))
1328
1352
 
1329
1353
  def subparser_groups_delete(subparser):
1330
1354
  sp = subparser.add_parser('delete', help='Delete group from entity')
@@ -1333,7 +1357,7 @@ def subparser_groups_delete(subparser):
1333
1357
  sp.set_defaults(func=groups_delete)
1334
1358
 
1335
1359
  def groups_delete(args):
1336
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
1360
+ headers = default_headers()
1337
1361
  delete("/api/v1/catalog/"+ args.tag + "/groups", headers, read_file(args))
1338
1362
 
1339
1363
  def subparser_groups_get(subparser):
@@ -1381,7 +1405,7 @@ def subparser_dependencies_add(subparser):
1381
1405
  sp.set_defaults(func=dependencies_add)
1382
1406
 
1383
1407
  def dependencies_add(args):
1384
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
1408
+ headers = default_headers()
1385
1409
  post("/api/v1/catalog/" + args.callerTag + "/dependencies/" + args.calleeTag, headers, payload=read_file(args), expected_rc=201)
1386
1410
 
1387
1411
  def subparser_dependencies_add_in_bulk(subparser):
@@ -1412,7 +1436,7 @@ def subparser_dependencies_add_in_bulk(subparser):
1412
1436
  sp.set_defaults(func=dependencies_add_in_bulk)
1413
1437
 
1414
1438
  def dependencies_add_in_bulk(args):
1415
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
1439
+ headers = default_headers()
1416
1440
  put("/api/v1/catalog/dependencies", headers, payload=read_file(args))
1417
1441
 
1418
1442
  def subparser_dependencies_delete(subparser):
@@ -1462,7 +1486,7 @@ def subparser_dependencies_delete_in_bulk(subparser):
1462
1486
  sp.set_defaults(func=dependencies_delete_in_bulk)
1463
1487
 
1464
1488
  def dependencies_delete_in_bulk(args):
1465
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
1489
+ headers = default_headers()
1466
1490
  delete("/api/v1/catalog/dependencies", headers, payload=read_file(args), expected_rc=204)
1467
1491
 
1468
1492
  def subparser_dependencies_get(subparser):
@@ -1496,7 +1520,7 @@ def subparser_dependencies_update(subparser):
1496
1520
  sp.set_defaults(func=dependencies_update)
1497
1521
 
1498
1522
  def dependencies_update(args):
1499
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
1523
+ headers = default_headers()
1500
1524
  put("/api/v1/catalog/" + args.callerTag + "/dependencies/" + args.calleeTag + parse_opts(args), headers, payload=read_file(args))
1501
1525
  # Dependencies end
1502
1526
 
@@ -1520,7 +1544,7 @@ def subparser_deploys_add(subparser):
1520
1544
  sp.set_defaults(func=deploys_add)
1521
1545
 
1522
1546
  def deploys_add(args):
1523
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
1547
+ headers = default_headers()
1524
1548
  post("/api/v1/catalog/" + args.tag + "/deploys", headers, payload=read_file(args))
1525
1549
 
1526
1550
  def subparser_deploys_list(subparser):
@@ -1576,7 +1600,7 @@ def subparser_deploys_update_by_uuid(subparser):
1576
1600
  sp.set_defaults(func=deploys_update_by_uuid)
1577
1601
 
1578
1602
  def deploys_update_by_uuid(args):
1579
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
1603
+ headers = default_headers()
1580
1604
  put("/api/v1/catalog/" + args.tag + "/deploys/" + args.uuid, headers, payload=read_file(args))
1581
1605
  # Deploys end
1582
1606
 
@@ -1666,7 +1690,7 @@ def subparser_docs_update(subparser):
1666
1690
  sp.set_defaults(func=docs_update)
1667
1691
 
1668
1692
  def docs_update(args):
1669
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
1693
+ headers = default_headers()
1670
1694
  put("/api/v1/catalog/" + args.tag + "/documentation/openapi", headers, payload=read_json_from_yaml(args))
1671
1695
  # Docs End
1672
1696
 
@@ -1702,7 +1726,7 @@ def subparser_groups_add(subparser):
1702
1726
  sp.set_defaults(func=groups_add)
1703
1727
 
1704
1728
  def groups_add(args):
1705
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
1729
+ headers = default_headers()
1706
1730
  put("/api/v1/catalog/"+ args.tag + "/groups", headers, payload=read_file(args))
1707
1731
 
1708
1732
  def subparser_groups_delete(subparser):
@@ -1712,7 +1736,7 @@ def subparser_groups_delete(subparser):
1712
1736
  sp.set_defaults(func=groups_delete)
1713
1737
 
1714
1738
  def groups_delete(args):
1715
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
1739
+ headers = default_headers()
1716
1740
  delete("/api/v1/catalog/"+ args.tag + "/groups", headers, read_file(args))
1717
1741
 
1718
1742
  def subparser_groups_get(subparser):
@@ -1816,7 +1840,7 @@ def subparser_integrations_aws_add(subparser):
1816
1840
  sp.set_defaults(func=integrations_aws_add)
1817
1841
 
1818
1842
  def integrations_aws_add(args):
1819
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
1843
+ headers = default_headers()
1820
1844
  payload="{ \"accountId\": \"" + args.accountId + "\", \"role\": \"" + args.role + "\"}"
1821
1845
  post("/api/v1/aws/configurations", headers, payload=payload)
1822
1846
 
@@ -1826,7 +1850,7 @@ def subparser_integrations_aws_update(subparser):
1826
1850
  sp.set_defaults(func=integrations_aws_update)
1827
1851
 
1828
1852
  def integrations_aws_update(args):
1829
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
1853
+ headers = default_headers()
1830
1854
  put("/api/v1/aws/configurations", headers, payload=read_file(args))
1831
1855
 
1832
1856
  def subparser_integrations_aws_delete(subparser):
@@ -1880,7 +1904,7 @@ def subparser_integrations_azure_resources_add(subparser):
1880
1904
  sp.set_defaults(func=integrations_azure_resources_add)
1881
1905
 
1882
1906
  def integrations_azure_resources_add(args):
1883
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
1907
+ headers = default_headers()
1884
1908
  post("/api/v1/azure-resources/configuration", headers, payload=read_file(args))
1885
1909
 
1886
1910
  def subparser_integrations_azure_resources_add_multiple(subparser):
@@ -1907,7 +1931,7 @@ def subparser_integrations_azure_resources_add_multiple(subparser):
1907
1931
  sp.set_defaults(func=integrations_azure_resources_add_multiple)
1908
1932
 
1909
1933
  def integrations_azure_resources_add_multiple(args):
1910
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
1934
+ headers = default_headers()
1911
1935
  post("/api/v1/azure-resources/configurations", headers, payload=read_file(args))
1912
1936
 
1913
1937
  def subparser_integrations_azure_resources_delete(subparser):
@@ -1954,7 +1978,7 @@ def subparser_integrations_azure_resources_update(subparser):
1954
1978
  sp.set_defaults(func=integrations_azure_resources_update)
1955
1979
 
1956
1980
  def integrations_azure_resources_update(args):
1957
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
1981
+ headers = default_headers()
1958
1982
  put("/api/v1/azure-resources/configuration/" + args.alias, headers, payload=read_file(args))
1959
1983
 
1960
1984
  def subparser_integrations_azure_resources_validate(subparser):
@@ -1994,7 +2018,7 @@ def subparser_integrations_coralogix_add(subparser):
1994
2018
  sp.set_defaults(func=integrations_coralogix_add)
1995
2019
 
1996
2020
  def integrations_coralogix_add(args):
1997
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2021
+ headers = default_headers()
1998
2022
  post("/api/v1/coralogix/configuration/", headers, payload=read_file(args))
1999
2023
 
2000
2024
  def subparser_integrations_coralogix_add_multiple(subparser):
@@ -2016,7 +2040,7 @@ def subparser_integrations_coralogix_add_multiple(subparser):
2016
2040
  sp.set_defaults(func=integrations_coralogix_add_multiple)
2017
2041
 
2018
2042
  def integrations_coralogix_add_multiple(args):
2019
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2043
+ headers = default_headers()
2020
2044
  post("/api/v1/coralogix/configurations", headers, payload=read_file(args))
2021
2045
 
2022
2046
  def subparser_integrations_coralogix_delete(subparser):
@@ -2063,7 +2087,7 @@ def subparser_integrations_coralogix_update(subparser):
2063
2087
  sp.set_defaults(func=integrations_coralogix_update)
2064
2088
 
2065
2089
  def integrations_coralogix_update(args):
2066
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2090
+ headers = default_headers()
2067
2091
  put("/api/v1/coralogix/configuration/" + args.alias, headers, payload=read_file(args))
2068
2092
 
2069
2093
  def subparser_integrations_coralogix_validate(subparser):
@@ -2122,7 +2146,7 @@ def subparser_integrations_github_add(subparser):
2122
2146
  sp.set_defaults(func=integrations_github_add)
2123
2147
 
2124
2148
  def integrations_github_add(args):
2125
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2149
+ headers = default_headers()
2126
2150
  post("/api/v1/github/configurations/app", headers, payload=read_file(args))
2127
2151
 
2128
2152
  def subparser_integrations_github_add_personal(subparser):
@@ -2143,7 +2167,7 @@ def subparser_integrations_github_add_personal(subparser):
2143
2167
  sp.set_defaults(func=integrations_github_add_personal)
2144
2168
 
2145
2169
  def integrations_github_add_personal(args):
2146
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2170
+ headers = default_headers()
2147
2171
  post("/api/v1/github/configurations/personal", headers, payload=read_file(args))
2148
2172
 
2149
2173
  def subparser_integrations_github_delete(subparser):
@@ -2214,7 +2238,7 @@ def subparser_integrations_github_update(subparser):
2214
2238
  sp.set_defaults(func=integrations_github_update)
2215
2239
 
2216
2240
  def integrations_github_update(args):
2217
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2241
+ headers = default_headers()
2218
2242
  put("/api/v1/github/configurations/app/" + args.alias, headers, payload=read_file(args))
2219
2243
 
2220
2244
  def subparser_integrations_github_update_personal(subparser):
@@ -2224,7 +2248,7 @@ def subparser_integrations_github_update_personal(subparser):
2224
2248
  sp.set_defaults(func=integrations_github_update_personal)
2225
2249
 
2226
2250
  def integrations_github_update_personal(args):
2227
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2251
+ headers = default_headers()
2228
2252
  put("/api/v1/github/configurations/personal/" + args.alias, headers, payload=read_file(args))
2229
2253
 
2230
2254
  def subparser_integrations_github_validate(subparser):
@@ -2264,7 +2288,7 @@ def subparser_integrations_gitlab_add(subparser):
2264
2288
  sp.set_defaults(func=integrations_gitlab_add)
2265
2289
 
2266
2290
  def integrations_gitlab_add(args):
2267
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2291
+ headers = default_headers()
2268
2292
  post("/api/v1/gitlab/configuration/", headers, payload=read_file(args))
2269
2293
 
2270
2294
  def subparser_integrations_gitlab_add_multiple(subparser):
@@ -2293,7 +2317,7 @@ def subparser_integrations_gitlab_add_multiple(subparser):
2293
2317
  sp.set_defaults(func=integrations_gitlab_add_multiple)
2294
2318
 
2295
2319
  def integrations_gitlab_add_multiple(args):
2296
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2320
+ headers = default_headers()
2297
2321
  post("/api/v1/gitlab/configurations", headers, payload=read_file(args))
2298
2322
 
2299
2323
  def subparser_integrations_gitlab_delete(subparser):
@@ -2340,7 +2364,7 @@ def subparser_integrations_gitlab_update(subparser):
2340
2364
  sp.set_defaults(func=integrations_gitlab_update)
2341
2365
 
2342
2366
  def integrations_gitlab_update(args):
2343
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2367
+ headers = default_headers()
2344
2368
  put("/api/v1/gitlab/configuration/" + args.alias, headers, payload=read_file(args))
2345
2369
 
2346
2370
  def subparser_integrations_gitlab_validate(subparser):
@@ -2378,7 +2402,7 @@ def subparser_integrations_datadog_add(subparser):
2378
2402
  sp.set_defaults(func=integrations_datadog_add)
2379
2403
 
2380
2404
  def integrations_datadog_add(args):
2381
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2405
+ headers = default_headers()
2382
2406
  post("/api/v1/datadog/configuration/", headers, payload=read_file(args))
2383
2407
 
2384
2408
  def subparser_integrations_datadog_add_multiple(subparser):
@@ -2404,7 +2428,7 @@ def subparser_integrations_datadog_add_multiple(subparser):
2404
2428
  sp.set_defaults(func=integrations_datadog_add_multiple)
2405
2429
 
2406
2430
  def integrations_datadog_add_multiple(args):
2407
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2431
+ headers = default_headers()
2408
2432
  post("/api/v1/datadog/configurations", headers, payload=read_file(args))
2409
2433
 
2410
2434
  def subparser_integrations_datadog_delete(subparser):
@@ -2451,7 +2475,7 @@ def subparser_integrations_datadog_update(subparser):
2451
2475
  sp.set_defaults(func=integrations_datadog_update)
2452
2476
 
2453
2477
  def integrations_datadog_update(args):
2454
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2478
+ headers = default_headers()
2455
2479
  put("/api/v1/datadog/configuration/" + args.alias, headers, payload=read_file(args))
2456
2480
 
2457
2481
  def subparser_integrations_datadog_validate(subparser):
@@ -2502,7 +2526,7 @@ def subparser_integrations_incidentio_add(subparser):
2502
2526
  sp.set_defaults(func=integrations_incidentio_add)
2503
2527
 
2504
2528
  def integrations_incidentio_add(args):
2505
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2529
+ headers = default_headers()
2506
2530
  post("/api/v1/incidentio/configuration", headers, payload=read_file(args))
2507
2531
 
2508
2532
  def subparser_integrations_incidentio_add_multiple(subparser):
@@ -2531,7 +2555,7 @@ def subparser_integrations_incidentio_add_multiple(subparser):
2531
2555
  sp.set_defaults(func=integrations_incidentio_add_multiple)
2532
2556
 
2533
2557
  def integrations_incidentio_add_multiple(args):
2534
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2558
+ headers = default_headers()
2535
2559
  post("/api/v1/incidentio/configurations", headers, payload=read_file(args))
2536
2560
 
2537
2561
  def subparser_integrations_incidentio_delete(subparser):
@@ -2578,7 +2602,7 @@ def subparser_integrations_incidentio_update(subparser):
2578
2602
  sp.set_defaults(func=integrations_incidentio_update)
2579
2603
 
2580
2604
  def integrations_incidentio_update(args):
2581
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2605
+ headers = default_headers()
2582
2606
  put("/api/v1/incidentio/configuration/" + args.alias, headers, payload=read_file(args))
2583
2607
 
2584
2608
  def subparser_integrations_incidentio_validate(subparser):
@@ -2618,7 +2642,7 @@ def subparser_integrations_launchdarkly_add(subparser):
2618
2642
  sp.set_defaults(func=integrations_launchdarkly_add)
2619
2643
 
2620
2644
  def integrations_launchdarkly_add(args):
2621
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2645
+ headers = default_headers()
2622
2646
  post("/api/v1/launchdarkly/configuration/", headers, payload=read_file(args))
2623
2647
 
2624
2648
  def subparser_integrations_launchdarkly_add_multiple(subparser):
@@ -2640,7 +2664,7 @@ def subparser_integrations_launchdarkly_add_multiple(subparser):
2640
2664
  sp.set_defaults(func=integrations_launchdarkly_add_multiple)
2641
2665
 
2642
2666
  def integrations_launchdarkly_add_multiple(args):
2643
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2667
+ headers = default_headers()
2644
2668
  post("/api/v1/launchdarkly/configurations", headers, payload=read_file(args))
2645
2669
 
2646
2670
  def subparser_integrations_launchdarkly_delete(subparser):
@@ -2687,7 +2711,7 @@ def subparser_integrations_launchdarkly_update(subparser):
2687
2711
  sp.set_defaults(func=integrations_launchdarkly_update)
2688
2712
 
2689
2713
  def integrations_launchdarkly_update(args):
2690
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2714
+ headers = default_headers()
2691
2715
  put("/api/v1/launchdarkly/configuration/" + args.alias, headers, payload=read_file(args))
2692
2716
 
2693
2717
  def subparser_integrations_launchdarkly_validate(subparser):
@@ -2740,7 +2764,7 @@ def subparser_integrations_newrelic_add(subparser):
2740
2764
  sp.set_defaults(func=integrations_newrelic_add)
2741
2765
 
2742
2766
  def integrations_newrelic_add(args):
2743
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2767
+ headers = default_headers()
2744
2768
  post("/api/v1/newrelic/configuration", headers, payload=read_file(args))
2745
2769
 
2746
2770
  def subparser_integrations_newrelic_add_multiple(subparser):
@@ -2766,7 +2790,7 @@ def subparser_integrations_newrelic_add_multiple(subparser):
2766
2790
  sp.set_defaults(func=integrations_newrelic_add_multiple)
2767
2791
 
2768
2792
  def integrations_newrelic_add_multiple(args):
2769
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2793
+ headers = default_headers()
2770
2794
  post("/api/v1/newrelic/configurations", headers, payload=read_file(args))
2771
2795
 
2772
2796
  def subparser_integrations_newrelic_delete(subparser):
@@ -2813,7 +2837,7 @@ def subparser_integrations_newrelic_update(subparser):
2813
2837
  sp.set_defaults(func=integrations_newrelic_update)
2814
2838
 
2815
2839
  def integrations_newrelic_update(args):
2816
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2840
+ headers = default_headers()
2817
2841
  put("/api/v1/newrelic/configuration/" + args.alias, headers, payload=read_file(args))
2818
2842
 
2819
2843
  def subparser_integrations_newrelic_validate(subparser):
@@ -2851,7 +2875,7 @@ def subparser_integrations_prometheus_add(subparser):
2851
2875
  sp.set_defaults(func=integrations_prometheus_add)
2852
2876
 
2853
2877
  def integrations_prometheus_add(args):
2854
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2878
+ headers = default_headers()
2855
2879
  post("/api/v1/prometheus/configuration/", headers, payload=read_file(args))
2856
2880
 
2857
2881
  def subparser_integrations_prometheus_add_multiple(subparser):
@@ -2874,7 +2898,7 @@ def subparser_integrations_prometheus_add_multiple(subparser):
2874
2898
  sp.set_defaults(func=integrations_prometheus_add_multiple)
2875
2899
 
2876
2900
  def integrations_prometheus_add_multiple(args):
2877
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2901
+ headers = default_headers()
2878
2902
  post("/api/v1/prometheus/configurations", headers, payload=read_file(args))
2879
2903
 
2880
2904
  def subparser_integrations_prometheus_delete(subparser):
@@ -2921,7 +2945,7 @@ def subparser_integrations_prometheus_update(subparser):
2921
2945
  sp.set_defaults(func=integrations_prometheus_update)
2922
2946
 
2923
2947
  def integrations_prometheus_update(args):
2924
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2948
+ headers = default_headers()
2925
2949
  put("/api/v1/prometheus/configuration/" + args.alias, headers, payload=read_file(args))
2926
2950
 
2927
2951
  def subparser_integrations_prometheus_validate(subparser):
@@ -2955,7 +2979,7 @@ def subparser_integrations_pagerduty_add(subparser):
2955
2979
  sp.set_defaults(func=integrations_pagerduty_add)
2956
2980
 
2957
2981
  def integrations_pagerduty_add(args):
2958
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
2982
+ headers = default_headers()
2959
2983
  post("/api/v1/pagerduty/configuration/", headers, payload=read_file(args))
2960
2984
 
2961
2985
  def subparser_integrations_pagerduty_delete(subparser):
@@ -3001,7 +3025,7 @@ def subparser_integrations_sonarqube_add(subparser):
3001
3025
  sp.set_defaults(func=integrations_sonarqube_add)
3002
3026
 
3003
3027
  def integrations_sonarqube_add(args):
3004
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3028
+ headers = default_headers()
3005
3029
  post("/api/v1/sonarqube/configuration/", headers, payload=read_file(args))
3006
3030
 
3007
3031
  def subparser_integrations_sonarqube_add_multiple(subparser):
@@ -3022,7 +3046,7 @@ def subparser_integrations_sonarqube_add_multiple(subparser):
3022
3046
  sp.set_defaults(func=integrations_sonarqube_add_multiple)
3023
3047
 
3024
3048
  def integrations_sonarqube_add_multiple(args):
3025
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3049
+ headers = default_headers()
3026
3050
  post("/api/v1/sonarqube/configurations", headers, payload=read_file(args))
3027
3051
 
3028
3052
  def subparser_integrations_sonarqube_delete(subparser):
@@ -3069,7 +3093,7 @@ def subparser_integrations_sonarqube_update(subparser):
3069
3093
  sp.set_defaults(func=integrations_sonarqube_update)
3070
3094
 
3071
3095
  def integrations_sonarqube_update(args):
3072
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3096
+ headers = default_headers()
3073
3097
  put("/api/v1/sonarqube/configuration/" + args.alias, headers, payload=read_file(args))
3074
3098
 
3075
3099
  def subparser_integrations_sonarqube_validate(subparser):
@@ -3124,7 +3148,7 @@ def subparser_ip_allowlist_replace(subparser):
3124
3148
  sp.set_defaults(func=ip_allowlist_replace)
3125
3149
 
3126
3150
  def ip_allowlist_replace(args):
3127
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3151
+ headers = default_headers()
3128
3152
  put("/api/v1/ip-allowlist", headers, read_file(args))
3129
3153
 
3130
3154
  def subparser_ip_allowlist_validate(subparser):
@@ -3144,10 +3168,10 @@ def subparser_ip_allowlist_validate(subparser):
3144
3168
  }
3145
3169
  '''))
3146
3170
  add_argument_file(sp, 'file containing JSON-formatted content of IP allowlist entries')
3147
- sp.set_defaults(func=ip_allowlist_get)
3171
+ sp.set_defaults(func=ip_allowlist_validate)
3148
3172
 
3149
3173
  def ip_allowlist_validate(args):
3150
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3174
+ headers = default_headers()
3151
3175
  post("/api/v1/ip-allowlist/validate", headers, read_file(args))
3152
3176
  # IP Allowlist end
3153
3177
 
@@ -3213,7 +3237,7 @@ def subparser_packages_upload_go(subparser):
3213
3237
  sp.set_defaults(func=packages_upload_go)
3214
3238
 
3215
3239
  def packages_upload_go(args):
3216
- headers = { 'Content-Type': 'application/text;charset=UTF-8' }
3240
+ headers = default_headers('application/text')
3217
3241
  post("/api/v1/catalog/"+ args.tag + "/packages/go/gosum", headers, read_file(args))
3218
3242
 
3219
3243
  def subparser_packages_delete_go(subparser):
@@ -3239,7 +3263,7 @@ def subparser_packages_upload_java_single(subparser):
3239
3263
  sp.set_defaults(func=packages_upload_java_single)
3240
3264
 
3241
3265
  def packages_upload_java_single(args):
3242
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3266
+ headers = default_headers()
3243
3267
  post("/api/v1/catalog/"+ args.tag + "/packages/java", headers, read_file(args))
3244
3268
 
3245
3269
  def subparser_packages_upload_java_multiple(subparser):
@@ -3249,7 +3273,7 @@ def subparser_packages_upload_java_multiple(subparser):
3249
3273
  sp.set_defaults(func=packages_upload_java_multiple)
3250
3274
 
3251
3275
  def packages_upload_java_multiple(args):
3252
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3276
+ headers = default_headers()
3253
3277
  post("/api/v1/catalog/"+ args.tag + "/packages/java/bulk", headers, read_file(args))
3254
3278
 
3255
3279
  def subparser_packages_delete_java(subparser):
@@ -3275,7 +3299,7 @@ def subparser_packages_upload_python_pipfile(subparser):
3275
3299
  sp.set_defaults(func=packages_upload_python_pipfile)
3276
3300
 
3277
3301
  def packages_upload_python_pipfile(args):
3278
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3302
+ headers = default_headers()
3279
3303
  post("/api/v1/catalog/"+ args.tag + "/packages/python/pipfile", headers, read_file(args))
3280
3304
 
3281
3305
  def subparser_packages_upload_python_requirements(subparser):
@@ -3285,7 +3309,7 @@ def subparser_packages_upload_python_requirements(subparser):
3285
3309
  sp.set_defaults(func=packages_upload_python_requirements)
3286
3310
 
3287
3311
  def packages_upload_python_requirements(args):
3288
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3312
+ headers = default_headers()
3289
3313
  post("/api/v1/catalog/"+ args.tag + "/packages/python/requirements", headers, read_file(args))
3290
3314
 
3291
3315
  def subparser_packages_delete_python(subparser):
@@ -3312,7 +3336,7 @@ def subparser_packages_upload_node_package(subparser):
3312
3336
  sp.set_defaults(func=packages_upload_node_package)
3313
3337
 
3314
3338
  def packages_upload_node_package(args):
3315
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3339
+ headers = default_headers()
3316
3340
  post("/api/v1/catalog/"+ args.tag + "/packages/node/package-json", headers, read_file(args))
3317
3341
 
3318
3342
  def subparser_packages_upload_node_package_lock(subparser):
@@ -3322,7 +3346,7 @@ def subparser_packages_upload_node_package_lock(subparser):
3322
3346
  sp.set_defaults(func=packages_upload_node_package_lock)
3323
3347
 
3324
3348
  def packages_upload_node_package_lock(args):
3325
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3349
+ headers = default_headers()
3326
3350
  post("/api/v1/catalog/"+ args.tag + "/packages/node/package-lock", headers, read_file(args))
3327
3351
 
3328
3352
  def subparser_packages_upload_node_yarn_lock(subparser):
@@ -3332,7 +3356,7 @@ def subparser_packages_upload_node_yarn_lock(subparser):
3332
3356
  sp.set_defaults(func=packages_upload_node_yarn_lock)
3333
3357
 
3334
3358
  def packages_upload_node_yarn_lock(args):
3335
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3359
+ headers = default_headers()
3336
3360
  post("/api/v1/catalog/"+ args.tag + "/packages/node/yarn-lock", headers, read_file(args))
3337
3361
 
3338
3362
  def subparser_packages_delete_node(subparser):
@@ -3358,7 +3382,7 @@ def subparser_packages_upload_nuget_csproj(subparser):
3358
3382
  sp.set_defaults(func=packages_upload_nuget_csproj)
3359
3383
 
3360
3384
  def packages_upload_nuget_csproj(args):
3361
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3385
+ headers = default_headers()
3362
3386
  post("/api/v1/catalog/"+ args.tag + "/packages/dotnet/nuget/csproj", headers, read_file(args))
3363
3387
 
3364
3388
  def subparser_packages_upload_nuget_packages_lock(subparser):
@@ -3368,7 +3392,7 @@ def subparser_packages_upload_nuget_packages_lock(subparser):
3368
3392
  sp.set_defaults(func=packages_upload_nuget_packages_lock)
3369
3393
 
3370
3394
  def packages_upload_nuget_packages_lock(args):
3371
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3395
+ headers = default_headers()
3372
3396
  post("/api/v1/catalog/"+ args.tag + "/packages/dotnet/nuget/packages-lock", headers, read_file(args))
3373
3397
 
3374
3398
  def subparser_packages_delete_nuget(subparser):
@@ -3422,7 +3446,7 @@ def subparser_plugins_create(subparser):
3422
3446
  sp.set_defaults(func=plugins_create)
3423
3447
 
3424
3448
  def plugins_create(args):
3425
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3449
+ headers = default_headers()
3426
3450
  post("/api/v1/plugins", headers, payload=read_file(args))
3427
3451
 
3428
3452
  def subparser_plugins_delete(subparser):
@@ -3479,7 +3503,7 @@ def subparser_plugins_update(subparser):
3479
3503
  sp.set_defaults(func=plugins_update)
3480
3504
 
3481
3505
  def plugins_update(args):
3482
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3506
+ headers = default_headers()
3483
3507
  put("/api/v1/plugins/" + args.tag, headers, payload=read_file(args))
3484
3508
  # Plugins end
3485
3509
 
@@ -3527,7 +3551,7 @@ def subparser_queries_run(subparser):
3527
3551
  sp.set_defaults(func=queries_run)
3528
3552
 
3529
3553
  def queries_run(args):
3530
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3554
+ headers = default_headers()
3531
3555
  if hasattr(args, "wait"):
3532
3556
  query_output = io.StringIO()
3533
3557
  with redirect_stdout(query_output):
@@ -3651,7 +3675,7 @@ def subparser_resource_definitions_create(subparser):
3651
3675
  sp.set_defaults(func=resource_definitions_create)
3652
3676
 
3653
3677
  def resource_definitions_create(args):
3654
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3678
+ headers = default_headers()
3655
3679
  post("/api/v1/catalog/definitions", headers, read_file(args))
3656
3680
 
3657
3681
  def subparser_resource_definitions_list(subparser):
@@ -3685,7 +3709,7 @@ def subparser_resource_definitions_update(subparser):
3685
3709
  sp.set_defaults(func=resource_definitions_update)
3686
3710
 
3687
3711
  def resource_definitions_update(args):
3688
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3712
+ headers = default_headers()
3689
3713
  put("/api/v1/catalog/definitions/" + args.type + parse_opts(args), headers, payload=read_file(args))
3690
3714
  # Resource Definitions end
3691
3715
 
@@ -3709,7 +3733,7 @@ def subparser_scorecards_create_or_update(subparser):
3709
3733
  sp.set_defaults(func=scorecards_create_or_update)
3710
3734
 
3711
3735
  def scorecards_create_or_update(args):
3712
- headers = { 'Content-Type': 'application/yaml;charset=UTF-8' }
3736
+ headers = default_headers('application/yaml')
3713
3737
  post("/api/v1/scorecards/descriptor", headers, read_file(args))
3714
3738
 
3715
3739
  def subparser_scorecards_delete(subparser):
@@ -3806,7 +3830,7 @@ def subparser_teams_hierarchies_create(subparser):
3806
3830
  sp.set_defaults(func=teams_hierarchies_create)
3807
3831
 
3808
3832
  def teams_hierarchies_create(args):
3809
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3833
+ headers = default_headers()
3810
3834
  post("/api/v1/teams/departments", headers, read_file(args))
3811
3835
 
3812
3836
  def subparser_teams_hierarchies_get(subparser):
@@ -3853,7 +3877,7 @@ def subparser_teams_create(subparser):
3853
3877
  sp.set_defaults(func=teams_create)
3854
3878
 
3855
3879
  def teams_create(args):
3856
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3880
+ headers = default_headers()
3857
3881
  post("/api/v1/teams", headers, read_file(args))
3858
3882
 
3859
3883
  def subparser_teams_get(subparser):
@@ -3903,7 +3927,7 @@ def subparser_teams_update_metadata(subparser):
3903
3927
  sp.set_defaults(func=teams_update_metadata)
3904
3928
 
3905
3929
  def teams_update_metadata(args):
3906
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3930
+ headers = default_headers()
3907
3931
  put("/api/v1/teams/" + args.teamTag, headers, read_file(args))
3908
3932
 
3909
3933
  def subparser_teams_update_members(subparser):
@@ -3913,7 +3937,7 @@ def subparser_teams_update_members(subparser):
3913
3937
  sp.set_defaults(func=teams_update_members)
3914
3938
 
3915
3939
  def teams_update_members(args):
3916
- headers = { 'Content-Type': 'application/json;charset=UTF-8' }
3940
+ headers = default_headers()
3917
3941
  post("/api/v1/teams" + parse_opts(args) + "/members", headers, read_file(args))
3918
3942
  # Teams end
3919
3943
 
@@ -3931,6 +3955,7 @@ def cli(argv=sys.argv[1:]):
3931
3955
  parser.add_argument('-c', '--config', help='Config location, default = ~/.cortex/config', default=os.path.expanduser('~') + '/.cortex/config')
3932
3956
  parser.add_argument('-d', '--debug', help='Writes request debug information as JSON to stderr', action='store_true')
3933
3957
  parser.add_argument('-n', '--noObfuscate', help='Do not obfuscate bearer token when debugging', action='store_true')
3958
+ parser.add_argument('-q', '--quiet', help='Suppress warning messages when overriding tenant settings with environment variables', action='store_true')
3934
3959
  parser.add_argument('-t', '--tenant', default='default', help='tenant name defined in ~/.cortex/config, defaults to \'default\'',metavar='')
3935
3960
  parser.add_argument('-v', '--version', action='version', version=version())
3936
3961
  sp = parser.add_subparsers(help='sub-command help')
@@ -1,7 +1,7 @@
1
1
  [tool.poetry]
2
2
  name = "cortexapps-cli"
3
3
  # version will be incremented via command line as part of github actions build
4
- version = "0.24.1"
4
+ version = "0.24.3"
5
5
  description = "Command Line Interface for cortexapps"
6
6
  license = "MIT"
7
7
  authors = [
File without changes