cortexapps-cli 1.16.0__tar.gz → 1.17.0__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.
Files changed (94) hide show
  1. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/PKG-INFO +1 -1
  2. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations.py +101 -0
  3. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/apiiro.py +167 -0
  4. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/argocd.py +171 -0
  5. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/azure_active_directory.py +89 -0
  6. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/bamboohr.py +85 -0
  7. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/bitbucket.py +152 -0
  8. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/bugsnag.py +85 -0
  9. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/buildkite.py +85 -0
  10. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/checkmarx_sast.py +85 -0
  11. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/clickup.py +81 -0
  12. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/codecov.py +81 -0
  13. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/dynatrace.py +85 -0
  14. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/firehydrant.py +81 -0
  15. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/instana.py +85 -0
  16. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/jenkins.py +171 -0
  17. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/jira.py +152 -0
  18. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/mend_sast.py +81 -0
  19. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/mend_sca.py +93 -0
  20. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/okta.py +85 -0
  21. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/opsgenie.py +89 -0
  22. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/rollbar.py +85 -0
  23. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/rootly.py +167 -0
  24. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/semgrep.py +171 -0
  25. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/sentry.py +89 -0
  26. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/servicenow.py +89 -0
  27. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/servicenow_cloud_observability.py +89 -0
  28. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/snyk.py +92 -0
  29. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/splunk_observability_cloud.py +85 -0
  30. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/splunk_on_call.py +89 -0
  31. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/sumologic.py +89 -0
  32. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/veracode.py +89 -0
  33. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/wiz.py +93 -0
  34. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/workday.py +89 -0
  35. cortexapps_cli-1.17.0/cortexapps_cli/commands/integrations_commands/xmatters.py +89 -0
  36. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/pyproject.toml +1 -1
  37. cortexapps_cli-1.16.0/cortexapps_cli/commands/integrations.py +0 -35
  38. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/LICENSE +0 -0
  39. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/README.rst +0 -0
  40. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/__init__.py +0 -0
  41. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/cli.py +0 -0
  42. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/command_options.py +0 -0
  43. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/api_keys.py +0 -0
  44. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/audit_logs.py +0 -0
  45. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/backup.py +0 -0
  46. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/backup_commands/cortex_export.py +0 -0
  47. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/catalog.py +0 -0
  48. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/custom_data.py +0 -0
  49. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/custom_events.py +0 -0
  50. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/custom_metrics.py +0 -0
  51. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/dependencies.py +0 -0
  52. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/deploys.py +0 -0
  53. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/discovery_audit.py +0 -0
  54. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/docs.py +0 -0
  55. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/entity_relationship_types.py +0 -0
  56. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/entity_relationships.py +0 -0
  57. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/entity_types.py +0 -0
  58. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/gitops_logs.py +0 -0
  59. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/groups.py +0 -0
  60. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/initiatives.py +0 -0
  61. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/integrations_commands/aws.py +0 -0
  62. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/integrations_commands/azure_devops.py +0 -0
  63. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/integrations_commands/azure_resources.py +0 -0
  64. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/integrations_commands/circleci.py +0 -0
  65. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/integrations_commands/coralogix.py +0 -0
  66. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/integrations_commands/datadog.py +0 -0
  67. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/integrations_commands/github.py +0 -0
  68. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/integrations_commands/gitlab.py +0 -0
  69. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/integrations_commands/incidentio.py +0 -0
  70. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/integrations_commands/launchdarkly.py +0 -0
  71. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/integrations_commands/newrelic.py +0 -0
  72. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/integrations_commands/pagerduty.py +0 -0
  73. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/integrations_commands/prometheus.py +0 -0
  74. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/integrations_commands/sonarqube.py +0 -0
  75. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/ip_allowlist.py +0 -0
  76. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/on_call.py +0 -0
  77. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/packages.py +0 -0
  78. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/packages_commands/go.py +0 -0
  79. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/packages_commands/java.py +0 -0
  80. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/packages_commands/node.py +0 -0
  81. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/packages_commands/nuget.py +0 -0
  82. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/packages_commands/python.py +0 -0
  83. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/plugins.py +0 -0
  84. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/queries.py +0 -0
  85. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/rest.py +0 -0
  86. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/scim.py +0 -0
  87. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/scorecards.py +0 -0
  88. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/scorecards_commands/exemptions.py +0 -0
  89. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/secrets.py +0 -0
  90. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/teams.py +0 -0
  91. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/commands/workflows.py +0 -0
  92. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/cortex_client.py +0 -0
  93. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/models/team.py +0 -0
  94. {cortexapps_cli-1.16.0 → cortexapps_cli-1.17.0}/cortexapps_cli/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cortexapps-cli
