cortexapps-cli 1.0.2__tar.gz → 1.0.4__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 (56) hide show
  1. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/PKG-INFO +15 -1
  2. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/README.rst +14 -0
  3. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/github.py +20 -21
  4. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/prometheus.py +15 -9
  5. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/pyproject.toml +1 -1
  6. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/LICENSE +0 -0
  7. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/cli.py +0 -0
  8. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/command_options.py +0 -0
  9. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/api_keys.py +0 -0
  10. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/audit_logs.py +0 -0
  11. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/backup.py +0 -0
  12. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/backup_commands/cortex_export.py +0 -0
  13. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/catalog.py +0 -0
  14. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/custom_data.py +0 -0
  15. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/custom_events.py +0 -0
  16. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/custom_metrics.py +0 -0
  17. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/dependencies.py +0 -0
  18. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/deploys.py +0 -0
  19. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/discovery_audit.py +0 -0
  20. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/docs.py +0 -0
  21. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/entity_types.py +0 -0
  22. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/gitops_logs.py +0 -0
  23. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/groups.py +0 -0
  24. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/initiatives.py +0 -0
  25. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations.py +0 -0
  26. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/aws.py +0 -0
  27. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/azure_devops.py +0 -0
  28. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/azure_resources.py +0 -0
  29. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/circleci.py +0 -0
  30. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/coralogix.py +0 -0
  31. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/datadog.py +0 -0
  32. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/gitlab.py +0 -0
  33. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/incidentio.py +0 -0
  34. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/launchdarkly.py +0 -0
  35. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/newrelic.py +0 -0
  36. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/pagerduty.py +0 -0
  37. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/sonarqube.py +0 -0
  38. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/ip_allowlist.py +0 -0
  39. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/on_call.py +0 -0
  40. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages.py +0 -0
  41. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages_commands/go.py +0 -0
  42. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages_commands/java.py +0 -0
  43. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages_commands/node.py +0 -0
  44. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages_commands/nuget.py +0 -0
  45. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages_commands/python.py +0 -0
  46. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/plugins.py +0 -0
  47. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/queries.py +0 -0
  48. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/rest.py +0 -0
  49. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/scim.py +0 -0
  50. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/scorecards.py +0 -0
  51. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/scorecards_commands/exemptions.py +0 -0
  52. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/teams.py +0 -0
  53. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/workflows.py +0 -0
  54. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/cortex_client.py +0 -0
  55. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/models/team.py +0 -0
  56. {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: cortexapps-cli
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: Command Line Interface for cortexapps
5
5
  License: MIT
6
6
  Author: Cortex Apps
@@ -464,6 +464,20 @@ This recipe does the following:
464
464
  cortex catalog descriptor -y -t ${entity} | yq "with(.info.x-cortex-owners[]; select(.type | downcase == \"group\") | select(.provider == null) | .provider = \"${provider}\" )" | cortex catalog create -f-
465
465
  done
466
466
 
467
+ -----------------------------------------------------------------------------
468
+ Export all workflows
469
+ -----------------------------------------------------------------------------
470
+
471
+ This recipe creates YAML files for each Workflow. This may be helpful if you are considering enabling GitOps for Workflows and you want to export current Workflows as a starting point.
472
+
473
+ .. code:: bash
474
+
475
+ for workflow in `cortex workflows list --csv --no-headers --columns tag`
476
+ do
477
+ echo "workflow = $workflow"
478
+ cortex workflows get --tag $workflow --yaml > $workflow.yaml
479
+ done
480
+
467
481
  -----------------------------------------------------------------------------
468
482
  Obfuscating a Cortex export
469
483
  -----------------------------------------------------------------------------
@@ -439,6 +439,20 @@ This recipe does the following:
439
439
  cortex catalog descriptor -y -t ${entity} | yq "with(.info.x-cortex-owners[]; select(.type | downcase == \"group\") | select(.provider == null) | .provider = \"${provider}\" )" | cortex catalog create -f-
440
440
  done
441
441
 
442
+ -----------------------------------------------------------------------------
443
+ Export all workflows
444
+ -----------------------------------------------------------------------------
445
+
446
+ This recipe creates YAML files for each Workflow. This may be helpful if you are considering enabling GitOps for Workflows and you want to export current Workflows as a starting point.
447
+
448
+ .. code:: bash
449
+
450
+ for workflow in `cortex workflows list --csv --no-headers --columns tag`
451
+ do
452
+ echo "workflow = $workflow"
453
+ cortex workflows get --tag $workflow --yaml > $workflow.yaml
454
+ done
455
+
442
456
  -----------------------------------------------------------------------------
443
457
  Obfuscating a Cortex export
444
458
  -----------------------------------------------------------------------------
@@ -35,64 +35,63 @@ def add(
35
35
  # remove any data elements that are None - can only be is_default
36
36
  data = {k: v for k, v in data.items() if v is not None}
37
37
 
38
- r = client.post("api/v1/github/configuration", data=data)
38
+ r = client.post("api/v1/github/configurations/app", data=data)
39
39
  print_json(data=r)
40
40
 
41
41
  @app.command()
42
- def add_multiple(
42
+ def delete(
43
43
  ctx: typer.Context,
44
- file_input: Annotated[typer.FileText, typer.Option("--file", "-f", help="JSON file containing configurations; can be passed as stdin with -, example: -f-")] = None,
44
+ alias: str = typer.Option(..., "--alias", "-a", help="The alias of the configuration"),
45
45
  ):
46
46
  """
47
- Add multiple configurations
47
+ Delete a configuration
48
48
  """
49
49
 
50
50
  client = ctx.obj["client"]
51
51
 
52
- data = json.loads("".join([line for line in file_input]))
53
-
54
- r = client.put("api/v1/aws/configurations", data=data)
52
+ r = client.delete("api/v1/github/configurations/app/" + alias)
55
53
  print_json(data=r)
56
54
 
57
55
  @app.command()
58
- def delete(
56
+ def delete_all(
59
57
  ctx: typer.Context,
60
- alias: str = typer.Option(..., "--alias", "-a", help="The alias of the configuration"),
61
58
  ):
62
59
  """
63
- Delete a configuration
60
+ Delete all configurations
64
61
  """
65
62
 
66
63
  client = ctx.obj["client"]
67
64
 
68
- r = client.delete("api/v1/github/configuration/" + alias)
65
+ r = client.delete("api/v1/github/configurations")
69
66
  print_json(data=r)
70
67
 
71
68
  @app.command()
72
- def delete_all(
69
+ def get(
73
70
  ctx: typer.Context,
71
+ alias: str = typer.Option(..., "--alias", "-a", help="The alias of the configuration"),
74
72
  ):
75
73
  """
76
- Delete all configurations
74
+ Get a single app configuration
77
75
  """
78
76
 
79
77
  client = ctx.obj["client"]
80
78
 
81
- r = client.delete("api/v1/github/configurations")
79
+ r = client.get("api/v1/github/configurations/app/" + alias)
82
80
  print_json(data=r)
83
81
 
82
+
84
83
  @app.command()
85
- def get(
84
+ def get_personal(
86
85
  ctx: typer.Context,
87
86
  alias: str = typer.Option(..., "--alias", "-a", help="The alias of the configuration"),
88
87
  ):
89
88
  """
90
- Get a configuration
89
+ Get a personal configuration
91
90
  """
92
91
 
93
92
  client = ctx.obj["client"]
94
93
 
95
- r = client.get("api/v1/github/configuration/" + alias)
94
+ r = client.get("api/v1/github/configurations/personal/" + alias)
96
95
  print_json(data=r)
97
96
 
98
97
  @app.command()
@@ -129,7 +128,7 @@ def update(
129
128
  is_default: bool = typer.Option(False, "--is-default", "-i", help="If this is the default configuration"),
130
129
  ):
131
130
  """
132
- Update a configuration
131
+ Update a single app configuration
133
132
  """
134
133
 
135
134
  client = ctx.obj["client"]
@@ -139,7 +138,7 @@ def update(
139
138
  "isDefault": is_default
140
139
  }
141
140
 
142
- r = client.put("api/v1/github/configuration/" + alias, data=data)
141
+ r = client.put("api/v1/github/configurations/app/" + alias, data=data)
143
142
  print_json(data=r)
144
143
 
145
144
  @app.command()
@@ -153,7 +152,7 @@ def validate(
153
152
 
154
153
  client = ctx.obj["client"]
155
154
 
156
- r = client.post("api/v1/github/configurations/validate" + alias)
155
+ r = client.post("api/v1/github/configurations/validate/" + alias)
157
156
  print_json(data=r)
158
157
 
159
158
  @app.command()
@@ -166,7 +165,7 @@ def validate_all(
166
165
 
167
166
  client = ctx.obj["client"]
168
167
 
169
- r = client.post("api/v1/github/configurations")
168
+ r = client.post("api/v1/github/configurations/validate")
170
169
  print_json(data=r)
171
170
 
172
171
  @app.command()
@@ -8,9 +8,11 @@ app = typer.Typer(help="Prometheus commands", no_args_is_help=True)
8
8
  @app.command()
9
9
  def add(
10
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"),
11
+ alias: str = typer.Option(None, "--alias", "-a", help="Alias for this configuration"),
13
12
  host: str = typer.Option(None, "--host", "-h", help="Optional host name"),
13
+ username: str = typer.Option(None, "--username", "-u", help="username"),
14
+ password: str = typer.Option(None, "--password", "-p", help="password"),
15
+ tenant_id: str = typer.Option(None, "--tenant", "-t", help="Optional tenant id"),
14
16
  is_default: bool = typer.Option(False, "--is-default", "-i", help="If this is the default configuration"),
15
17
  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,
16
18
  ):
@@ -21,19 +23,23 @@ def add(
21
23
  client = ctx.obj["client"]
22
24
 
23
25
  if file_input:
24
- if alias or api_key or is_default or host:
25
- raise typer.BadParameter("When providing a custom event definition file, do not specify any other custom event attributes")
26
+ if alias or host or username or password or tenant_id or is_default:
27
+ raise typer.BadParameter("When providing a prometheus definition file, do not specify any other attributes")
26
28
  data = json.loads("".join([line for line in file_input]))
27
29
  else:
30
+
28
31
  data = {
29
32
  "alias": alias,
30
- "apiKey": api_key,
31
33
  "host": host,
32
- "isDefault": is_default,
34
+ "username": username,
35
+ "password": password,
36
+ "tenant_id": tenant_id,
37
+ "is_default": is_default
33
38
  }
34
39
 
35
- # remove any data elements that are None - can only be is_default
36
- data = {k: v for k, v in data.items() if v is not None}
40
+ for k, v in data.items():
41
+ if v is None:
42
+ raise typer.BadParameter("Missing required parameter: " + k)
37
43
 
38
44
  r = client.post("api/v1/prometheus/configuration", data=data)
39
45
  print_json(data=r)
@@ -51,7 +57,7 @@ def add_multiple(
51
57
 
52
58
  data = json.loads("".join([line for line in file_input]))
53
59
 
54
- r = client.put("api/v1/aws/configurations", data=data)
60
+ r = client.put("api/v1/prometheus/configurations", data=data)
55
61
  print_json(data=r)
56
62
 
57
63
  @app.command()
@@ -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 = "1.0.2"
4
+ version = "1.0.4"
5
5
  description = "Command Line Interface for cortexapps"
6
6
  license = "MIT"
7
7
  authors = [
File without changes