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.
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/PKG-INFO +15 -1
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/README.rst +14 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/github.py +20 -21
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/prometheus.py +15 -9
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/pyproject.toml +1 -1
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/LICENSE +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/cli.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/command_options.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/api_keys.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/audit_logs.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/backup.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/backup_commands/cortex_export.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/catalog.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/custom_data.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/custom_events.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/custom_metrics.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/dependencies.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/deploys.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/discovery_audit.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/docs.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/entity_types.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/gitops_logs.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/groups.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/initiatives.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/aws.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/azure_devops.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/azure_resources.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/circleci.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/coralogix.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/datadog.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/gitlab.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/incidentio.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/launchdarkly.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/newrelic.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/pagerduty.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/sonarqube.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/ip_allowlist.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/on_call.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages_commands/go.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages_commands/java.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages_commands/node.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages_commands/nuget.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages_commands/python.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/plugins.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/queries.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/rest.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/scim.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/scorecards.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/scorecards_commands/exemptions.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/teams.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/workflows.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/cortex_client.py +0 -0
- {cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/models/team.py +0 -0
- {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.
|
|
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/
|
|
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
|
|
42
|
+
def delete(
|
|
43
43
|
ctx: typer.Context,
|
|
44
|
-
|
|
44
|
+
alias: str = typer.Option(..., "--alias", "-a", help="The alias of the configuration"),
|
|
45
45
|
):
|
|
46
46
|
"""
|
|
47
|
-
|
|
47
|
+
Delete a configuration
|
|
48
48
|
"""
|
|
49
49
|
|
|
50
50
|
client = ctx.obj["client"]
|
|
51
51
|
|
|
52
|
-
|
|
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
|
|
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
|
|
60
|
+
Delete all configurations
|
|
64
61
|
"""
|
|
65
62
|
|
|
66
63
|
client = ctx.obj["client"]
|
|
67
64
|
|
|
68
|
-
r = client.delete("api/v1/github/
|
|
65
|
+
r = client.delete("api/v1/github/configurations")
|
|
69
66
|
print_json(data=r)
|
|
70
67
|
|
|
71
68
|
@app.command()
|
|
72
|
-
def
|
|
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
|
-
|
|
74
|
+
Get a single app configuration
|
|
77
75
|
"""
|
|
78
76
|
|
|
79
77
|
client = ctx.obj["client"]
|
|
80
78
|
|
|
81
|
-
r = client.
|
|
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
|
|
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/
|
|
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/
|
|
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(
|
|
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
|
|
25
|
-
raise typer.BadParameter("When providing a
|
|
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
|
-
"
|
|
34
|
+
"username": username,
|
|
35
|
+
"password": password,
|
|
36
|
+
"tenant_id": tenant_id,
|
|
37
|
+
"is_default": is_default
|
|
33
38
|
}
|
|
34
39
|
|
|
35
|
-
|
|
36
|
-
|
|
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/
|
|
60
|
+
r = client.put("api/v1/prometheus/configurations", data=data)
|
|
55
61
|
print_json(data=r)
|
|
56
62
|
|
|
57
63
|
@app.command()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/integrations_commands/aws.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages_commands/go.py
RENAMED
|
File without changes
|
{cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages_commands/java.py
RENAMED
|
File without changes
|
{cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages_commands/node.py
RENAMED
|
File without changes
|
{cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages_commands/nuget.py
RENAMED
|
File without changes
|
{cortexapps_cli-1.0.2 → cortexapps_cli-1.0.4}/cortexapps_cli/commands/packages_commands/python.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|