3
- Version: 1.16.0
3
+ Version: 1.17.0
4
4
  Summary: Command Line Interface for cortexapps
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -0,0 +1,101 @@
1
+ import json
2
+ from rich import print_json
3
+ import typer
4
+ from typing_extensions import Annotated
5
+
6
+ import cortexapps_cli.commands.integrations_commands.apiiro as apiiro
7
+ import cortexapps_cli.commands.integrations_commands.argocd as argocd
8
+ import cortexapps_cli.commands.integrations_commands.aws as aws
9
+ import cortexapps_cli.commands.integrations_commands.azure_active_directory as azure_active_directory
10
+ import cortexapps_cli.commands.integrations_commands.azure_resources as azure_resources
11
+ import cortexapps_cli.commands.integrations_commands.azure_devops as azure_devops
12
+ import cortexapps_cli.commands.integrations_commands.bamboohr as bamboohr
13
+ import cortexapps_cli.commands.integrations_commands.bitbucket as bitbucket
14
+ import cortexapps_cli.commands.integrations_commands.bugsnag as bugsnag
15
+ import cortexapps_cli.commands.integrations_commands.buildkite as buildkite
16
+ import cortexapps_cli.commands.integrations_commands.checkmarx_sast as checkmarx_sast
17
+ import cortexapps_cli.commands.integrations_commands.circleci as circleci
18
+ import cortexapps_cli.commands.integrations_commands.clickup as clickup
19
+ import cortexapps_cli.commands.integrations_commands.codecov as codecov
20
+ import cortexapps_cli.commands.integrations_commands.coralogix as coralogix
21
+ import cortexapps_cli.commands.integrations_commands.datadog as datadog
22
+ import cortexapps_cli.commands.integrations_commands.dynatrace as dynatrace
23
+ import cortexapps_cli.commands.integrations_commands.firehydrant as firehydrant
24
+ import cortexapps_cli.commands.integrations_commands.github as github
25
+ import cortexapps_cli.commands.integrations_commands.gitlab as gitlab
26
+ import cortexapps_cli.commands.integrations_commands.incidentio as incidentio
27
+ import cortexapps_cli.commands.integrations_commands.instana as instana
28
+ import cortexapps_cli.commands.integrations_commands.jenkins as jenkins
29
+ import cortexapps_cli.commands.integrations_commands.jira as jira
30
+ import cortexapps_cli.commands.integrations_commands.launchdarkly as launchdarkly
31
+ import cortexapps_cli.commands.integrations_commands.mend_sast as mend_sast
32
+ import cortexapps_cli.commands.integrations_commands.mend_sca as mend_sca
33
+ import cortexapps_cli.commands.integrations_commands.newrelic as newrelic
34
+ import cortexapps_cli.commands.integrations_commands.okta as okta
35
+ import cortexapps_cli.commands.integrations_commands.opsgenie as opsgenie
36
+ import cortexapps_cli.commands.integrations_commands.pagerduty as pagerduty
37
+ import cortexapps_cli.commands.integrations_commands.prometheus as prometheus
38
+ import cortexapps_cli.commands.integrations_commands.rollbar as rollbar
39
+ import cortexapps_cli.commands.integrations_commands.rootly as rootly
40
+ import cortexapps_cli.commands.integrations_commands.semgrep as semgrep
41
+ import cortexapps_cli.commands.integrations_commands.sentry as sentry
42
+ import cortexapps_cli.commands.integrations_commands.servicenow as servicenow
43
+ import cortexapps_cli.commands.integrations_commands.servicenow_cloud_observability as servicenow_cloud_observability
44
+ import cortexapps_cli.commands.integrations_commands.snyk as snyk
45
+ import cortexapps_cli.commands.integrations_commands.sonarqube as sonarqube
46
+ import cortexapps_cli.commands.integrations_commands.splunk_observability_cloud as splunk_observability_cloud
47
+ import cortexapps_cli.commands.integrations_commands.splunk_on_call as splunk_on_call
48
+ import cortexapps_cli.commands.integrations_commands.sumologic as sumologic
49
+ import cortexapps_cli.commands.integrations_commands.veracode as veracode
50
+ import cortexapps_cli.commands.integrations_commands.wiz as wiz
51
+ import cortexapps_cli.commands.integrations_commands.workday as workday
52
+ import cortexapps_cli.commands.integrations_commands.xmatters as xmatters
53
+
54
+ app = typer.Typer(help="Integrations commands", no_args_is_help=True)
55
+ app.add_typer(apiiro.app, name="apiiro")
56
+ app.add_typer(argocd.app, name="argocd")
57
+ app.add_typer(aws.app, name="aws")
58
+ app.add_typer(azure_active_directory.app, name="azure-active-directory")
59
+ app.add_typer(azure_resources.app, name="azure-resources")
60
+ app.add_typer(azure_devops.app, name="azure-devops")
61
+ app.add_typer(bamboohr.app, name="bamboohr")
62
+ app.add_typer(bitbucket.app, name="bitbucket")
63
+ app.add_typer(bugsnag.app, name="bugsnag")
64
+ app.add_typer(buildkite.app, name="buildkite")
65
+ app.add_typer(checkmarx_sast.app, name="checkmarx-sast")
66
+ app.add_typer(circleci.app, name="circleci")
67
+ app.add_typer(clickup.app, name="clickup")
68
+ app.add_typer(codecov.app, name="codecov")
69
+ app.add_typer(coralogix.app, name="coralogix")
70
+ app.add_typer(datadog.app, name="datadog")
71
+ app.add_typer(dynatrace.app, name="dynatrace")
72
+ app.add_typer(firehydrant.app, name="firehydrant")
73
+ app.add_typer(github.app, name="github")
74
+ app.add_typer(gitlab.app, name="gitlab")
75
+ app.add_typer(incidentio.app, name="incidentio")
76
+ app.add_typer(instana.app, name="instana")
77
+ app.add_typer(jenkins.app, name="jenkins")
78
+ app.add_typer(jira.app, name="jira")
79
+ app.add_typer(launchdarkly.app, name="launchdarkly")
80
+ app.add_typer(mend_sast.app, name="mend-sast")
81
+ app.add_typer(mend_sca.app, name="mend-sca")
82
+ app.add_typer(newrelic.app, name="newrelic")
83
+ app.add_typer(okta.app, name="okta")
84
+ app.add_typer(opsgenie.app, name="opsgenie")
85
+ app.add_typer(pagerduty.app, name="pagerduty")
86
+ app.add_typer(prometheus.app, name="prometheus")
87
+ app.add_typer(rollbar.app, name="rollbar")
88
+ app.add_typer(rootly.app, name="rootly")
89
+ app.add_typer(semgrep.app, name="semgrep")
90
+ app.add_typer(sentry.app, name="sentry")
91
+ app.add_typer(servicenow.app, name="servicenow")
92
+ app.add_typer(servicenow_cloud_observability.app, name="servicenow-cloud-observability")
93
+ app.add_typer(snyk.app, name="snyk")
94
+ app.add_typer(sonarqube.app, name="sonarqube")
95
+ app.add_typer(splunk_observability_cloud.app, name="splunk-observability-cloud")
96
+ app.add_typer(splunk_on_call.app, name="splunk-on-call")
97
+ app.add_typer(sumologic.app, name="sumo-logic")
98
+ app.add_typer(veracode.app, name="veracode")
99
+ app.add_typer(wiz.app, name="wiz")
100
+ app.add_typer(workday.app, name="workday")
101
+ app.add_typer(xmatters.app, name="xmatters")
@@ -0,0 +1,167 @@
1
+ import json
2
+ from rich import print_json
3
+ import typer
4
+ from typing_extensions import Annotated
5
+
6
+ app = typer.Typer(help="Apiiro commands", no_args_is_help=True)
7
+
8
+ @app.command()
9
+ def add(
10
+ ctx: typer.Context,
11
+ alias: str = typer.Option(..., "--alias", "-a", help="Alias for this configuration"),
12
+ api_key: str = typer.Option(..., "--api-key", "-api", help="API key"),
13
+ is_default: bool = typer.Option(False, "--is-default", "-i", help="If this is the default configuration"),
14
+ file_input: Annotated[typer.FileText, typer.Option("--file", "-f", help="JSON file containing configurations, if command line options not used; can be passed as stdin with -, example: -f-")] = None,
15
+ ):
16
+ """
17
+ Add a single configuration
18
+ """
19
+
20
+ client = ctx.obj["client"]
21
+
22
+ if file_input:
23
+ if alias or api_key or is_default:
24
+ raise typer.BadParameter("When providing a configuration file, do not specify any other attributes")
25
+ data = json.loads("".join([line for line in file_input]))
26
+ else:
27
+ data = {
28
+ "alias": alias,
29
+ "apiKey": api_key,
30
+ "isDefault": is_default,
31
+ }
32
+
33
+ # remove any data elements that are None
34
+ data = {k: v for k, v in data.items() if v is not None}
35
+
36
+ r = client.post("api/v1/apiiro/configuration", data=data)
37
+ print_json(data=r)
38
+
39
+ @app.command()
40
+ def add_multiple(
41
+ ctx: typer.Context,
42
+ file_input: Annotated[typer.FileText, typer.Option("--file", "-f", help="JSON file containing configurations; can be passed as stdin with -, example: -f-")] = None,
43
+ ):
44
+ """
45
+ Add multiple configurations
46
+ """
47
+
48
+ client = ctx.obj["client"]
49
+
50
+ data = json.loads("".join([line for line in file_input]))
51
+
52
+ r = client.put("api/v1/apiiro/configurations", data=data)
53
+ print_json(data=r)
54
+
55
+ @app.command()
56
+ def delete(
57
+ ctx: typer.Context,
58
+ alias: str = typer.Option(..., "--alias", "-a", help="The alias of the configuration"),
59
+ ):
60
+ """
61
+ Delete a configuration
62
+ """
63
+
64
+ client = ctx.obj["client"]
65
+
66
+ r = client.delete("api/v1/apiiro/configuration/" + alias)
67
+ print_json(data=r)
68
+
69
+ @app.command()
70
+ def delete_all(
71
+ ctx: typer.Context,
72
+ ):
73
+ """
74
+ Delete all configurations
75
+ """
76
+
77
+ client = ctx.obj["client"]
78
+
79
+ r = client.delete("api/v1/apiiro/configurations")
80
+ print_json(data=r)
81
+
82
+ @app.command()
83
+ def get(
84
+ ctx: typer.Context,
85
+ alias: str = typer.Option(..., "--alias", "-a", help="The alias of the configuration"),
86
+ ):
87
+ """
88
+ Get a configuration
89
+ """
90
+
91
+ client = ctx.obj["client"]
92
+
93
+ r = client.get("api/v1/apiiro/configuration/" + alias)
94
+ print_json(data=r)
95
+
96
+ @app.command()
97
+ def list(
98
+ ctx: typer.Context,
99
+ ):
100
+ """
101
+ Get all configurations
102
+ """
103
+
104
+ client = ctx.obj["client"]
105
+
106
+ r = client.get("api/v1/apiiro/configurations")
107
+ print_json(data=r)
108
+
109
+ @app.command()
110
+ def get_default(
111
+ ctx: typer.Context,
112
+ ):
113
+ """
114
+ Get default configuration
115
+ """
116
+
117
+ client = ctx.obj["client"]
118
+
119
+ r = client.get("api/v1/apiiro/default-configuration")
120
+ print_json(data=r)
121
+
122
+ @app.command()
123
+ def update(
124
+ ctx: typer.Context,
125
+ alias: str = typer.Option(..., "--alias", "-a", help="The alias of the configuration"),
126
+ is_default: bool = typer.Option(False, "--is-default", "-i", help="If this is the default configuration"),
127
+ ):
128
+ """
129
+ Update a configuration
130
+ """
131
+
132
+ client = ctx.obj["client"]
133
+
134
+ data = {
135
+ "alias": alias,
136
+ "isDefault": is_default
137
+ }
138
+
139
+ r = client.put("api/v1/apiiro/configuration/" + alias, data=data)
140
+ print_json(data=r)
141
+
142
+ @app.command()
143
+ def validate(
144
+ ctx: typer.Context,
145
+ alias: str = typer.Option(..., "--alias", "-a", help="The alias of the configuration"),
146
+ ):
147
+ """
148
+ Validate a configuration
149
+ """
150
+
151
+ client = ctx.obj["client"]
152
+
153
+ r = client.post("api/v1/apiiro/configuration/validate/" + alias)
154
+ print_json(data=r)
155
+
156
+ @app.command()
157
+ def validate_all(
158
+ ctx: typer.Context,
159
+ ):
160
+ """
161
+ Validate all configurations
162
+ """
163
+
164
+ client = ctx.obj["client"]
165
+
166
+ r = client.post("api/v1/apiiro/configuration/validate")
167
+ print_json(data=r)
@@ -0,0 +1,171 @@
1
+ import json
2
+ from rich import print_json
3
+ import typer
4
+ from typing_extensions import Annotated
5
+
6
+ app = typer.Typer(help="ArgoCD commands", no_args_is_help=True)
7
+
8
+ @app.command()
9
+ def add(
10
+ ctx: typer.Context,
11
+ alias: str = typer.Option(..., "--alias", "-a", help="Alias for this configuration"),
12
+ host: str = typer.Option(..., "--host", "-h", help="Host name"),
13
+ is_default: bool = typer.Option(False, "--is-default", "-i", help="If this is the default configuration"),
14
+ password: str = typer.Option(..., "--password", "-p", help="Password"),
15
+ username: str = typer.Option(..., "--username", "-u", help="Username"),
16
+ file_input: Annotated[typer.FileText, typer.Option("--file", "-f", help="JSON file containing configurations, if command line options not used; can be passed as stdin with -, example: -f-")] = None,
17
+ ):
18
+ """
19
+ Add a single configuration
20
+ """
21
+
22
+ client = ctx.obj["client"]
23
+
24
+ if file_input:
25
+ if alias or host or is_default or password or username:
26
+ raise typer.BadParameter("When providing a configuration file, do not specify any other attributes")
27
+ data = json.loads("".join([line for line in file_input]))
28
+ else:
29
+ data = {
30
+ "alias": alias,
31
+ "host": host,
32
+ "isDefault": is_default,
33
+ "password": password,
34
+ "username": username,
35
+ }
36
+
37
+ # remove any data elements that are None
38
+ data = {k: v for k, v in data.items() if v is not None}
39
+
40
+ r = client.post("api/v1/argocd/configuration", data=data)
41
+ print_json(data=r)
42
+
43
+ @app.command()
44
+ def add_multiple(
45
+ ctx: typer.Context,
46
+ file_input: Annotated[typer.FileText, typer.Option("--file", "-f", help="JSON file containing configurations; can be passed as stdin with -, example: -f-")] = None,
47
+ ):
48
+ """
49
+ Add multiple configurations
50
+ """
51
+
52
+ client = ctx.obj["client"]
53
+
54
+ data = json.loads("".join([line for line in file_input]))
55
+
56
+ r = client.put("api/v1/argocd/configurations", data=data)
57
+ print_json(data=r)
58
+
59
+ @app.command()
60
+ def delete(
61
+ ctx: typer.Context,
62
+ alias: str = typer.Option(..., "--alias", "-a", help="The alias of the configuration"),
63
+ ):
64
+ """
65
+ Delete a configuration
66
+ """
67
+
68
+ client = ctx.obj["client"]
69
+
70
+ r = client.delete("api/v1/argocd/configuration/" + alias)
71
+ print_json(data=r)
72
+
73
+ @app.command()
74
+ def delete_all(
75
+ ctx: typer.Context,
76
+ ):
77
+ """
78
+ Delete all configurations
79
+ """
80
+
81
+ client = ctx.obj["client"]
82
+
83
+ r = client.delete("api/v1/argocd/configurations")
84
+ print_json(data=r)
85
+
86
+ @app.command()
87
+ def get(
88
+ ctx: typer.Context,
89
+ alias: str = typer.Option(..., "--alias", "-a", help="The alias of the configuration"),
90
+ ):
91
+ """
92
+ Get a configuration
93
+ """
94
+
95
+ client = ctx.obj["client"]
96
+
97
+ r = client.get("api/v1/argocd/configuration/" + alias)
98
+ print_json(data=r)
99
+
100
+ @app.command()
101
+ def list(
102
+ ctx: typer.Context,
103
+ ):
104
+ """
105
+ Get all configurations
106
+ """
107
+
108
+ client = ctx.obj["client"]
109
+
110
+ r = client.get("api/v1/argocd/configurations")
111
+ print_json(data=r)
112
+
113
+ @app.command()
114
+ def get_default(
115
+ ctx: typer.Context,
116
+ ):
117
+ """
118
+ Get default configuration
119
+ """
120
+
121
+ client = ctx.obj["client"]
122
+
123
+ r = client.get("api/v1/argocd/default-configuration")
124
+ print_json(data=r)
125
+
126
+ @app.command()
127
+ def update(
128
+ ctx: typer.Context,
129
+ alias: str = typer.Option(..., "--alias", "-a", help="The alias of the configuration"),
130
+ is_default: bool = typer.Option(False, "--is-default", "-i", help="If this is the default configuration"),
131
+ ):
132
+ """
133
+ Update a configuration
134
+ """
135
+
136
+ client = ctx.obj["client"]
137
+
138
+ data = {
139
+ "alias": alias,
140
+ "isDefault": is_default
141
+ }
142
+
143
+ r = client.put("api/v1/argocd/configuration/" + alias, data=data)
144
+ print_json(data=r)
145
+
146
+ @app.command()
147
+ def validate(
148
+ ctx: typer.Context,
149
+ alias: str = typer.Option(..., "--alias", "-a", help="The alias of the configuration"),
150
+ ):
151
+ """
152
+ Validate a configuration
153
+ """
154
+
155
+ client = ctx.obj["client"]
156
+
157
+ r = client.post("api/v1/argocd/configuration/validate/" + alias)
158
+ print_json(data=r)
159
+
160
+ @app.command()
161
+ def validate_all(
162
+ ctx: typer.Context,
163
+ ):
164
+ """
165
+ Validate all configurations
166
+ """
167
+
168
+ client = ctx.obj["client"]
169
+
170
+ r = client.post("api/v1/argocd/configuration/validate")
171
+ print_json(data=r)
@@ -0,0 +1,89 @@
1
+ import json
2
+ from rich import print_json
3
+ import typer
4
+ from typing_extensions import Annotated
5
+
6
+ app = typer.Typer(help="Azure Active Directory commands", no_args_is_help=True)
7
+
8
+ @app.command()
9
+ def add(
10
+ ctx: typer.Context,
11
+ client_id: str = typer.Option(None, "--client-id", "-ci", help="Client ID"),
12
+ client_secret: str = typer.Option(None, "--client-secret", "-cs", help="Client secret"),
13
+ tenant_id: str = typer.Option(None, "--tenant-id", "-ti", help="Tenant ID"),
14
+ file_input: Annotated[typer.FileText, typer.Option("--file", "-f", help="JSON file containing configuration, if command line options not used; can be passed as stdin with -, example: -f-")] = None,
15
+ ):
16
+ """
17
+ Add a configuration
18
+ """
19
+ client = ctx.obj["client"]
20
+
21
+ if file_input:
22
+ if client_id or client_secret or tenant_id:
23
+ raise typer.BadParameter("When providing a configuration file, do not specify any other attributes")
24
+ data = json.loads("".join([line for line in file_input]))
25
+ else:
26
+ data = {
27
+ "clientId": client_id,
28
+ "clientSecret": client_secret,
29
+ "tenantId": tenant_id,
30
+ }
31
+ data = {k: v for k, v in data.items() if v is not None}
32
+
33
+ r = client.post("api/v1/active-directory/configuration", data=data)
34
+ print_json(data=r)
35
+
36
+ @app.command()
37
+ def get(ctx: typer.Context):
38
+ """
39
+ Get the configuration
40
+ """
41
+ client = ctx.obj["client"]
42
+ r = client.get("api/v1/active-directory/default-configuration")
43
+ print_json(data=r)
44
+
45
+ @app.command()
46
+ def update(
47
+ ctx: typer.Context,
48
+ client_id: str = typer.Option(None, "--client-id", "-ci", help="Client ID"),
49
+ client_secret: str = typer.Option(None, "--client-secret", "-cs", help="Client secret"),
50
+ tenant_id: str = typer.Option(None, "--tenant-id", "-ti", help="Tenant ID"),
51
+ file_input: Annotated[typer.FileText, typer.Option("--file", "-f", help="JSON file containing configuration, if command line options not used; can be passed as stdin with -, example: -f-")] = None,
52
+ ):
53
+ """
54
+ Update the configuration
55
+ """
56
+ client = ctx.obj["client"]
57
+
58
+ if file_input:
59
+ if client_id or client_secret or tenant_id:
60
+ raise typer.BadParameter("When providing a configuration file, do not specify any other attributes")
61
+ data = json.loads("".join([line for line in file_input]))
62
+ else:
63
+ data = {
64
+ "clientId": client_id,
65
+ "clientSecret": client_secret,
66
+ "tenantId": tenant_id,
67
+ }
68
+ data = {k: v for k, v in data.items() if v is not None}
69
+
70
+ r = client.put("api/v1/active-directory/configuration", data=data)
71
+ print_json(data=r)
72
+
73
+ @app.command()
74
+ def validate(ctx: typer.Context):
75
+ """
76
+ Validate the configuration
77
+ """
78
+ client = ctx.obj["client"]
79
+ r = client.post("api/v1/active-directory/configuration/validate")
80
+ print_json(data=r)
81
+
82
+ @app.command()
83
+ def delete(ctx: typer.Context):
84
+ """
85
+ Delete the configuration
86
+ """
87
+ client = ctx.obj["client"]
88
+ r = client.delete("api/v1/active-directory/configurations")
89
+ print_json(data=r)
@@ -0,0 +1,85 @@
1
+ import json
2
+ from rich import print_json
3
+ import typer
4
+ from typing_extensions import Annotated
5
+
6
+ app = typer.Typer(help="BambooHR commands", no_args_is_help=True)
7
+
8
+ @app.command()
9
+ def add(
10
+ ctx: typer.Context,
11
+ api_token: str = typer.Option(None, "--api-token", "-at", help="API token"),
12
+ subdomain: str = typer.Option(None, "--subdomain", "-s", help="Subdomain"),
13
+ file_input: Annotated[typer.FileText, typer.Option("--file", "-f", help="JSON file containing configuration, if command line options not used; can be passed as stdin with -, example: -f-")] = None,
14
+ ):
15
+ """
16
+ Add a configuration
17
+ """
18
+ client = ctx.obj["client"]
19
+
20
+ if file_input:
21
+ if api_token or subdomain:
22
+ raise typer.BadParameter("When providing a configuration file, do not specify any other attributes")
23
+ data = json.loads("".join([line for line in file_input]))
24
+ else:
25
+ data = {
26
+ "apiToken": api_token,
27
+ "subdomain": subdomain,
28
+ }
29
+ data = {k: v for k, v in data.items() if v is not None}
30
+
31
+ r = client.post("api/v1/bamboohr/configuration", data=data)
32
+ print_json(data=r)
33
+
34
+ @app.command()
35
+ def get(ctx: typer.Context):
36
+ """
37
+ Get the configuration
38
+ """
39
+ client = ctx.obj["client"]
40
+ r = client.get("api/v1/bamboohr/default-configuration")
41
+ print_json(data=r)
42
+
43
+ @app.command()
44
+ def update(
45
+ ctx: typer.Context,
46
+ api_token: str = typer.Option(None, "--api-token", "-at", help="API token"),
47
+ subdomain: str = typer.Option(None, "--subdomain", "-s", help="Subdomain"),
48
+ file_input: Annotated[typer.FileText, typer.Option("--file", "-f", help="JSON file containing configuration, if command line options not used; can be passed as stdin with -, example: -f-")] = None,
49
+ ):
50
+ """
51
+ Update the configuration
52
+ """
53
+ client = ctx.obj["client"]
54
+
55
+ if file_input:
56
+ if api_token or subdomain:
57
+ raise typer.BadParameter("When providing a configuration file, do not specify any other attributes")
58
+ data = json.loads("".join([line for line in file_input]))
59
+ else:
60
+ data = {
61
+ "apiToken": api_token,
62
+ "subdomain": subdomain,
63
+ }
64
+ data = {k: v for k, v in data.items() if v is not None}
65
+
66
+ r = client.put("api/v1/bamboohr/configuration", data=data)
67
+ print_json(data=r)
68
+
69
+ @app.command()
70
+ def validate(ctx: typer.Context):
71
+ """
72
+ Validate the configuration
73
+ """
74
+ client = ctx.obj["client"]
75
+ r = client.post("api/v1/bamboohr/configuration/validate")
76
+ print_json(data=r)
77
+
78
+ @app.command()
79
+ def delete(ctx: typer.Context):
80
+ """
81
+ Delete the configuration
82
+ """
83
+ client = ctx.obj["client"]
84
+ r = client.delete("api/v1/bamboohr/configurations")
85
+ print_json(data=r)