cortexapps-cli 1.0.3__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.3 → cortexapps_cli-1.0.4}/LICENSE +5 -7
  2. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/PKG-INFO +15 -1
  3. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/README.rst +14 -0
  4. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/prometheus.py +15 -9
  5. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/pyproject.toml +1 -1
  6. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/cli.py +0 -0
  7. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/command_options.py +0 -0
  8. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/api_keys.py +0 -0
  9. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/audit_logs.py +0 -0
  10. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/backup.py +0 -0
  11. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/backup_commands/cortex_export.py +0 -0
  12. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/catalog.py +0 -0
  13. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/custom_data.py +0 -0
  14. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/custom_events.py +0 -0
  15. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/custom_metrics.py +0 -0
  16. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/dependencies.py +0 -0
  17. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/deploys.py +0 -0
  18. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/discovery_audit.py +0 -0
  19. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/docs.py +0 -0
  20. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/entity_types.py +0 -0
  21. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/gitops_logs.py +0 -0
  22. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/groups.py +0 -0
  23. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/initiatives.py +0 -0
  24. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations.py +0 -0
  25. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/aws.py +0 -0
  26. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/azure_devops.py +0 -0
  27. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/azure_resources.py +0 -0
  28. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/circleci.py +0 -0
  29. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/coralogix.py +0 -0
  30. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/datadog.py +0 -0
  31. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/github.py +0 -0
  32. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/gitlab.py +0 -0
  33. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/incidentio.py +0 -0
  34. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/launchdarkly.py +0 -0
  35. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/newrelic.py +0 -0
  36. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/pagerduty.py +0 -0
  37. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/sonarqube.py +0 -0
  38. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/ip_allowlist.py +0 -0
  39. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/on_call.py +0 -0
  40. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages.py +0 -0
  41. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages_commands/go.py +0 -0
  42. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages_commands/java.py +0 -0
  43. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages_commands/node.py +0 -0
  44. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages_commands/nuget.py +0 -0
  45. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages_commands/python.py +0 -0
  46. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/plugins.py +0 -0
  47. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/queries.py +0 -0
  48. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/rest.py +0 -0
  49. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/scim.py +0 -0
  50. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/scorecards.py +0 -0
  51. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/scorecards_commands/exemptions.py +0 -0
  52. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/teams.py +0 -0
  53. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/workflows.py +0 -0
  54. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/cortex_client.py +0 -0
  55. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/models/team.py +0 -0
  56. {cortexapps_cli-1.0.3 → cortexapps_cli-1.0.4}/cortexapps_cli/utils.py +0 -0
@@ -1,6 +1,4 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2018 tsuyoshiwada
1
+ Copyright (c) 2018 The Python Packaging Authority
4
2
 
5
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +7,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
7
  copies of the Software, and to permit persons to whom the Software is
10
8
  furnished to do so, subject to the following conditions:
11
9
 
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
14
12
 
15
13
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
14
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
15
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
16
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
17
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: cortexapps-cli
3
- Version: 1.0.3
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
  -----------------------------------------------------------------------------
@@ -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.3"
4
+ version = "1.0.4"
5
5
  description = "Command Line Interface for cortexapps"
6
6
  license = "MIT"
7
7
  authors = [