cortexapps-cli 1.0.1__tar.gz → 1.0.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.
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/LICENSE +7 -5
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/PKG-INFO +1 -1
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/integrations_commands/github.py +88 -22
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/pyproject.toml +1 -1
- cortexapps_cli-1.0.1/cortexapps_cli/cortex.py +0 -4071
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/README.rst +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/cli.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/command_options.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/api_keys.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/audit_logs.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/backup.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/backup_commands/cortex_export.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/catalog.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/custom_data.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/custom_events.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/custom_metrics.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/dependencies.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/deploys.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/discovery_audit.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/docs.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/entity_types.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/gitops_logs.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/groups.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/initiatives.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/integrations.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/integrations_commands/aws.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/integrations_commands/azure_devops.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/integrations_commands/azure_resources.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/integrations_commands/circleci.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/integrations_commands/coralogix.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/integrations_commands/datadog.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/integrations_commands/gitlab.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/integrations_commands/incidentio.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/integrations_commands/launchdarkly.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/integrations_commands/newrelic.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/integrations_commands/pagerduty.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/integrations_commands/prometheus.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/integrations_commands/sonarqube.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/ip_allowlist.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/on_call.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/packages.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/packages_commands/go.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/packages_commands/java.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/packages_commands/node.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/packages_commands/nuget.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/packages_commands/python.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/plugins.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/queries.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/rest.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/scim.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/scorecards.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/scorecards_commands/exemptions.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/teams.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/commands/workflows.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/cortex_client.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/models/team.py +0 -0
- {cortexapps_cli-1.0.1 → cortexapps_cli-1.0.3}/cortexapps_cli/utils.py +0 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 tsuyoshiwada
|
|
2
4
|
|
|
3
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -7,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
7
9
|
copies of the Software, and to permit persons to whom the Software is
|
|
8
10
|
furnished to do so, subject to the following conditions:
|
|
9
11
|
|
|
10
|
-
The above copyright notice and this permission notice shall be included in
|
|
11
|
-
copies or substantial portions of the Software.
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
12
14
|
|
|
13
15
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
16
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
17
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
-
SOFTWARE.
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -22,7 +22,7 @@ def add(
|
|
|
22
22
|
|
|
23
23
|
if file_input:
|
|
24
24
|
if alias or api_key or is_default or host:
|
|
25
|
-
raise typer.BadParameter("When providing a
|
|
25
|
+
raise typer.BadParameter("When providing a configuration file, do not specify any other attributes")
|
|
26
26
|
data = json.loads("".join([line for line in file_input]))
|
|
27
27
|
else:
|
|
28
28
|
data = {
|
|
@@ -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,5 +165,72 @@ 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")
|
|
169
|
+
print_json(data=r)
|
|
170
|
+
|
|
171
|
+
@app.command()
|
|
172
|
+
def add_personal(
|
|
173
|
+
ctx: typer.Context,
|
|
174
|
+
alias: str = typer.Option(..., "--alias", "-a", help="Alias for this configuration"),
|
|
175
|
+
access_token: str = typer.Option(..., "--access-token", "-at", help="Access Token"),
|
|
176
|
+
host: str = typer.Option(None, "--host", "-h", help="Optional host name"),
|
|
177
|
+
is_default: bool = typer.Option(False, "--is-default", "-i", help="If this is the default configuration"),
|
|
178
|
+
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,
|
|
179
|
+
):
|
|
180
|
+
"""
|
|
181
|
+
Add a single personal configuration
|
|
182
|
+
"""
|
|
183
|
+
|
|
184
|
+
client = ctx.obj["client"]
|
|
185
|
+
|
|
186
|
+
if file_input:
|
|
187
|
+
if alias or access_token or is_default or host:
|
|
188
|
+
raise typer.BadParameter("When providing a configuration file, do not specify any other attributes")
|
|
189
|
+
data = json.loads("".join([line for line in file_input]))
|
|
190
|
+
else:
|
|
191
|
+
data = {
|
|
192
|
+
"alias": alias,
|
|
193
|
+
"accessToken": access_token,
|
|
194
|
+
"apiHost": host,
|
|
195
|
+
"isDefault": is_default,
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
# remove any data elements that are None - can only be is_default
|
|
199
|
+
data = {k: v for k, v in data.items() if v is not None}
|
|
200
|
+
|
|
201
|
+
r = client.post("api/v1/github/configurations/personal", data=data)
|
|
202
|
+
print_json(data=r)
|
|
203
|
+
|
|
204
|
+
@app.command()
|
|
205
|
+
def delete_personal(
|
|
206
|
+
ctx: typer.Context,
|
|
207
|
+
alias: str = typer.Option(..., "--alias", "-a", help="The alias of the configuration"),
|
|
208
|
+
):
|
|
209
|
+
"""
|
|
210
|
+
Delete a personal configuration
|
|
211
|
+
"""
|
|
212
|
+
|
|
213
|
+
client = ctx.obj["client"]
|
|
214
|
+
|
|
215
|
+
r = client.delete("api/v1/github/configurations/personal/" + alias)
|
|
216
|
+
print_json(data=r)
|
|
217
|
+
|
|
218
|
+
@app.command()
|
|
219
|
+
def update_personal(
|
|
220
|
+
ctx: typer.Context,
|
|
221
|
+
alias: str = typer.Option(..., "--alias", "-a", help="The alias of the configuration"),
|
|
222
|
+
is_default: bool = typer.Option(False, "--is-default", "-i", help="If this is the default configuration"),
|
|
223
|
+
):
|
|
224
|
+
"""
|
|
225
|
+
Update a personal configuration
|
|
226
|
+
"""
|
|
227
|
+
|
|
228
|
+
client = ctx.obj["client"]
|
|
229
|
+
|
|
230
|
+
data = {
|
|
231
|
+
"alias": alias,
|
|
232
|
+
"isDefault": is_default
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
r = client.put("api/v1/github/configurations/personal/" + alias, data=data)
|
|
170
236
|
print_json(data=r)
|