peak-sdk 1.3.0__tar.gz → 1.5.0__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.
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/LICENSE +1 -1
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/PKG-INFO +6 -6
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/__init__.py +1 -1
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/_metadata.py +43 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/_version.py +1 -1
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/cli.py +3 -1
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/helpers.py +27 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/press/blocks/specs.py +0 -2
- peak_sdk-1.5.0/peak/cli/resources/services.py +632 -0
- peak_sdk-1.5.0/peak/cli/resources/users.py +71 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/resources/webapps.py +75 -14
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/resources/workflows.py +0 -4
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/helpers.py +27 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/output.py +9 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/press/blocks.py +10 -15
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/resources/__init__.py +2 -2
- peak_sdk-1.5.0/peak/resources/services.py +413 -0
- peak_sdk-1.5.0/peak/resources/users.py +93 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/resources/webapps.py +13 -7
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/resources/workflows.py +3 -7
- peak_sdk-1.5.0/peak/sample_yaml/resources/services/create_or_update_service.yaml +24 -0
- peak_sdk-1.5.0/peak/sample_yaml/resources/services/create_service.yaml +24 -0
- peak_sdk-1.5.0/peak/sample_yaml/resources/services/test_service.yaml +8 -0
- peak_sdk-1.5.0/peak/sample_yaml/resources/services/update_service.yaml +22 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/workflows/create_or_update_workflow.yaml +0 -1
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/workflows/update_workflow.yaml +0 -1
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/session.py +7 -4
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/template.py +2 -2
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/validators.py +34 -2
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/pypi-home.md +5 -5
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/pyproject.toml +3 -1
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/auth.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/base_client.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/callbacks.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/__init_.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/args.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/press/__init__.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/press/apps/__init__.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/press/apps/deployments.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/press/apps/specs.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/press/blocks/__init__.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/press/blocks/deployments.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/press/deployments.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/press/specs.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/resources/__init__.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/resources/artifacts.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/resources/images.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/resources/tenants.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/ruff.toml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/cli/version.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/compression.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/config.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/constants.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/exceptions.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/handler.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/logger.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/press/__init__.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/press/apps.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/press/deployments.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/press/specs.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/py.typed +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/resources/artifacts.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/resources/images.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/resources/tenants.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/press/apps/deployments/create_app_deployment.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/press/apps/deployments/create_app_deployment_revision.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/press/apps/deployments/update_app_deployment_metadata.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/press/apps/specs/create_app_spec.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/press/apps/specs/create_app_spec_release.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/press/apps/specs/update_app_spec_metadata.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/press/blocks/deployments/create_block_deployment.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/press/blocks/deployments/create_block_deployment_revision.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/press/blocks/deployments/patch_block_parameters.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/press/blocks/deployments/update_block_deployment_metadata.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/press/blocks/specs/create_block_spec.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/press/blocks/specs/create_block_spec_release.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/press/blocks/specs/update_block_spec_metadata.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/artifacts/create_artifact.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/artifacts/create_artifact_version.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/artifacts/update_artifact_metadata.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/images/dockerfile/create_image.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/images/dockerfile/create_image_version.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/images/dockerfile/update_version.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/images/github/create_image.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/images/github/create_image_version.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/images/github/update_version.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/images/upload/create_image.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/images/upload/create_image_version.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/images/upload/create_or_update_image.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/images/upload/update_version.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/webapps/create_or_update_webapp.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/webapps/create_webapp.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/webapps/update_webapp.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/workflows/create_workflow.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/workflows/execute_partial_workflow.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/workflows/execute_workflow.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/workflows/patch_workflow.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/workflows/workflow_auto_retry.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/workflows/workflow_execution_parameters.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/workflows/workflow_input_parameters.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/workflows/workflow_output_parameters.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/sample_yaml/resources/workflows/workflow_skippable_steps.yaml +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/telemetry.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/tools/__init__.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/tools/logging/__init__.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/tools/logging/log_handler.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/tools/logging/log_level.py +0 -0
- {peak_sdk-1.3.0 → peak_sdk-1.5.0}/peak/tools/logging/utils.py +0 -0
@@ -186,7 +186,7 @@
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
187
187
|
identification within third-party archives.
|
188
188
|
|
189
|
-
Copyright ©
|
189
|
+
Copyright © 2024 Peak-AI
|
190
190
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
192
192
|
you may not use this file except in compliance with the License.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: peak-sdk
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.5.0
|
4
4
|
Summary: Python SDK for interacting with the Peak platform
|
5
5
|
Home-page: https://docs.peak.ai/sdk
|
6
6
|
License: Apache-2.0
|
@@ -94,13 +94,13 @@ Follow these steps to create a virtual environment using Python's built-in `venv
|
|
94
94
|
echo "compinit" >> ~/.zshrc # replace .zshrc with your shell's configuration file
|
95
95
|
```
|
96
96
|
|
97
|
-
### Using the SDK
|
97
|
+
### Using the SDK and CLI
|
98
98
|
|
99
|
-
- To start using the SDK and CLI, you'll need either an API Key or
|
100
|
-
- If you don't have one yet, sign up for an account on the Peak platform to obtain your API key or Access token.
|
101
|
-
- To export it, run the following command in your terminal and replace <
|
99
|
+
- To start using the SDK and CLI, you'll need either an API Key or a Personal Access Token (PAT).
|
100
|
+
- If you don't have one yet, sign up for an account on the Peak platform to obtain your API key or Personal Access token (PAT).
|
101
|
+
- To export it, run the following command in your terminal and replace <peak_auth_token> with your actual API key or PAT:
|
102
102
|
```
|
103
|
-
export
|
103
|
+
export PEAK_AUTH_TOKEN=<peak_auth_token>
|
104
104
|
```
|
105
105
|
|
106
106
|
### Documentation
|
@@ -241,6 +241,37 @@ command_metadata: Dict[str, Any] = {
|
|
241
241
|
"subheader_key": "webappsCount",
|
242
242
|
},
|
243
243
|
},
|
244
|
+
"list_services": {
|
245
|
+
"table_params": {
|
246
|
+
"output_keys": {
|
247
|
+
"id": {
|
248
|
+
"label": "ID",
|
249
|
+
},
|
250
|
+
"name": {
|
251
|
+
"label": "Name",
|
252
|
+
},
|
253
|
+
"serviceType": {
|
254
|
+
"label": "Service Type",
|
255
|
+
},
|
256
|
+
"status": {
|
257
|
+
"label": "Status",
|
258
|
+
},
|
259
|
+
"updatedBy": {
|
260
|
+
"label": "Updated By",
|
261
|
+
},
|
262
|
+
"updatedAt": {
|
263
|
+
"label": "Updated At (UTC)",
|
264
|
+
},
|
265
|
+
"tags": {
|
266
|
+
"label": "Tags",
|
267
|
+
"parser": tag_parser,
|
268
|
+
},
|
269
|
+
},
|
270
|
+
"title": "Services",
|
271
|
+
"data_key": "services",
|
272
|
+
"subheader_key": "servicesCount",
|
273
|
+
},
|
274
|
+
},
|
244
275
|
"list_artifacts": {
|
245
276
|
"table_params": {
|
246
277
|
"output_keys": {
|
@@ -637,6 +668,18 @@ command_metadata: Dict[str, Any] = {
|
|
637
668
|
"create_or_update_webapp": {
|
638
669
|
"request_body_yaml_path": "sample_yaml/resources/webapps/create_or_update_webapp.yaml",
|
639
670
|
},
|
671
|
+
"create_service": {
|
672
|
+
"request_body_yaml_path": "sample_yaml/resources/services/create_service.yaml",
|
673
|
+
},
|
674
|
+
"update_service": {
|
675
|
+
"request_body_yaml_path": "sample_yaml/resources/services/update_service.yaml",
|
676
|
+
},
|
677
|
+
"create_or_update_service": {
|
678
|
+
"request_body_yaml_path": "sample_yaml/resources/services/create_or_update_service.yaml",
|
679
|
+
},
|
680
|
+
"test_service": {
|
681
|
+
"request_body_yaml_path": "sample_yaml/resources/services/test_service.yaml",
|
682
|
+
},
|
640
683
|
"create_app_spec": {
|
641
684
|
"request_body_yaml_path": "sample_yaml/press/apps/specs/create_app_spec.yaml",
|
642
685
|
},
|
@@ -25,7 +25,7 @@ import peak.config
|
|
25
25
|
import typer
|
26
26
|
from peak.cli import args, helpers
|
27
27
|
from peak.cli.press import apps, blocks, deployments, specs
|
28
|
-
from peak.cli.resources import artifacts, images, tenants, webapps, workflows
|
28
|
+
from peak.cli.resources import artifacts, images, services, tenants, users, webapps, workflows
|
29
29
|
from peak.constants import Sources
|
30
30
|
from peak.output import Writer
|
31
31
|
|
@@ -37,11 +37,13 @@ typer_app.add_typer(images.app, name="images")
|
|
37
37
|
typer_app.add_typer(artifacts.app, name="artifacts")
|
38
38
|
typer_app.add_typer(workflows.app, name="workflows")
|
39
39
|
typer_app.add_typer(webapps.app, name="webapps")
|
40
|
+
typer_app.add_typer(services.app, name="services")
|
40
41
|
typer_app.add_typer(tenants.app, name="tenants")
|
41
42
|
typer_app.add_typer(apps.app, name="apps")
|
42
43
|
typer_app.add_typer(blocks.app, name="blocks")
|
43
44
|
typer_app.add_typer(specs.app, name="specs")
|
44
45
|
typer_app.add_typer(deployments.app, name="deployments")
|
46
|
+
typer_app.add_typer(users.app, name="users")
|
45
47
|
|
46
48
|
|
47
49
|
@typer_app.callback()
|
@@ -189,6 +189,31 @@ def parse_build_arguments(build_arguments: List[str]) -> List[Dict[str, str]]:
|
|
189
189
|
return parsed_build_arguments
|
190
190
|
|
191
191
|
|
192
|
+
def parse_envs(env: List[str]) -> Dict[str, str]:
|
193
|
+
"""Parses envs provided via cli args to the format {arg1: value1}.
|
194
|
+
|
195
|
+
Args:
|
196
|
+
env (List[str]): List of envs provided via cli args.
|
197
|
+
|
198
|
+
Returns:
|
199
|
+
Dict[str, str]: Envs in the required format.
|
200
|
+
|
201
|
+
Raises:
|
202
|
+
BadParameterException: If a value is invalid.
|
203
|
+
"""
|
204
|
+
parsed_envs: Dict[str, str] = {}
|
205
|
+
for env_arg in env:
|
206
|
+
try:
|
207
|
+
key, value = env_arg.split("=", 1)
|
208
|
+
except ValueError as err:
|
209
|
+
raise BadParameterException(
|
210
|
+
env_arg,
|
211
|
+
message="Invalid env format. It should in the --env arg1=value1 format",
|
212
|
+
) from err
|
213
|
+
parsed_envs[key] = value
|
214
|
+
return parsed_envs
|
215
|
+
|
216
|
+
|
192
217
|
def format_logs(logs: List[Dict[str, Any]]) -> str:
|
193
218
|
"""Formats logs into a readable format.
|
194
219
|
|
@@ -223,7 +248,9 @@ def get_client(command: str) -> base_client.BaseClient:
|
|
223
248
|
"artifacts": resources.artifacts,
|
224
249
|
"images": resources.images,
|
225
250
|
"workflows": resources.workflows,
|
251
|
+
"services": resources.services,
|
226
252
|
"webapps": resources.webapps,
|
227
253
|
"tenants": resources.tenants,
|
254
|
+
"users": resources.users,
|
228
255
|
}
|
229
256
|
return command_client_map[command].get_client() # type: ignore[no-any-return]
|
@@ -165,7 +165,6 @@ def create(
|
|
165
165
|
- cron (string | required: false): A valid cron expression.
|
166
166
|
webhook (boolean | required: false): Should be true if webhook type trigger is to be used.
|
167
167
|
webhookId (string | required: false): ID of the webhook.
|
168
|
-
webhookPolicy (string | required: false): Policy of the webhook to be used. Should be one of "generate" or "preserve". It is "generate" by default.
|
169
168
|
watchers (list(map) | required: false):
|
170
169
|
- events (map):
|
171
170
|
success (boolean | required: false): Whether to call event on success.
|
@@ -430,7 +429,6 @@ def create_release(
|
|
430
429
|
cron (string | required: false): A valid cron expression.
|
431
430
|
webhook (boolean | required: false): Should be true if webhook type trigger is to be used.
|
432
431
|
webhookId (string | required: false): ID of the webhook.
|
433
|
-
webhookPolicy (string | required: false): Policy of the webhook to be used. Should be one of "generate" or "preserve". It is "generate" by default.
|
434
432
|
watchers (list(map) | required: false):
|
435
433
|
- events (map):
|
436
434
|
success (boolean | required: false): Whether to call event on success.
|