peak-sdk 1.7.0__py3-none-any.whl → 1.8.0__py3-none-any.whl
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.
- peak/_metadata.py +57 -57
- peak/_version.py +1 -1
- peak/callbacks.py +22 -2
- peak/cli/args.py +18 -0
- peak/cli/helpers.py +12 -8
- peak/cli/press/apps/deployments.py +72 -18
- peak/cli/press/apps/specs.py +27 -11
- peak/cli/press/blocks/deployments.py +71 -18
- peak/cli/press/blocks/specs.py +29 -13
- peak/cli/press/deployments.py +2 -4
- peak/cli/press/specs.py +2 -2
- peak/cli/resources/alerts/emails.py +4 -5
- peak/cli/resources/artifacts.py +9 -9
- peak/cli/resources/images.py +11 -12
- peak/cli/resources/services.py +6 -7
- peak/cli/resources/tenants.py +0 -1
- peak/cli/resources/users.py +3 -3
- peak/cli/resources/webapps.py +6 -6
- peak/cli/resources/workflows.py +12 -13
- peak/compression.py +28 -13
- peak/exceptions.py +15 -1
- peak/handler.py +5 -1
- peak/helpers.py +38 -0
- peak/output.py +13 -6
- peak/press/apps.py +33 -0
- peak/press/blocks.py +63 -0
- peak/press/deployments.py +0 -3
- peak/template.py +21 -2
- {peak_sdk-1.7.0.dist-info → peak_sdk-1.8.0.dist-info}/METADATA +5 -5
- {peak_sdk-1.7.0.dist-info → peak_sdk-1.8.0.dist-info}/RECORD +33 -33
- {peak_sdk-1.7.0.dist-info → peak_sdk-1.8.0.dist-info}/LICENSE +0 -0
- {peak_sdk-1.7.0.dist-info → peak_sdk-1.8.0.dist-info}/WHEEL +0 -0
- {peak_sdk-1.7.0.dist-info → peak_sdk-1.8.0.dist-info}/entry_points.txt +0 -0
peak/cli/press/blocks/specs.py
CHANGED
@@ -36,7 +36,7 @@ console = Console()
|
|
36
36
|
_SPEC_ID = typer.Argument(..., help="ID of the Block spec to be used in this operation.")
|
37
37
|
|
38
38
|
|
39
|
-
@app.command("list", short_help="List Block specs."
|
39
|
+
@app.command("list", short_help="List Block specs.")
|
40
40
|
def list_block_specs(
|
41
41
|
ctx: typer.Context,
|
42
42
|
page_size: Optional[int] = args.PAGE_SIZE,
|
@@ -90,11 +90,12 @@ def list_block_specs(
|
|
90
90
|
writer.write(response)
|
91
91
|
|
92
92
|
|
93
|
-
@app.command(short_help="Create a Block spec."
|
93
|
+
@app.command(short_help="Create a Block spec.")
|
94
94
|
def create(
|
95
95
|
ctx: typer.Context,
|
96
96
|
file: str = args.TEMPLATE_PATH,
|
97
97
|
description_file: Optional[str] = args.TEMPLATE_DESCRIPTION_FILE,
|
98
|
+
release_notes_file: Optional[str] = args.RELEASE_NOTES_FILE,
|
98
99
|
params_file: Optional[str] = args.TEMPLATE_PARAMS_FILE,
|
99
100
|
params: Optional[List[str]] = args.TEMPLATE_PARAMS,
|
100
101
|
dry_run: Optional[bool] = DRY_RUN, # noqa: ARG001
|
@@ -213,7 +214,7 @@ def create(
|
|
213
214
|
parameters (map | required: false):
|
214
215
|
<parameterType> (list(map)): List containing the parameter objects. Here the key is the type of the parameter. Accepted values are "build" or "run".
|
215
216
|
name (string): Name of the parameter.
|
216
|
-
type (string): Type of the parameter. Should be one of "string", "number", "
|
217
|
+
type (string): Type of the parameter. Should be one of "boolean", "string", "string_array", "number", "number_array", "object" and "object_array".
|
217
218
|
required (boolean): Whether the parameter is required.
|
218
219
|
description (string | required: false): Description of the parameter.
|
219
220
|
defaultValue (string | required: false): Default value of the parameter.
|
@@ -244,7 +245,13 @@ def create(
|
|
244
245
|
block_client: Block = ctx.obj["client"]
|
245
246
|
writer: Writer = ctx.obj["writer"]
|
246
247
|
|
247
|
-
|
248
|
+
markdown_files = {}
|
249
|
+
if description_file:
|
250
|
+
markdown_files["body:metadata:description"] = description_file
|
251
|
+
if release_notes_file:
|
252
|
+
markdown_files["body:release:notes"] = release_notes_file
|
253
|
+
|
254
|
+
body = helpers.template_handler(file, params_file, params, markdown_files)
|
248
255
|
body = helpers.remove_unknown_args(body, block_client.create_spec)
|
249
256
|
|
250
257
|
with writer.pager():
|
@@ -252,7 +259,7 @@ def create(
|
|
252
259
|
writer.write(response)
|
253
260
|
|
254
261
|
|
255
|
-
@app.command(short_help="Describe a Block spec."
|
262
|
+
@app.command(short_help="Describe a Block spec.")
|
256
263
|
def describe(
|
257
264
|
ctx: typer.Context,
|
258
265
|
spec_id: str = _SPEC_ID,
|
@@ -291,7 +298,7 @@ def describe(
|
|
291
298
|
writer.write(response)
|
292
299
|
|
293
300
|
|
294
|
-
@app.command(short_help="Update the Block spec metadata."
|
301
|
+
@app.command(short_help="Update the Block spec metadata.")
|
295
302
|
def update_metadata(
|
296
303
|
ctx: typer.Context,
|
297
304
|
spec_id: str = _SPEC_ID,
|
@@ -346,7 +353,11 @@ def update_metadata(
|
|
346
353
|
|
347
354
|
🔗 [**API Documentation**](https://press.peak.ai/api-docs/index.htm#/Block%20Specs/patch_v1_blocks_specs__specId_)
|
348
355
|
"""
|
349
|
-
|
356
|
+
markdown_files = {}
|
357
|
+
if description_file:
|
358
|
+
markdown_files["body:metadata:description"] = description_file
|
359
|
+
|
360
|
+
body = helpers.template_handler(file, params_file, params, markdown_files)
|
350
361
|
writer: Writer = ctx.obj["writer"]
|
351
362
|
|
352
363
|
block_client: Block = ctx.obj["client"]
|
@@ -357,7 +368,7 @@ def update_metadata(
|
|
357
368
|
writer.write(response)
|
358
369
|
|
359
370
|
|
360
|
-
@app.command(short_help="Delete a Block spec."
|
371
|
+
@app.command(short_help="Delete a Block spec.")
|
361
372
|
def delete(
|
362
373
|
ctx: typer.Context,
|
363
374
|
spec_id: str = _SPEC_ID,
|
@@ -389,11 +400,12 @@ def delete(
|
|
389
400
|
writer.write(response)
|
390
401
|
|
391
402
|
|
392
|
-
@app.command(short_help="Create a new release for a Block spec."
|
403
|
+
@app.command(short_help="Create a new release for a Block spec.")
|
393
404
|
def create_release(
|
394
405
|
ctx: typer.Context,
|
395
406
|
spec_id: str = _SPEC_ID,
|
396
407
|
file: str = args.TEMPLATE_PATH,
|
408
|
+
release_notes_file: Optional[str] = args.RELEASE_NOTES_FILE,
|
397
409
|
params_file: Optional[str] = args.TEMPLATE_PARAMS_FILE,
|
398
410
|
params: Optional[List[str]] = args.TEMPLATE_PARAMS,
|
399
411
|
dry_run: Optional[bool] = DRY_RUN, # noqa: ARG001
|
@@ -497,7 +509,7 @@ def create_release(
|
|
497
509
|
parameters (map | required: false):
|
498
510
|
<parameterType> (list(map)): List containing the parameter objects. Here the key is the type of the parameter. Accepted values are "build" or "run".
|
499
511
|
name (string): Name of the parameter.
|
500
|
-
type (string): Type of the parameter. Should be one of "string", "number", "
|
512
|
+
type (string): Type of the parameter. Should be one of "boolean", "string", "string_array", "number", "number_array", "object" and "object_array".
|
501
513
|
required (boolean): Whether the parameter is required.
|
502
514
|
description (string | required: false): Description of the parameter.
|
503
515
|
defaultValue (string | required: false): Default value of the parameter.
|
@@ -528,7 +540,11 @@ def create_release(
|
|
528
540
|
|
529
541
|
🔗 [**API Documentation**](https://press.peak.ai/api-docs/index.htm#/Block%20Specs/post_v1_blocks_specs__specId__releases)
|
530
542
|
"""
|
531
|
-
|
543
|
+
markdown_files = {}
|
544
|
+
if release_notes_file:
|
545
|
+
markdown_files["body:release:notes"] = release_notes_file
|
546
|
+
|
547
|
+
body = helpers.template_handler(file, params_file, params, markdown_files)
|
532
548
|
writer: Writer = ctx.obj["writer"]
|
533
549
|
|
534
550
|
block_client: Block = ctx.obj["client"]
|
@@ -539,7 +555,7 @@ def create_release(
|
|
539
555
|
writer.write(response)
|
540
556
|
|
541
557
|
|
542
|
-
@app.command(short_help="Describe a Block spec release."
|
558
|
+
@app.command(short_help="Describe a Block spec release.")
|
543
559
|
def describe_release(
|
544
560
|
ctx: typer.Context,
|
545
561
|
spec_id: str = args.SPEC_ID,
|
@@ -592,7 +608,7 @@ def describe_release(
|
|
592
608
|
writer.write(response)
|
593
609
|
|
594
610
|
|
595
|
-
@app.command(short_help="List releases of a Block spec."
|
611
|
+
@app.command(short_help="List releases of a Block spec.")
|
596
612
|
def list_releases(
|
597
613
|
ctx: typer.Context,
|
598
614
|
spec_id: str = args.SPEC_ID,
|
peak/cli/press/deployments.py
CHANGED
@@ -37,7 +37,7 @@ app = typer.Typer(
|
|
37
37
|
console = Console()
|
38
38
|
|
39
39
|
|
40
|
-
@app.command("list", short_help="List App and Block deployments."
|
40
|
+
@app.command("list", short_help="List App and Block deployments.")
|
41
41
|
def list_deployments(
|
42
42
|
ctx: typer.Context,
|
43
43
|
page_size: Optional[int] = args.PAGE_SIZE,
|
@@ -87,7 +87,7 @@ def list_deployments(
|
|
87
87
|
writer.write(response)
|
88
88
|
|
89
89
|
|
90
|
-
@app.command(short_help="Execute the resources of an app or block deployment"
|
90
|
+
@app.command(short_help="Execute the resources of an app or block deployment")
|
91
91
|
def execute_resources(
|
92
92
|
ctx: typer.Context,
|
93
93
|
deployment_id: str = typer.Argument(..., help="ID of the app or block deployment to execute resources for."),
|
@@ -116,8 +116,6 @@ def execute_resources(
|
|
116
116
|
]
|
117
117
|
}
|
118
118
|
```
|
119
|
-
|
120
|
-
🔗 [**API Documentation**](https://press.peak.ai/api-docs/index.htm#/Deployments/post_v1_deployments__deploymentId__trigger)
|
121
119
|
"""
|
122
120
|
deployment_client: Deployment = ctx.obj["client"]
|
123
121
|
writer: Writer = ctx.obj["writer"]
|
peak/cli/press/specs.py
CHANGED
@@ -38,7 +38,7 @@ console = Console()
|
|
38
38
|
RELEASE_VERSION = typer.Option(None, help="The release version of the spec in valid semantic versioning format.")
|
39
39
|
|
40
40
|
|
41
|
-
@app.command("list", short_help="List App and Block specs."
|
41
|
+
@app.command("list", short_help="List App and Block specs.")
|
42
42
|
def list_specs(
|
43
43
|
ctx: typer.Context,
|
44
44
|
page_size: Optional[int] = args.PAGE_SIZE,
|
@@ -92,7 +92,7 @@ def list_specs(
|
|
92
92
|
writer.write(response)
|
93
93
|
|
94
94
|
|
95
|
-
@app.command(short_help="List deployments for a spec release."
|
95
|
+
@app.command(short_help="List deployments for a spec release.")
|
96
96
|
def list_release_deployments(
|
97
97
|
ctx: typer.Context,
|
98
98
|
spec_id: str = args.SPEC_ID,
|
@@ -57,7 +57,7 @@ _LIST_TEMPLATE_SCOPE = typer.Option(None, help="List of type of template to filt
|
|
57
57
|
_DESCRIBE_TEMPLATE_NAME = typer.Argument(None, help="The name of the email template.")
|
58
58
|
|
59
59
|
|
60
|
-
@app.command("list", short_help="List all emails."
|
60
|
+
@app.command("list", short_help="List all emails.")
|
61
61
|
def list_emails(
|
62
62
|
ctx: typer.Context,
|
63
63
|
page_size: Optional[int] = _PAGE_SIZE,
|
@@ -114,7 +114,7 @@ def list_emails(
|
|
114
114
|
writer.write(response)
|
115
115
|
|
116
116
|
|
117
|
-
@app.command("send", short_help="Send an email."
|
117
|
+
@app.command("send", short_help="Send an email.")
|
118
118
|
def send_email(
|
119
119
|
ctx: typer.Context,
|
120
120
|
file: Annotated[
|
@@ -213,7 +213,7 @@ def send_email(
|
|
213
213
|
writer.write(response)
|
214
214
|
|
215
215
|
|
216
|
-
@app.command(short_help="Describe details of a specific email."
|
216
|
+
@app.command(short_help="Describe details of a specific email.")
|
217
217
|
def describe(
|
218
218
|
ctx: typer.Context,
|
219
219
|
email_id: int = _EMAIL_ID,
|
@@ -264,7 +264,7 @@ def describe(
|
|
264
264
|
writer.write(response)
|
265
265
|
|
266
266
|
|
267
|
-
@app.command(short_help="List all the templates."
|
267
|
+
@app.command(short_help="List all the templates.")
|
268
268
|
def list_templates(
|
269
269
|
ctx: typer.Context,
|
270
270
|
page_size: Optional[int] = _PAGE_SIZE,
|
@@ -320,7 +320,6 @@ def list_templates(
|
|
320
320
|
|
321
321
|
@app.command(
|
322
322
|
short_help="Describe details of a specific template.",
|
323
|
-
options_metavar="describe_template",
|
324
323
|
)
|
325
324
|
def describe_template(
|
326
325
|
ctx: typer.Context,
|
peak/cli/resources/artifacts.py
CHANGED
@@ -45,7 +45,7 @@ _DOWNLOAD_VERSION = typer.Option(
|
|
45
45
|
_DELETE_VERSION = typer.Argument(..., help="Artifact version number to delete.")
|
46
46
|
|
47
47
|
|
48
|
-
@app.command("list", short_help="List artifacts."
|
48
|
+
@app.command("list", short_help="List artifacts.")
|
49
49
|
def list_artifacts(
|
50
50
|
ctx: typer.Context,
|
51
51
|
page_size: Optional[int] = args.PAGE_SIZE,
|
@@ -83,7 +83,7 @@ def list_artifacts(
|
|
83
83
|
writer.write(response)
|
84
84
|
|
85
85
|
|
86
|
-
@app.command(short_help="Describe an artifact."
|
86
|
+
@app.command(short_help="Describe an artifact.")
|
87
87
|
def describe(
|
88
88
|
ctx: typer.Context,
|
89
89
|
artifact_id: str = _ARTIFACT_ID,
|
@@ -129,7 +129,7 @@ def describe(
|
|
129
129
|
writer.write(response)
|
130
130
|
|
131
131
|
|
132
|
-
@app.command(short_help="Delete an artifact."
|
132
|
+
@app.command(short_help="Delete an artifact.")
|
133
133
|
def delete(
|
134
134
|
ctx: typer.Context,
|
135
135
|
artifact_id: str = _ARTIFACT_ID,
|
@@ -158,10 +158,10 @@ def delete(
|
|
158
158
|
|
159
159
|
with writer.pager():
|
160
160
|
response = artifact_client.delete_artifact(artifact_id=artifact_id)
|
161
|
-
writer.write(response)
|
161
|
+
writer.write(response, output_type=OutputTypes.json)
|
162
162
|
|
163
163
|
|
164
|
-
@app.command(short_help="Create a new artifact."
|
164
|
+
@app.command(short_help="Create a new artifact.")
|
165
165
|
def create(
|
166
166
|
ctx: typer.Context,
|
167
167
|
file: str = args.TEMPLATE_PATH,
|
@@ -211,7 +211,7 @@ def create(
|
|
211
211
|
writer.write(response)
|
212
212
|
|
213
213
|
|
214
|
-
@app.command(short_help="Update an artifact's metadata."
|
214
|
+
@app.command(short_help="Update an artifact's metadata.")
|
215
215
|
def update_metadata(
|
216
216
|
ctx: typer.Context,
|
217
217
|
artifact_id: str = _ARTIFACT_ID,
|
@@ -256,7 +256,7 @@ def update_metadata(
|
|
256
256
|
writer.write(response)
|
257
257
|
|
258
258
|
|
259
|
-
@app.command(short_help="Download an artifact."
|
259
|
+
@app.command(short_help="Download an artifact.")
|
260
260
|
def download(
|
261
261
|
ctx: typer.Context,
|
262
262
|
artifact_id: str = _ARTIFACT_ID,
|
@@ -288,7 +288,7 @@ def download(
|
|
288
288
|
artifact_client.download_artifact(artifact_id=artifact_id, download_path=download_path, version=version)
|
289
289
|
|
290
290
|
|
291
|
-
@app.command(short_help="Create a new version of the artifact."
|
291
|
+
@app.command(short_help="Create a new version of the artifact.")
|
292
292
|
def create_version(
|
293
293
|
ctx: typer.Context,
|
294
294
|
artifact_id: str = _ARTIFACT_ID,
|
@@ -337,7 +337,7 @@ def create_version(
|
|
337
337
|
writer.write(response)
|
338
338
|
|
339
339
|
|
340
|
-
@app.command(short_help="Delete a version of an artifact."
|
340
|
+
@app.command(short_help="Delete a version of an artifact.")
|
341
341
|
def delete_version(
|
342
342
|
ctx: typer.Context,
|
343
343
|
artifact_id: str = _ARTIFACT_ID,
|
peak/cli/resources/images.py
CHANGED
@@ -137,7 +137,7 @@ MAPPING = {
|
|
137
137
|
}
|
138
138
|
|
139
139
|
|
140
|
-
@app.command(short_help="Create a new image."
|
140
|
+
@app.command(short_help="Create a new image.")
|
141
141
|
def create(
|
142
142
|
ctx: typer.Context,
|
143
143
|
file: Annotated[
|
@@ -267,7 +267,7 @@ def create(
|
|
267
267
|
writer.write(response)
|
268
268
|
|
269
269
|
|
270
|
-
@app.command(short_help="Create a new image version."
|
270
|
+
@app.command(short_help="Create a new image version.")
|
271
271
|
def create_version(
|
272
272
|
ctx: typer.Context,
|
273
273
|
image_id: int = _IMAGE_ID,
|
@@ -400,7 +400,6 @@ def create_version(
|
|
400
400
|
|
401
401
|
@app.command(
|
402
402
|
short_help="Create a new image/version or Update and existing version.",
|
403
|
-
options_metavar="create_or_update_image",
|
404
403
|
)
|
405
404
|
def create_or_update(
|
406
405
|
ctx: typer.Context,
|
@@ -530,7 +529,7 @@ def create_or_update(
|
|
530
529
|
writer.write(response)
|
531
530
|
|
532
531
|
|
533
|
-
@app.command("list", short_help="List images."
|
532
|
+
@app.command("list", short_help="List images.")
|
534
533
|
def list_images(
|
535
534
|
ctx: typer.Context,
|
536
535
|
page_size: Optional[int] = args.PAGE_SIZE,
|
@@ -583,7 +582,7 @@ def list_images(
|
|
583
582
|
writer.write(response)
|
584
583
|
|
585
584
|
|
586
|
-
@app.command("list-versions", short_help="List image versions."
|
585
|
+
@app.command("list-versions", short_help="List image versions.")
|
587
586
|
def list_image_versions(
|
588
587
|
ctx: typer.Context,
|
589
588
|
image_id: int = _IMAGE_ID,
|
@@ -636,7 +635,7 @@ def list_image_versions(
|
|
636
635
|
writer.write(response)
|
637
636
|
|
638
637
|
|
639
|
-
@app.command(short_help="Describe details of a specific image."
|
638
|
+
@app.command(short_help="Describe details of a specific image.")
|
640
639
|
def describe(
|
641
640
|
ctx: typer.Context,
|
642
641
|
image_id: int = _IMAGE_ID,
|
@@ -675,7 +674,7 @@ def describe(
|
|
675
674
|
writer.write(response)
|
676
675
|
|
677
676
|
|
678
|
-
@app.command(short_help="Describe details of a specific version."
|
677
|
+
@app.command(short_help="Describe details of a specific version.")
|
679
678
|
def describe_version(
|
680
679
|
ctx: typer.Context,
|
681
680
|
image_id: int = args.IMAGE_ID,
|
@@ -723,7 +722,7 @@ def describe_version(
|
|
723
722
|
writer.write(response)
|
724
723
|
|
725
724
|
|
726
|
-
@app.command(short_help="Update an image version."
|
725
|
+
@app.command(short_help="Update an image version.")
|
727
726
|
def update_version(
|
728
727
|
ctx: typer.Context,
|
729
728
|
image_id: int = args.IMAGE_ID,
|
@@ -857,7 +856,7 @@ def update_version(
|
|
857
856
|
writer.write(response)
|
858
857
|
|
859
858
|
|
860
|
-
@app.command(short_help="Delete an image."
|
859
|
+
@app.command(short_help="Delete an image.")
|
861
860
|
def delete(
|
862
861
|
ctx: typer.Context,
|
863
862
|
image_id: int = _IMAGE_ID,
|
@@ -889,7 +888,7 @@ def delete(
|
|
889
888
|
writer.write(response)
|
890
889
|
|
891
890
|
|
892
|
-
@app.command(short_help="Delete an image version."
|
891
|
+
@app.command(short_help="Delete an image version.")
|
893
892
|
def delete_version(
|
894
893
|
ctx: typer.Context,
|
895
894
|
image_id: int = args.IMAGE_ID,
|
@@ -922,7 +921,7 @@ def delete_version(
|
|
922
921
|
writer.write(response)
|
923
922
|
|
924
923
|
|
925
|
-
@app.command(short_help="Delete all the specified versions."
|
924
|
+
@app.command(short_help="Delete all the specified versions.")
|
926
925
|
def delete_versions(
|
927
926
|
ctx: typer.Context,
|
928
927
|
image_id: int = args.IMAGE_ID,
|
@@ -959,7 +958,7 @@ def delete_versions(
|
|
959
958
|
writer.write(response)
|
960
959
|
|
961
960
|
|
962
|
-
@app.command(short_help="List image builds."
|
961
|
+
@app.command(short_help="List image builds.")
|
963
962
|
def list_builds(
|
964
963
|
ctx: typer.Context,
|
965
964
|
image_id: int = _IMAGE_ID,
|
peak/cli/resources/services.py
CHANGED
@@ -107,7 +107,7 @@ MAPPING = {
|
|
107
107
|
}
|
108
108
|
|
109
109
|
|
110
|
-
@app.command("list", short_help="List services."
|
110
|
+
@app.command("list", short_help="List services.")
|
111
111
|
def list_services(
|
112
112
|
ctx: typer.Context,
|
113
113
|
page_size: Optional[int] = args.PAGE_SIZE,
|
@@ -155,7 +155,7 @@ def list_services(
|
|
155
155
|
writer.write(response)
|
156
156
|
|
157
157
|
|
158
|
-
@app.command(short_help="Create a new service."
|
158
|
+
@app.command(short_help="Create a new service.")
|
159
159
|
def create(
|
160
160
|
ctx: typer.Context,
|
161
161
|
file: Annotated[Optional[str], typer.Argument(..., help=FILE_HELP_STRING)] = None,
|
@@ -267,7 +267,7 @@ def create(
|
|
267
267
|
writer.write(response)
|
268
268
|
|
269
269
|
|
270
|
-
@app.command(short_help="Update an existing service."
|
270
|
+
@app.command(short_help="Update an existing service.")
|
271
271
|
def update(
|
272
272
|
ctx: typer.Context,
|
273
273
|
service_id: str = _SERVICE_ID,
|
@@ -383,7 +383,6 @@ def update(
|
|
383
383
|
|
384
384
|
@app.command(
|
385
385
|
short_help="Create a new service or Update an existing service.",
|
386
|
-
options_metavar="create_or_update_service",
|
387
386
|
)
|
388
387
|
def create_or_update(
|
389
388
|
ctx: typer.Context,
|
@@ -502,7 +501,7 @@ def create_or_update(
|
|
502
501
|
writer.write(response)
|
503
502
|
|
504
503
|
|
505
|
-
@app.command(short_help="Delete an existing service."
|
504
|
+
@app.command(short_help="Delete an existing service.")
|
506
505
|
def delete(
|
507
506
|
ctx: typer.Context,
|
508
507
|
service_id: str = _SERVICE_ID,
|
@@ -536,7 +535,7 @@ def delete(
|
|
536
535
|
writer.write(response)
|
537
536
|
|
538
537
|
|
539
|
-
@app.command(short_help="Describe details of a service."
|
538
|
+
@app.command(short_help="Describe details of a service.")
|
540
539
|
def describe(
|
541
540
|
ctx: typer.Context,
|
542
541
|
service_id: str = _SERVICE_ID,
|
@@ -588,7 +587,7 @@ def describe(
|
|
588
587
|
writer.write(response)
|
589
588
|
|
590
589
|
|
591
|
-
@app.command(short_help="Test API type service"
|
590
|
+
@app.command(short_help="Test API type service")
|
592
591
|
def test(
|
593
592
|
ctx: typer.Context,
|
594
593
|
service_name: str = _SERVICE_NAME,
|
peak/cli/resources/tenants.py
CHANGED
peak/cli/resources/users.py
CHANGED
@@ -24,7 +24,7 @@ from typing import Optional
|
|
24
24
|
import typer
|
25
25
|
from peak import Session
|
26
26
|
from peak.cli.args import OUTPUT_TYPES, PAGING
|
27
|
-
from peak.constants import OutputTypesNoTable
|
27
|
+
from peak.constants import OutputTypes, OutputTypesNoTable
|
28
28
|
from peak.output import Writer
|
29
29
|
from peak.resources import users
|
30
30
|
|
@@ -41,7 +41,7 @@ _AUTH_TOKEN = typer.Option(
|
|
41
41
|
)
|
42
42
|
|
43
43
|
|
44
|
-
@app.command(short_help="Check user permission for a specific feature."
|
44
|
+
@app.command(short_help="Check user permission for a specific feature.")
|
45
45
|
def check_permission(
|
46
46
|
ctx: typer.Context,
|
47
47
|
feature: str = _FEATURE,
|
@@ -68,4 +68,4 @@ def check_permission(
|
|
68
68
|
|
69
69
|
with writer.pager():
|
70
70
|
response = user_client.check_permissions({feature: action})
|
71
|
-
writer.write(response.get(feature, False))
|
71
|
+
writer.write(response.get(feature, False), output_type=OutputTypes.json)
|
peak/cli/resources/webapps.py
CHANGED
@@ -84,7 +84,7 @@ MAPPING = {"imageId": "imageDetails", "versionId": "imageDetails", "instanceType
|
|
84
84
|
DEPRECATION_MESSAGE = "The Web App commands are deprecated and will eventually be removed. We recommend using the Service feature which offers a more comprehensive and flexible solution for managing web applications and API deployments.\n"
|
85
85
|
|
86
86
|
|
87
|
-
@app.command("list", short_help="List webapps."
|
87
|
+
@app.command("list", short_help="List webapps.")
|
88
88
|
def list_webapps(
|
89
89
|
ctx: typer.Context,
|
90
90
|
page_size: Optional[int] = args.PAGE_SIZE,
|
@@ -138,7 +138,7 @@ def list_webapps(
|
|
138
138
|
writer.write(response, deprecation_message=DEPRECATION_MESSAGE)
|
139
139
|
|
140
140
|
|
141
|
-
@app.command(short_help="Create a new webapp."
|
141
|
+
@app.command(short_help="Create a new webapp.")
|
142
142
|
def create(
|
143
143
|
ctx: typer.Context,
|
144
144
|
file: Annotated[Optional[str], typer.Argument(..., help=FILE_HELP_STRING)] = None,
|
@@ -229,7 +229,7 @@ def create(
|
|
229
229
|
writer.write(response, deprecation_message=DEPRECATION_MESSAGE)
|
230
230
|
|
231
231
|
|
232
|
-
@app.command(short_help="Update an existing webapp."
|
232
|
+
@app.command(short_help="Update an existing webapp.")
|
233
233
|
def update(
|
234
234
|
ctx: typer.Context,
|
235
235
|
webapp_id: str = _WEBAPP_ID,
|
@@ -322,7 +322,7 @@ def update(
|
|
322
322
|
writer.write(response, deprecation_message=DEPRECATION_MESSAGE)
|
323
323
|
|
324
324
|
|
325
|
-
@app.command(short_help="Create a new webapp or Update an existing webapp."
|
325
|
+
@app.command(short_help="Create a new webapp or Update an existing webapp.")
|
326
326
|
def create_or_update(
|
327
327
|
ctx: typer.Context,
|
328
328
|
file: Annotated[Optional[str], typer.Argument(..., help=FILE_HELP_STRING)] = None,
|
@@ -415,7 +415,7 @@ def create_or_update(
|
|
415
415
|
writer.write(response, deprecation_message=DEPRECATION_MESSAGE)
|
416
416
|
|
417
417
|
|
418
|
-
@app.command(short_help="Delete an existing webapp."
|
418
|
+
@app.command(short_help="Delete an existing webapp.")
|
419
419
|
def delete(
|
420
420
|
ctx: typer.Context,
|
421
421
|
webapp_id: str = _WEBAPP_ID,
|
@@ -457,7 +457,7 @@ def delete(
|
|
457
457
|
writer.write(response, deprecation_message=DEPRECATION_MESSAGE)
|
458
458
|
|
459
459
|
|
460
|
-
@app.command(short_help="Describe details of a webapp."
|
460
|
+
@app.command(short_help="Describe details of a webapp.")
|
461
461
|
def describe(
|
462
462
|
ctx: typer.Context,
|
463
463
|
webapp_id: str = _WEBAPP_ID,
|
peak/cli/resources/workflows.py
CHANGED
@@ -93,7 +93,7 @@ _COUNT = typer.Option(
|
|
93
93
|
)
|
94
94
|
|
95
95
|
|
96
|
-
@app.command(short_help="Create a new workflow."
|
96
|
+
@app.command(short_help="Create a new workflow.")
|
97
97
|
def create(
|
98
98
|
ctx: typer.Context,
|
99
99
|
file: str = args.TEMPLATE_PATH,
|
@@ -216,7 +216,7 @@ def create(
|
|
216
216
|
writer.write(response)
|
217
217
|
|
218
218
|
|
219
|
-
@app.command(short_help="Update an existing workflow."
|
219
|
+
@app.command(short_help="Update an existing workflow.")
|
220
220
|
def update(
|
221
221
|
ctx: typer.Context,
|
222
222
|
workflow_id: int = _WORKFLOW_ID,
|
@@ -342,7 +342,6 @@ def update(
|
|
342
342
|
|
343
343
|
@app.command(
|
344
344
|
short_help="Create a new workflow or Update an existing workflow.",
|
345
|
-
options_metavar="create_or_update_workflow",
|
346
345
|
)
|
347
346
|
def create_or_update(
|
348
347
|
ctx: typer.Context,
|
@@ -464,7 +463,7 @@ def create_or_update(
|
|
464
463
|
writer.write(response)
|
465
464
|
|
466
465
|
|
467
|
-
@app.command(short_help="Update required fields of an existing workflow."
|
466
|
+
@app.command(short_help="Update required fields of an existing workflow.")
|
468
467
|
def patch(
|
469
468
|
ctx: typer.Context,
|
470
469
|
workflow_id: int = _WORKFLOW_ID,
|
@@ -640,7 +639,7 @@ def patch(
|
|
640
639
|
writer.write(response)
|
641
640
|
|
642
641
|
|
643
|
-
@app.command("list", short_help="List workflows."
|
642
|
+
@app.command("list", short_help="List workflows.")
|
644
643
|
def list_workflows(
|
645
644
|
ctx: typer.Context,
|
646
645
|
page_size: Optional[int] = args.PAGE_SIZE,
|
@@ -690,7 +689,7 @@ def list_workflows(
|
|
690
689
|
writer.write(response)
|
691
690
|
|
692
691
|
|
693
|
-
@app.command(short_help="Describe details of a workflow."
|
692
|
+
@app.command(short_help="Describe details of a workflow.")
|
694
693
|
def describe(
|
695
694
|
ctx: typer.Context,
|
696
695
|
workflow_id: int = _WORKFLOW_ID,
|
@@ -734,7 +733,7 @@ def describe(
|
|
734
733
|
writer.write(response)
|
735
734
|
|
736
735
|
|
737
|
-
@app.command(short_help="Delete a workflow."
|
736
|
+
@app.command(short_help="Delete a workflow.")
|
738
737
|
def delete(
|
739
738
|
ctx: typer.Context,
|
740
739
|
workflow_id: int = _WORKFLOW_ID,
|
@@ -766,7 +765,7 @@ def delete(
|
|
766
765
|
writer.write(response)
|
767
766
|
|
768
767
|
|
769
|
-
@app.command(short_help="Start a workflow run."
|
768
|
+
@app.command(short_help="Start a workflow run.")
|
770
769
|
def execute(
|
771
770
|
ctx: typer.Context,
|
772
771
|
workflow_id: int = _WORKFLOW_ID,
|
@@ -828,7 +827,7 @@ def execute(
|
|
828
827
|
writer.write(response)
|
829
828
|
|
830
829
|
|
831
|
-
@app.command(short_help="List all available resources."
|
830
|
+
@app.command(short_help="List all available resources.")
|
832
831
|
def list_resources(
|
833
832
|
ctx: typer.Context,
|
834
833
|
paging: Optional[bool] = PAGING, # noqa: ARG001
|
@@ -866,7 +865,7 @@ def list_resources(
|
|
866
865
|
writer.write(response)
|
867
866
|
|
868
867
|
|
869
|
-
@app.command(short_help="List default resources."
|
868
|
+
@app.command(short_help="List default resources.")
|
870
869
|
def list_default_resources(
|
871
870
|
ctx: typer.Context,
|
872
871
|
paging: Optional[bool] = PAGING, # noqa: ARG001
|
@@ -899,7 +898,7 @@ def list_default_resources(
|
|
899
898
|
writer.write(response)
|
900
899
|
|
901
900
|
|
902
|
-
@app.command(short_help="List executions for the given workflow."
|
901
|
+
@app.command(short_help="List executions for the given workflow.")
|
903
902
|
def list_executions(
|
904
903
|
ctx: typer.Context,
|
905
904
|
workflow_id: int = _WORKFLOW_ID,
|
@@ -951,7 +950,7 @@ def list_executions(
|
|
951
950
|
writer.write(response)
|
952
951
|
|
953
952
|
|
954
|
-
@app.command(short_help="Get workflow execution logs."
|
953
|
+
@app.command(short_help="Get workflow execution logs.")
|
955
954
|
def get_execution_logs(
|
956
955
|
ctx: typer.Context,
|
957
956
|
workflow_id: int = _WORKFLOW_ID_OPTION,
|
@@ -1039,7 +1038,7 @@ def get_execution_logs(
|
|
1039
1038
|
next_token = response.get("nextToken", None)
|
1040
1039
|
|
1041
1040
|
|
1042
|
-
@app.command(short_help="Get workflow execution details."
|
1041
|
+
@app.command(short_help="Get workflow execution details.")
|
1043
1042
|
def get_execution_details(
|
1044
1043
|
ctx: typer.Context,
|
1045
1044
|
workflow_id: int = _WORKFLOW_ID_OPTION,
|