peak-sdk 1.5.0__py3-none-any.whl → 1.7.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 +80 -5
- peak/_version.py +1 -1
- peak/cli/args.py +1 -0
- peak/cli/cli.py +3 -2
- peak/cli/helpers.py +1 -0
- peak/cli/press/apps/specs.py +2 -0
- peak/cli/press/blocks/specs.py +68 -24
- peak/cli/press/deployments.py +41 -0
- peak/cli/press/specs.py +4 -2
- peak/cli/resources/alerts/__init__.py +35 -0
- peak/cli/resources/alerts/emails.py +360 -0
- peak/cli/resources/images.py +19 -7
- peak/cli/resources/services.py +23 -0
- peak/cli/resources/tenants.py +4 -1
- peak/cli/resources/workflows.py +81 -19
- peak/cli/ruff.toml +5 -3
- peak/compression.py +2 -2
- peak/exceptions.py +4 -6
- peak/handler.py +3 -5
- peak/helpers.py +8 -9
- peak/output.py +2 -2
- peak/press/apps.py +18 -19
- peak/press/blocks.py +396 -155
- peak/press/deployments.py +30 -4
- peak/press/specs.py +12 -14
- peak/resources/__init__.py +3 -2
- peak/resources/alerts.py +309 -0
- peak/resources/artifacts.py +2 -4
- peak/resources/images.py +317 -100
- peak/resources/services.py +7 -6
- peak/resources/webapps.py +3 -5
- peak/resources/workflows.py +103 -13
- peak/sample_yaml/press/apps/specs/create_app_spec.yaml +2 -0
- peak/sample_yaml/press/apps/specs/create_app_spec_release.yaml +2 -0
- peak/sample_yaml/press/blocks/specs/service/api/create_block_spec.yaml +102 -0
- peak/sample_yaml/press/blocks/specs/service/api/create_block_spec_release.yaml +88 -0
- peak/sample_yaml/press/blocks/specs/service/webapp/create_block_spec.yaml +103 -0
- peak/sample_yaml/press/blocks/specs/service/webapp/create_block_spec_release.yaml +89 -0
- peak/sample_yaml/press/blocks/specs/{create_block_spec.yaml → workflow/create_block_spec.yaml} +20 -1
- peak/sample_yaml/press/blocks/specs/{create_block_spec_release.yaml → workflow/create_block_spec_release.yaml} +20 -1
- peak/sample_yaml/resources/emails/send_email.yaml +15 -0
- peak/sample_yaml/resources/images/dockerfile/create_image.yaml +3 -0
- peak/sample_yaml/resources/images/dockerfile/create_image_version.yaml +3 -0
- peak/sample_yaml/resources/images/dockerfile/update_version.yaml +3 -0
- peak/sample_yaml/resources/images/github/create_image.yaml +3 -0
- peak/sample_yaml/resources/images/github/create_image_version.yaml +3 -0
- peak/sample_yaml/resources/images/github/update_version.yaml +3 -0
- peak/sample_yaml/resources/images/upload/create_image.yaml +3 -0
- peak/sample_yaml/resources/images/upload/create_image_version.yaml +3 -0
- peak/sample_yaml/resources/images/upload/create_or_update_image.yaml +3 -0
- peak/sample_yaml/resources/images/upload/update_version.yaml +3 -0
- peak/sample_yaml/resources/services/create_or_update_service.yaml +1 -0
- peak/sample_yaml/resources/services/create_service.yaml +1 -0
- peak/sample_yaml/resources/services/update_service.yaml +1 -0
- peak/sample_yaml/resources/workflows/create_or_update_workflow.yaml +36 -0
- peak/sample_yaml/resources/workflows/create_workflow.yaml +19 -1
- peak/sample_yaml/resources/workflows/patch_workflow.yaml +36 -0
- peak/sample_yaml/resources/workflows/update_workflow.yaml +36 -0
- peak/session.py +1 -1
- peak/telemetry.py +1 -1
- peak/template.py +6 -4
- peak/tools/logging/__init__.py +26 -268
- peak/tools/logging/log_level.py +35 -3
- peak/tools/logging/logger.py +389 -0
- {peak_sdk-1.5.0.dist-info → peak_sdk-1.7.0.dist-info}/METADATA +19 -20
- {peak_sdk-1.5.0.dist-info → peak_sdk-1.7.0.dist-info}/RECORD +69 -60
- {peak_sdk-1.5.0.dist-info → peak_sdk-1.7.0.dist-info}/WHEEL +1 -1
- {peak_sdk-1.5.0.dist-info → peak_sdk-1.7.0.dist-info}/LICENSE +0 -0
- {peak_sdk-1.5.0.dist-info → peak_sdk-1.7.0.dist-info}/entry_points.txt +0 -0
peak/press/blocks.py
CHANGED
@@ -19,6 +19,7 @@
|
|
19
19
|
# # along with this program. If not, see <https://apache.org/licenses/LICENSE-2.0>
|
20
20
|
#
|
21
21
|
"""Blocks client module."""
|
22
|
+
|
22
23
|
from __future__ import annotations
|
23
24
|
|
24
25
|
import json
|
@@ -52,8 +53,7 @@ class Block(BaseClient):
|
|
52
53
|
page_number: Optional[int] = None,
|
53
54
|
*,
|
54
55
|
return_iterator: Literal[False],
|
55
|
-
) -> Dict[str, Any]:
|
56
|
-
...
|
56
|
+
) -> Dict[str, Any]: ...
|
57
57
|
|
58
58
|
@overload
|
59
59
|
def list_specs(
|
@@ -68,8 +68,7 @@ class Block(BaseClient):
|
|
68
68
|
page_number: Optional[int] = None,
|
69
69
|
*,
|
70
70
|
return_iterator: Literal[True] = True,
|
71
|
-
) -> Iterator[Dict[str, Any]]:
|
72
|
-
...
|
71
|
+
) -> Iterator[Dict[str, Any]]: ...
|
73
72
|
|
74
73
|
def list_specs(
|
75
74
|
self,
|
@@ -154,6 +153,7 @@ class Block(BaseClient):
|
|
154
153
|
scope: Optional[str] = None,
|
155
154
|
tenants: Optional[List[str]] = None,
|
156
155
|
parameters: Optional[Dict[str, List[Dict[str, Any]]]] = None,
|
156
|
+
auto_run_on_deploy: Optional[bool] = None,
|
157
157
|
) -> Dict[str, str]:
|
158
158
|
"""Create a new Block spec.
|
159
159
|
|
@@ -173,101 +173,228 @@ class Block(BaseClient):
|
|
173
173
|
and `shared` allows specifying what set of tenants can access and use this spec.
|
174
174
|
By default it is `private`.
|
175
175
|
tenants (List[str] | None): Given a shared scope, specify what other tenants can discover and deploy this spec.
|
176
|
-
parameters (Optional[Dict[str, List[Dict[str, Any]]]]): A dictionary containing optional keys
|
177
|
-
|
178
|
-
-
|
179
|
-
-
|
180
|
-
|
176
|
+
parameters (Optional[Dict[str, List[Dict[str, Any]]]]): A dictionary containing optional keys `build` and `run`. The structure of the dictionary is as follows:
|
177
|
+
|
178
|
+
- `build` (List[Dict[str, Any]], optional): A list of parameter objects, the values of which will be given and used at deployment time.
|
179
|
+
- `run` (List[Dict[str, Any]], optional): A list of parameter objects, the values of which will be given at deployment time and will be used at run time.
|
180
|
+
auto_run_on_deploy (bool | None): Whether to execute the resource after the block is deployed. By default it is False.
|
181
181
|
|
182
182
|
Returns:
|
183
183
|
Dict[str, str]: Id of the created block spec.
|
184
184
|
|
185
|
-
SCHEMA(body):
|
186
|
-
|
185
|
+
SCHEMA (body):
|
186
|
+
Information about providing image details in blocks can be found `here <https://docs.peak.ai/sdk/latest/snippets/press-examples.html#providing-image-details-for-block-specs>`__.
|
187
187
|
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
"
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
"
|
211
|
-
"
|
212
|
-
"
|
213
|
-
|
214
|
-
|
215
|
-
"
|
216
|
-
"
|
188
|
+
.. tabs::
|
189
|
+
|
190
|
+
.. tab:: Workflow Block Spec
|
191
|
+
|
192
|
+
.. code-block:: json
|
193
|
+
|
194
|
+
{
|
195
|
+
"version": "number(required)",
|
196
|
+
"kind": "string(required)",
|
197
|
+
"metadata": {
|
198
|
+
"name": "string(required)",
|
199
|
+
"title": "string",
|
200
|
+
"summary": "string(required)",
|
201
|
+
"description": "string",
|
202
|
+
"descriptionContentType": "string",
|
203
|
+
"imageUrl": "string",
|
204
|
+
"tags": [
|
205
|
+
{
|
206
|
+
"name": "string",
|
207
|
+
}
|
208
|
+
]
|
209
|
+
},
|
210
|
+
"release": {
|
211
|
+
"notes": "string",
|
212
|
+
"version": "string (required)",
|
213
|
+
},
|
214
|
+
"config": {
|
215
|
+
"images": {
|
216
|
+
"image-name": {
|
217
|
+
"version": "string",
|
218
|
+
"dockerfile": "string",
|
219
|
+
"context": "string",
|
220
|
+
"useCache": "boolean",
|
221
|
+
"buildArguments": {
|
222
|
+
"key (string)": "value (string)"
|
223
|
+
},
|
224
|
+
}
|
217
225
|
},
|
226
|
+
"steps": {
|
227
|
+
"stepName": {
|
228
|
+
"type": "string",
|
229
|
+
"image": {
|
230
|
+
"version": "string",
|
231
|
+
"dockerfile": "string",
|
232
|
+
"context": "string",
|
233
|
+
"useCache": "boolean",
|
234
|
+
"buildArguments": {
|
235
|
+
"key (string)": "value (string)"
|
236
|
+
},
|
237
|
+
"secrets": []
|
238
|
+
}
|
239
|
+
"imageRef": "string",
|
240
|
+
"imageDetails": {
|
241
|
+
"id": "number (required)",
|
242
|
+
"versionId": "number"
|
243
|
+
},
|
244
|
+
"command": "string (required)",
|
245
|
+
"resources": {
|
246
|
+
"instanceTypeId": "number",
|
247
|
+
"storage": "string"
|
248
|
+
},
|
249
|
+
"parents": [],
|
250
|
+
"stepTimeout": "number",
|
251
|
+
"clearImageCache": "boolean",
|
252
|
+
"repository": {
|
253
|
+
"branch": "string",
|
254
|
+
"token": "string",
|
255
|
+
"url": "string"
|
256
|
+
},
|
257
|
+
"runConfiguration": {
|
258
|
+
"retryOptions": {
|
259
|
+
"duration": "number",
|
260
|
+
"exitCodes": [],
|
261
|
+
"exponentialBackoff": "boolean",
|
262
|
+
"numberOfRetries": "number"
|
263
|
+
},
|
264
|
+
"skipConfiguration": {
|
265
|
+
"skip": "boolean",
|
266
|
+
"skipDAG": "boolean",
|
267
|
+
}
|
268
|
+
},
|
269
|
+
"parameters": {
|
270
|
+
"env": {
|
271
|
+
"key (string)": "value (string)"
|
272
|
+
},
|
273
|
+
"secrets": [],
|
274
|
+
},
|
275
|
+
"outputParameters": {
|
276
|
+
"key (string)": "value (string)"
|
277
|
+
},
|
278
|
+
"executionParameters": {
|
279
|
+
"conditional": [
|
280
|
+
{
|
281
|
+
"condition": "string",
|
282
|
+
"paramName": "string",
|
283
|
+
"stepName": "string",
|
284
|
+
"value": "string"
|
285
|
+
}
|
286
|
+
],
|
287
|
+
"parentStatus": [
|
288
|
+
{
|
289
|
+
"condition": "string",
|
290
|
+
"parents": [],
|
291
|
+
"status": []
|
292
|
+
}
|
293
|
+
]
|
294
|
+
}
|
295
|
+
}
|
296
|
+
},
|
297
|
+
"triggers": [
|
298
|
+
{
|
299
|
+
"cron": "string"
|
300
|
+
},
|
301
|
+
{
|
302
|
+
"webhook": "boolean"
|
303
|
+
},
|
304
|
+
],
|
305
|
+
"watchers": [
|
306
|
+
{
|
307
|
+
"events": {
|
308
|
+
"success": "boolean",
|
309
|
+
"fail": "boolean",
|
310
|
+
"runtimeExceeded": "number"
|
311
|
+
},
|
312
|
+
"user": "string",
|
313
|
+
},
|
314
|
+
{
|
315
|
+
"events": {
|
316
|
+
"success": "boolean",
|
317
|
+
"fail": "boolean",
|
318
|
+
"runtimeExceeded": "number"
|
319
|
+
},
|
320
|
+
"webhook": {
|
321
|
+
"name": "string(required)",
|
322
|
+
"url": "string(required)",
|
323
|
+
"payload": "string(required)"
|
324
|
+
}
|
325
|
+
},
|
326
|
+
{
|
327
|
+
"events": {
|
328
|
+
"success": "boolean",
|
329
|
+
"fail": "boolean",
|
330
|
+
"runtimeExceeded": "number"
|
331
|
+
},
|
332
|
+
"email": {
|
333
|
+
"name": "string",
|
334
|
+
"recipients": {
|
335
|
+
"to": ["string"]
|
336
|
+
}
|
337
|
+
}
|
338
|
+
}
|
339
|
+
],
|
218
340
|
}
|
219
|
-
}
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
341
|
+
}
|
342
|
+
|
343
|
+
.. tab:: Service Block Spec
|
344
|
+
|
345
|
+
.. code-block:: json
|
346
|
+
|
347
|
+
{
|
348
|
+
"version": "number(required)",
|
349
|
+
"kind": "string(required)",
|
350
|
+
"metadata": {
|
351
|
+
"name": "string(required)",
|
352
|
+
"title": "string",
|
353
|
+
"summary": "string(required)",
|
354
|
+
"description": "string",
|
355
|
+
"descriptionContentType": "string",
|
356
|
+
"imageUrl": "string",
|
357
|
+
"tags": [
|
358
|
+
{
|
359
|
+
"name": "string",
|
360
|
+
}
|
361
|
+
]
|
362
|
+
},
|
363
|
+
"release": {
|
364
|
+
"notes": "string",
|
365
|
+
"version": "string (required)",
|
366
|
+
},
|
367
|
+
"config": {
|
368
|
+
"serviceType": "string",
|
369
|
+
"image": {
|
370
|
+
"version": "string",
|
371
|
+
"dockerfile": "string",
|
372
|
+
"context": "string",
|
373
|
+
"useCache": "boolean",
|
374
|
+
"buildArguments": {
|
375
|
+
"key (string)": "value (string)"
|
376
|
+
},
|
377
|
+
"secrets": []
|
378
|
+
},
|
379
|
+
"imageDetails": {
|
380
|
+
"id": "number (required)",
|
381
|
+
"versionId": "number"
|
382
|
+
},
|
226
383
|
"resources": {
|
227
|
-
"instanceTypeId": "number",
|
228
|
-
"storage": "string"
|
384
|
+
"instanceTypeId": "number (required)",
|
229
385
|
},
|
230
|
-
"parents": [],
|
231
|
-
"stepTimeout": "number",
|
232
|
-
"clearImageCache": "boolean",
|
233
386
|
"parameters": {
|
234
387
|
"env": {
|
235
388
|
"key (string)": "value (string)"
|
236
389
|
},
|
237
|
-
"secrets": []
|
390
|
+
"secrets": []
|
238
391
|
},
|
239
|
-
"
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
}
|
392
|
+
"sessionStickiness": "boolean (only for web-app service)",
|
393
|
+
"entrypoint": "string",
|
394
|
+
"healthCheckURL": "string",
|
395
|
+
"minInstances": "number. Default is 1 and maximum is 2",
|
244
396
|
}
|
245
397
|
}
|
246
|
-
"triggers": [
|
247
|
-
{
|
248
|
-
"cron": "string"
|
249
|
-
},
|
250
|
-
{
|
251
|
-
"webhook": "boolean"
|
252
|
-
},
|
253
|
-
],
|
254
|
-
"watchers": [
|
255
|
-
{
|
256
|
-
"events": {
|
257
|
-
"success": "boolean",
|
258
|
-
"fail": "boolean",
|
259
|
-
"runtimeExceeded": "number"
|
260
|
-
},
|
261
|
-
"user": "string",
|
262
|
-
"webhook": {
|
263
|
-
"name": "string(required)",
|
264
|
-
"url": "string(required)",
|
265
|
-
"payload": "string(required)",
|
266
|
-
}
|
267
|
-
}
|
268
|
-
],
|
269
|
-
}
|
270
|
-
}
|
271
398
|
|
272
399
|
SCHEMA(Parameters):
|
273
400
|
.. code-block:: json
|
@@ -311,6 +438,7 @@ class Block(BaseClient):
|
|
311
438
|
"spec": json.dumps(body),
|
312
439
|
"featured": json.dumps(featured),
|
313
440
|
"scope": scope,
|
441
|
+
"autoRunOnDeploy": json.dumps(auto_run_on_deploy),
|
314
442
|
}
|
315
443
|
|
316
444
|
if tenants:
|
@@ -456,6 +584,7 @@ class Block(BaseClient):
|
|
456
584
|
body: Dict[str, Any],
|
457
585
|
artifact: Optional[ArtifactInfo] = None,
|
458
586
|
parameters: Optional[Dict[str, List[Dict[str, Any]]]] = None,
|
587
|
+
auto_run_on_deploy: Optional[bool] = None,
|
459
588
|
) -> Dict[str, str]:
|
460
589
|
"""Publish a new release to an existing Block spec.
|
461
590
|
|
@@ -468,81 +597,198 @@ class Block(BaseClient):
|
|
468
597
|
artifact (ArtifactInfo | None): Mapping of artifact attributes that specifies how the artifact will be generated,
|
469
598
|
it accepts two keys `path`, which is required and `ignore_files` which is optional, and defaults to `.dockerignore`, it is strongly advised that users use `ignore_files` when generating artifacts to avoid copying any extra files in artifact.
|
470
599
|
It is not required if an existing image and version is used for creating the spec.
|
471
|
-
parameters (Optional[Dict[str, List[Dict[str, Any]]]]): A dictionary containing optional keys
|
472
|
-
|
473
|
-
-
|
474
|
-
-
|
600
|
+
parameters (Optional[Dict[str, List[Dict[str, Any]]]]): A dictionary containing optional keys `build` and `run`. The structure of the dictionary is as follows:
|
601
|
+
|
602
|
+
- `build` (List[Dict[str, Any]], optional): A list of parameter objects, the values of which will be given and used at deployment time.
|
603
|
+
- `run` (List[Dict[str, Any]], optional): A list of parameter objects, the values of which will be given at deployment time and will be used at run time.
|
604
|
+
auto_run_on_deploy (bool | None): Whether to execute the resource after the block is deployed. By default it is False.
|
475
605
|
|
476
606
|
Returns:
|
477
|
-
Dict[str, str]: Dictionary containing spec id and release version
|
607
|
+
Dict[str, str]: Dictionary containing spec id and release version.
|
478
608
|
|
479
|
-
SCHEMA:
|
480
|
-
|
609
|
+
SCHEMA (body):
|
610
|
+
Information about providing image details in blocks can be found `here <https://docs.peak.ai/sdk/latest/snippets/press-examples.html#providing-image-details-for-block-specs>`__.
|
481
611
|
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
"
|
491
|
-
|
612
|
+
.. tabs::
|
613
|
+
|
614
|
+
.. tab:: Workflow Block Spec
|
615
|
+
|
616
|
+
.. code-block:: json
|
617
|
+
|
618
|
+
{
|
619
|
+
"release": {
|
620
|
+
"notes": "string",
|
621
|
+
"version": "string (required)",
|
622
|
+
},
|
623
|
+
"config": {
|
624
|
+
"images": {
|
625
|
+
"image-name": {
|
626
|
+
"version": "string",
|
627
|
+
"dockerfile": "string",
|
628
|
+
"context": "string",
|
629
|
+
"useCache": "boolean",
|
630
|
+
"buildArguments": {
|
631
|
+
"key (string)": "value (string)"
|
632
|
+
},
|
633
|
+
}
|
634
|
+
},
|
635
|
+
"steps": {
|
636
|
+
"stepName": {
|
637
|
+
"type": "string",
|
638
|
+
"image": {
|
639
|
+
"version": "string",
|
640
|
+
"dockerfile": "string",
|
641
|
+
"context": "string",
|
642
|
+
"useCache": "boolean",
|
643
|
+
"buildArguments": {
|
644
|
+
"key (string)": "value (string)"
|
645
|
+
},
|
646
|
+
"secrets": []
|
647
|
+
}
|
648
|
+
"imageRef": "string",
|
649
|
+
"imageDetails": {
|
650
|
+
"id": "number (required)",
|
651
|
+
"versionId": "number"
|
652
|
+
},
|
653
|
+
"command": "string (required)",
|
654
|
+
"resources": {
|
655
|
+
"instanceTypeId": "number",
|
656
|
+
"storage": "string"
|
657
|
+
},
|
658
|
+
"parents": [],
|
659
|
+
"stepTimeout": "number",
|
660
|
+
"clearImageCache": "boolean",
|
661
|
+
"repository": {
|
662
|
+
"branch": "string",
|
663
|
+
"token": "string",
|
664
|
+
"url": "string"
|
665
|
+
},
|
666
|
+
"runConfiguration": {
|
667
|
+
"retryOptions": {
|
668
|
+
"duration": "number",
|
669
|
+
"exitCodes": [],
|
670
|
+
"exponentialBackoff": "boolean",
|
671
|
+
"numberOfRetries": "number"
|
672
|
+
},
|
673
|
+
"skipConfiguration": {
|
674
|
+
"skip": "boolean",
|
675
|
+
"skipDAG": "boolean",
|
676
|
+
}
|
677
|
+
},
|
678
|
+
"parameters": {
|
679
|
+
"env": {
|
680
|
+
"key (string)": "value (string)"
|
681
|
+
},
|
682
|
+
"secrets": [],
|
683
|
+
},
|
684
|
+
"outputParameters": {
|
685
|
+
"key (string)": "value (string)"
|
686
|
+
},
|
687
|
+
"executionParameters": {
|
688
|
+
"conditional": [
|
689
|
+
{
|
690
|
+
"condition": "string",
|
691
|
+
"paramName": "string",
|
692
|
+
"stepName": "string",
|
693
|
+
"value": "string"
|
694
|
+
}
|
695
|
+
],
|
696
|
+
"parentStatus": [
|
697
|
+
{
|
698
|
+
"condition": "string",
|
699
|
+
"parents": [],
|
700
|
+
"status": []
|
701
|
+
}
|
702
|
+
]
|
703
|
+
}
|
704
|
+
}
|
492
705
|
},
|
706
|
+
"triggers": [
|
707
|
+
{
|
708
|
+
"cron": "string"
|
709
|
+
},
|
710
|
+
{
|
711
|
+
"webhook": "boolean"
|
712
|
+
}
|
713
|
+
],
|
714
|
+
"watchers": [
|
715
|
+
{
|
716
|
+
"events": {
|
717
|
+
"success": "boolean",
|
718
|
+
"fail": "boolean",
|
719
|
+
"runtimeExceeded": "number"
|
720
|
+
},
|
721
|
+
"user": "string",
|
722
|
+
},
|
723
|
+
{
|
724
|
+
"events": {
|
725
|
+
"success": "boolean",
|
726
|
+
"fail": "boolean",
|
727
|
+
"runtimeExceeded": "number"
|
728
|
+
},
|
729
|
+
"webhook": {
|
730
|
+
"name": "string(required)",
|
731
|
+
"url": "string(required)",
|
732
|
+
"payload": "string(required)"
|
733
|
+
}
|
734
|
+
},
|
735
|
+
{
|
736
|
+
"events": {
|
737
|
+
"success": "boolean",
|
738
|
+
"fail": "boolean",
|
739
|
+
"runtimeExceeded": "number"
|
740
|
+
},
|
741
|
+
"email": {
|
742
|
+
"name": "string",
|
743
|
+
"recipients": {
|
744
|
+
"to": ["string"]
|
745
|
+
}
|
746
|
+
}
|
747
|
+
}
|
748
|
+
],
|
493
749
|
}
|
494
|
-
}
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
750
|
+
}
|
751
|
+
|
752
|
+
.. tab:: Service Block Spec
|
753
|
+
|
754
|
+
.. code-block:: json
|
755
|
+
|
756
|
+
{
|
757
|
+
"release": {
|
758
|
+
"notes": "string",
|
759
|
+
"version": "string (required)",
|
760
|
+
},
|
761
|
+
"config": {
|
762
|
+
"serviceType": "string",
|
763
|
+
"image": {
|
764
|
+
"version": "string",
|
765
|
+
"dockerfile": "string",
|
766
|
+
"context": "string",
|
767
|
+
"useCache": "boolean",
|
768
|
+
"buildArguments": {
|
769
|
+
"key (string)": "value (string)"
|
770
|
+
},
|
771
|
+
"secrets": []
|
772
|
+
},
|
773
|
+
"imageDetails": {
|
774
|
+
"id": "number (required)",
|
775
|
+
"versionId": "number"
|
776
|
+
},
|
501
777
|
"resources": {
|
502
|
-
"instanceTypeId": "number",
|
503
|
-
"storage": "string"
|
778
|
+
"instanceTypeId": "number (required)",
|
504
779
|
},
|
505
|
-
"parents": [],
|
506
|
-
"stepTimeout": "number",
|
507
|
-
"clearImageCache": "boolean",
|
508
780
|
"parameters": {
|
509
781
|
"env": {
|
510
782
|
"key (string)": "value (string)"
|
511
783
|
},
|
512
|
-
"secrets": []
|
784
|
+
"secrets": []
|
513
785
|
},
|
514
|
-
"
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
}
|
786
|
+
"sessionStickiness": "boolean (only for web-app service)",
|
787
|
+
"entrypoint": "string",
|
788
|
+
"healthCheckURL": "string",
|
789
|
+
"minInstances": "number. Default is 1 and maximum is 2",
|
519
790
|
}
|
520
791
|
}
|
521
|
-
"triggers": [
|
522
|
-
{
|
523
|
-
"cron": "string"
|
524
|
-
},
|
525
|
-
{
|
526
|
-
"webhook": "boolean"
|
527
|
-
}
|
528
|
-
],
|
529
|
-
"watchers": [
|
530
|
-
{
|
531
|
-
"events": {
|
532
|
-
"success": "boolean",
|
533
|
-
"fail": "boolean",
|
534
|
-
"runtimeExceeded": "number"
|
535
|
-
},
|
536
|
-
"user": "string",
|
537
|
-
"webhook": {
|
538
|
-
"name": "string(required)",
|
539
|
-
"url": "string(required)",
|
540
|
-
"payload": "string(required)",
|
541
|
-
}
|
542
|
-
}
|
543
|
-
],
|
544
|
-
}
|
545
|
-
}
|
546
792
|
|
547
793
|
Raises:
|
548
794
|
BadRequestException: The given parameters are invalid.
|
@@ -558,6 +804,7 @@ class Block(BaseClient):
|
|
558
804
|
|
559
805
|
request_body = {
|
560
806
|
"spec": json.dumps(body),
|
807
|
+
"autoRunOnDeploy": json.dumps(auto_run_on_deploy),
|
561
808
|
}
|
562
809
|
|
563
810
|
if parameters:
|
@@ -582,8 +829,7 @@ class Block(BaseClient):
|
|
582
829
|
page_number: Optional[int] = None,
|
583
830
|
*,
|
584
831
|
return_iterator: Literal[False],
|
585
|
-
) -> Dict[str, Any]:
|
586
|
-
...
|
832
|
+
) -> Dict[str, Any]: ...
|
587
833
|
|
588
834
|
@overload
|
589
835
|
def list_spec_releases(
|
@@ -594,8 +840,7 @@ class Block(BaseClient):
|
|
594
840
|
page_number: Optional[int] = None,
|
595
841
|
*,
|
596
842
|
return_iterator: Literal[True] = True,
|
597
|
-
) -> Iterator[Dict[str, Any]]:
|
598
|
-
...
|
843
|
+
) -> Iterator[Dict[str, Any]]: ...
|
599
844
|
|
600
845
|
def list_spec_releases(
|
601
846
|
self,
|
@@ -774,8 +1019,7 @@ class Block(BaseClient):
|
|
774
1019
|
page_number: Optional[int] = None,
|
775
1020
|
*,
|
776
1021
|
return_iterator: Literal[False],
|
777
|
-
) -> Dict[str, Any]:
|
778
|
-
...
|
1022
|
+
) -> Dict[str, Any]: ...
|
779
1023
|
|
780
1024
|
@overload
|
781
1025
|
def list_deployments(
|
@@ -788,8 +1032,7 @@ class Block(BaseClient):
|
|
788
1032
|
page_number: Optional[int] = None,
|
789
1033
|
*,
|
790
1034
|
return_iterator: Literal[True] = True,
|
791
|
-
) -> Iterator[Dict[str, Any]]:
|
792
|
-
...
|
1035
|
+
) -> Iterator[Dict[str, Any]]: ...
|
793
1036
|
|
794
1037
|
def list_deployments(
|
795
1038
|
self,
|
@@ -1070,8 +1313,7 @@ class Block(BaseClient):
|
|
1070
1313
|
page_number: Optional[int] = None,
|
1071
1314
|
*,
|
1072
1315
|
return_iterator: Literal[False],
|
1073
|
-
) -> Dict[str, Any]:
|
1074
|
-
...
|
1316
|
+
) -> Dict[str, Any]: ...
|
1075
1317
|
|
1076
1318
|
@overload
|
1077
1319
|
def list_deployment_revisions(
|
@@ -1083,8 +1325,7 @@ class Block(BaseClient):
|
|
1083
1325
|
page_number: Optional[int] = None,
|
1084
1326
|
*,
|
1085
1327
|
return_iterator: Literal[True] = True,
|
1086
|
-
) -> Iterator[Dict[str, Any]]:
|
1087
|
-
...
|
1328
|
+
) -> Iterator[Dict[str, Any]]: ...
|
1088
1329
|
|
1089
1330
|
def list_deployment_revisions(
|
1090
1331
|
self,
|