peak-sdk 1.16.1__tar.gz → 1.18.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.
Files changed (132) hide show
  1. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/PKG-INFO +4 -3
  2. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/_version.py +1 -1
  3. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/cli.py +2 -1
  4. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/helpers.py +1 -0
  5. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/metrics/metrics.py +104 -4
  6. peak_sdk-1.18.0/peak/cli/resources/cache.py +452 -0
  7. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/metrics/metrics.py +63 -3
  8. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/resources/__init__.py +2 -1
  9. peak_sdk-1.18.0/peak/resources/cache.py +650 -0
  10. peak_sdk-1.18.0/peak/sample_yaml/metrics/publish.yaml +11 -0
  11. peak_sdk-1.18.0/peak/sample_yaml/metrics/update-namespace.yaml +7 -0
  12. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/tools/logging/logger.py +13 -6
  13. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/pypi-home.md +2 -2
  14. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/pyproject.toml +3 -2
  15. peak_sdk-1.16.1/peak/sample_yaml/metrics/publish.yaml +0 -6
  16. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/LICENSE +0 -0
  17. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/__init__.py +0 -0
  18. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/_metadata.py +0 -0
  19. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/auth.py +0 -0
  20. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/base_client.py +0 -0
  21. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/callbacks.py +0 -0
  22. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/__init_.py +0 -0
  23. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/args.py +0 -0
  24. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/metrics/__init__.py +0 -0
  25. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/press/__init__.py +0 -0
  26. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/press/apps/__init__.py +0 -0
  27. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/press/apps/deployments.py +0 -0
  28. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/press/apps/specs.py +0 -0
  29. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/press/blocks/__init__.py +0 -0
  30. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/press/blocks/deployments.py +0 -0
  31. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/press/blocks/specs.py +0 -0
  32. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/press/deployments.py +0 -0
  33. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/press/specs.py +0 -0
  34. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/resources/__init__.py +0 -0
  35. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/resources/alerts/__init__.py +0 -0
  36. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/resources/alerts/emails.py +0 -0
  37. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/resources/artifacts.py +0 -0
  38. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/resources/images.py +0 -0
  39. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/resources/services.py +0 -0
  40. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/resources/tenants.py +0 -0
  41. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/resources/users.py +0 -0
  42. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/resources/webapps.py +0 -0
  43. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/resources/workflows.py +0 -0
  44. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/ruff.toml +0 -0
  45. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/cli/version.py +0 -0
  46. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/compression.py +0 -0
  47. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/config.py +0 -0
  48. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/constants.py +0 -0
  49. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/exceptions.py +0 -0
  50. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/handler.py +0 -0
  51. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/helpers.py +0 -0
  52. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/logger.py +0 -0
  53. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/metrics/__init__.py +0 -0
  54. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/output.py +0 -0
  55. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/press/__init__.py +0 -0
  56. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/press/apps.py +0 -0
  57. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/press/blocks.py +0 -0
  58. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/press/deployments.py +0 -0
  59. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/press/specs.py +0 -0
  60. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/py.typed +0 -0
  61. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/resources/alerts.py +0 -0
  62. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/resources/artifacts.py +0 -0
  63. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/resources/images.py +0 -0
  64. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/resources/services.py +0 -0
  65. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/resources/tenants.py +0 -0
  66. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/resources/users.py +0 -0
  67. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/resources/webapps.py +0 -0
  68. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/resources/workflows.py +0 -0
  69. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/metrics/create_collection.yaml +0 -0
  70. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/metrics/query.yaml +0 -0
  71. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/press/apps/deployments/create_app_deployment.yaml +0 -0
  72. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/press/apps/deployments/create_app_deployment_revision.yaml +0 -0
  73. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/press/apps/deployments/update_app_deployment_metadata.yaml +0 -0
  74. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/press/apps/specs/create_app_spec.yaml +0 -0
  75. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/press/apps/specs/create_app_spec_release.yaml +0 -0
  76. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/press/apps/specs/update_app_spec_metadata.yaml +0 -0
  77. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/press/blocks/deployments/create_block_deployment.yaml +0 -0
  78. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/press/blocks/deployments/create_block_deployment_revision.yaml +0 -0
  79. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/press/blocks/deployments/patch_block_parameters.yaml +0 -0
  80. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/press/blocks/deployments/update_block_deployment_metadata.yaml +0 -0
  81. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/press/blocks/specs/service/api/create_block_spec.yaml +0 -0
  82. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/press/blocks/specs/service/api/create_block_spec_release.yaml +0 -0
  83. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/press/blocks/specs/service/webapp/create_block_spec.yaml +0 -0
  84. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/press/blocks/specs/service/webapp/create_block_spec_release.yaml +0 -0
  85. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/press/blocks/specs/update_block_spec_metadata.yaml +0 -0
  86. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/press/blocks/specs/workflow/create_block_spec.yaml +0 -0
  87. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/press/blocks/specs/workflow/create_block_spec_release.yaml +0 -0
  88. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/press/deployments/patch_app_parameters_v2.yaml +0 -0
  89. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/press/deployments/patch_block_parameters_v2.yaml +0 -0
  90. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/press/patch_parameters.yaml +0 -0
  91. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/artifacts/create_artifact.yaml +0 -0
  92. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/artifacts/create_artifact_version.yaml +0 -0
  93. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/artifacts/update_artifact_metadata.yaml +0 -0
  94. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/emails/send_email.yaml +0 -0
  95. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/images/dockerfile/create_image.yaml +0 -0
  96. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/images/dockerfile/create_image_version.yaml +0 -0
  97. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/images/dockerfile/update_version.yaml +0 -0
  98. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/images/github/create_image.yaml +0 -0
  99. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/images/github/create_image_version.yaml +0 -0
  100. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/images/github/update_version.yaml +0 -0
  101. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/images/upload/create_image.yaml +0 -0
  102. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/images/upload/create_image_version.yaml +0 -0
  103. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/images/upload/create_or_update_image.yaml +0 -0
  104. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/images/upload/update_version.yaml +0 -0
  105. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/services/create_or_update_service.yaml +0 -0
  106. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/services/create_service.yaml +0 -0
  107. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/services/test_service.yaml +0 -0
  108. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/services/update_service.yaml +0 -0
  109. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/webapps/create_or_update_webapp.yaml +0 -0
  110. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/webapps/create_webapp.yaml +0 -0
  111. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/webapps/update_webapp.yaml +0 -0
  112. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/workflows/create_or_update_workflow.yaml +0 -0
  113. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/workflows/create_workflow.yaml +0 -0
  114. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/workflows/execute_partial_workflow.yaml +0 -0
  115. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/workflows/execute_workflow.yaml +0 -0
  116. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/workflows/patch_workflow.yaml +0 -0
  117. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/workflows/update_workflow.yaml +0 -0
  118. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/workflows/workflow_auto_retry.yaml +0 -0
  119. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/workflows/workflow_execution_parameters.yaml +0 -0
  120. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/workflows/workflow_input_parameters.yaml +0 -0
  121. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/workflows/workflow_input_parameters_inherit.yaml +0 -0
  122. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/workflows/workflow_output_parameters.yaml +0 -0
  123. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/sample_yaml/resources/workflows/workflow_skippable_steps.yaml +0 -0
  124. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/session.py +0 -0
  125. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/telemetry.py +0 -0
  126. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/template.py +0 -0
  127. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/tools/__init__.py +0 -0
  128. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/tools/logging/__init__.py +0 -0
  129. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/tools/logging/log_handler.py +0 -0
  130. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/tools/logging/log_level.py +0 -0
  131. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/tools/logging/utils.py +0 -0
  132. {peak_sdk-1.16.1 → peak_sdk-1.18.0}/peak/validators.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: peak-sdk
3
- Version: 1.16.1
3
+ Version: 1.18.0
4
4
  Summary: Python SDK for interacting with the Peak platform
5
5
  Home-page: https://docs.peak.ai/sdk/latest/
6
6
  License: Apache-2.0
@@ -31,6 +31,7 @@ Requires-Dist: shellingham (<1.5.4)
31
31
  Requires-Dist: structlog (>=24.2.0,<25.0.0)
32
32
  Requires-Dist: typer (>=0.12.4,<0.13.0)
33
33
  Requires-Dist: urllib3 (<2)
34
+ Requires-Dist: valkey (>=6.0.0,<7.0.0)
34
35
  Project-URL: Documentation, https://docs.peak.ai/sdk/latest/
35
36
  Description-Content-Type: text/markdown
36
37
 
@@ -106,7 +107,7 @@ Follow these steps to create a virtual environment using Python's built-in `venv
106
107
  This should return a response of the following format
107
108
 
108
109
  ```bash
109
- peak-cli==1.16.1
110
+ peak-cli==1.18.0
110
111
  Python==3.12.3
111
112
  System==Darwin(23.6.0)
112
113
  ```
@@ -122,7 +123,7 @@ Follow these steps to create a virtual environment using Python's built-in `venv
122
123
  This should print the version of the SDK
123
124
 
124
125
  ```
125
- 1.16.1
126
+ 1.18.0
126
127
  ```
127
128
 
128
129
  ### Using the SDK and CLI
@@ -18,4 +18,4 @@
18
18
  # # You should have received a copy of the APACHE LICENSE, VERSION 2.0
19
19
  # # along with this program. If not, see <https://apache.org/licenses/LICENSE-2.0>
20
20
  #
21
- __version__: str = "1.16.1"
21
+ __version__: str = "1.18.0"
@@ -26,7 +26,7 @@ import typer
26
26
  from peak.cli import args, helpers
27
27
  from peak.cli.metrics import metrics
28
28
  from peak.cli.press import apps, blocks, deployments, specs
29
- from peak.cli.resources import alerts, artifacts, images, services, tenants, users, webapps, workflows
29
+ from peak.cli.resources import alerts, artifacts, cache, images, services, tenants, users, webapps, workflows
30
30
  from peak.constants import Sources
31
31
  from peak.output import Writer
32
32
 
@@ -38,6 +38,7 @@ typer_app.add_typer(images.app, name="images")
38
38
  typer_app.add_typer(metrics.app, name="metrics")
39
39
  typer_app.add_typer(alerts.app, name="alerts")
40
40
  typer_app.add_typer(artifacts.app, name="artifacts")
41
+ typer_app.add_typer(cache.app, name="cache")
41
42
  typer_app.add_typer(workflows.app, name="workflows")
42
43
  typer_app.add_typer(webapps.app, name="webapps")
43
44
  typer_app.add_typer(services.app, name="services")
@@ -251,6 +251,7 @@ def get_client(command: str) -> base_client.BaseClient:
251
251
  "specs": press.specs,
252
252
  "deployments": press.deployments,
253
253
  "artifacts": resources.artifacts,
254
+ "cache": resources.cache,
254
255
  "images": resources.images,
255
256
  "workflows": resources.workflows,
256
257
  "services": resources.services,
@@ -50,6 +50,16 @@ _NAMESPACE = typer.Option(
50
50
  None,
51
51
  help="The namespace associated with the metrics. If not provided, the default namespace is used.",
52
52
  )
53
+
54
+ _NAMESPACE_DESCRIPTION = typer.Option(
55
+ None,
56
+ help="A description of the namespace.",
57
+ )
58
+
59
+ _NAMESPACE_METADATA = typer.Option(
60
+ None,
61
+ help="Key-value metadata associated with the namespace. Provide them in stringified JSON format.",
62
+ )
53
63
  _GENERATE_SQL = typer.Option(
54
64
  None,
55
65
  help="Indicates whether to return the SQL query instead of data. If `true`, the response will include the SQL query used to retrieve the metrics. Default is `false`.",
@@ -70,6 +80,10 @@ _TIME_DIMENSIONS = typer.Option(
70
80
  None,
71
81
  help="An array of time dimensions to include in the query. Time dimensions allow querying over specific time ranges with optional granularity (e.g., day, month, year). Provide them in stringified JSON format.",
72
82
  )
83
+ _SEARCH_TERM = typer.Option(
84
+ None,
85
+ help="A search term to filter the metrics. This can be used to search for specific metrics by name.",
86
+ )
73
87
  _SEGMENTS = typer.Option(
74
88
  None,
75
89
  help="An array of segments to include in the query. Segments represent pre-defined filters that can be applied to metrics. Provide them in stringified JSON format.",
@@ -145,6 +159,7 @@ def publish(
145
159
  params_file: str = args.TEMPLATE_PARAMS_FILE,
146
160
  params: List[str] = args.TEMPLATE_PARAMS,
147
161
  namespace: Optional[str] = _PUBLISH_NAMESPACE,
162
+ namespace_description: Optional[str] = _NAMESPACE_DESCRIPTION,
148
163
  artifact_path: Optional[str] = _ARTIFACT_PATH,
149
164
  collection_id: Optional[str] = _COLLECTION_ID,
150
165
  dry_run: Optional[bool] = DRY_RUN, # noqa: ARG001
@@ -156,6 +171,7 @@ def publish(
156
171
  The metrics can be published either by passing artifact and namespace,
157
172
  or by passing collection_id and namespace. If both artifact and collection_id
158
173
  are provided, artifact takes priority. If the namespace is not provided, the 'default' namespace is used.
174
+ Namespace metadata and Namespace description are optional.
159
175
 
160
176
  \b
161
177
  🧩 ***Input file schema(yaml):***<br/>
@@ -164,6 +180,9 @@ def publish(
164
180
  ```yaml
165
181
  body (map):
166
182
  namespace (str): The namespace associated with the metrics.
183
+ namespaceMetadata (map | required: false): Key-value metadata associated with the namespace.
184
+ namespaceDescription (str | required: false): A description of the namespace.
185
+
167
186
  artifact (map):
168
187
  path (str): Path to the artifact.
169
188
  ```
@@ -171,6 +190,9 @@ def publish(
171
190
  ```yaml
172
191
  body (map):
173
192
  namespace (str): The namespace associated with the metrics.
193
+ namespaceMetadata (map | required: false): Key-value metadata associated with the namespace.
194
+ namespaceDescription (str | required: false): A description of the namespace.
195
+
174
196
  collectionId (str): The ID of the collection to publish the metrics.
175
197
  ```
176
198
 
@@ -186,9 +208,10 @@ def publish(
186
208
  📝 ***Example usage without yaml:***
187
209
  ```bash
188
210
  # Publish metrics using artifact and namespace
189
- peak metrics publish --artifact-path <path> --namespace <namespace>
211
+ peak metrics publish --artifact-path <path> --namespace <namespace> --namespace-description "Metrics for pricing"
212
+
190
213
  # Publish metrics using collection id and namespace
191
- peak metrics publish --collection-id <collection-id> --namespace <namespace>
214
+ peak metrics publish --collection-id <collection-id> --namespace <namespace> --namespace-description "Metrics for pricing"
192
215
  ```
193
216
 
194
217
  \b
@@ -208,6 +231,7 @@ def publish(
208
231
 
209
232
  user_options: Dict[str, Any] = variables_to_dict(
210
233
  namespace,
234
+ namespace_description,
211
235
  )
212
236
 
213
237
  body: Dict[str, Any] = {}
@@ -358,7 +382,9 @@ def list_metrics(
358
382
  ctx: typer.Context,
359
383
  page_size: Optional[int] = args.PAGE_SIZE,
360
384
  page_number: Optional[int] = args.PAGE_NUMBER,
385
+ publication_id: Optional[str] = _PUBLICATION_ID,
361
386
  namespace: Optional[str] = _NAMESPACE,
387
+ search_term: Optional[str] = _SEARCH_TERM,
362
388
  type: Optional[str] = _METRIC_TYPES, # noqa: A002
363
389
  paging: Optional[bool] = PAGING, # noqa: ARG001
364
390
  output_type: Optional[OutputTypes] = OUTPUT_TYPES, # noqa: ARG001
@@ -368,7 +394,7 @@ def list_metrics(
368
394
  \b
369
395
  📝 ***Example usage:***<br/>
370
396
  ```bash
371
- peak metrics list --page-size 25 --page-number 1 --namespace <namespace> --type <type>
397
+ peak metrics list --page-size 25 --page-number 1 --namespace <namespace> --type <type> --search-term <search_term> --publication-id <publication_id>
372
398
  ```
373
399
 
374
400
  \b
@@ -429,11 +455,12 @@ def list_metrics(
429
455
  response = metric_client.list(
430
456
  page_size=page_size,
431
457
  page_number=page_number,
458
+ publication_id=publication_id,
432
459
  namespace=namespace,
460
+ search_term=search_term,
433
461
  type=type,
434
462
  return_iterator=False,
435
463
  )
436
-
437
464
  writer.write(response)
438
465
 
439
466
 
@@ -676,6 +703,11 @@ def list_namespaces(
676
703
  {
677
704
  "namespaces": [
678
705
  {
706
+ "description": "Default namespace",
707
+ "metadata": {
708
+ "owner": "abc",
709
+ "environment": "development"
710
+ },
679
711
  "name": "default",
680
712
  "models": [
681
713
  {
@@ -705,3 +737,71 @@ def list_namespaces(
705
737
  return_iterator=False,
706
738
  )
707
739
  writer.write(response)
740
+
741
+
742
+ @app.command(short_help="Update a namespace.")
743
+ def update_namespace(
744
+ ctx: typer.Context,
745
+ file: Annotated[
746
+ Optional[str],
747
+ typer.Argument(
748
+ ...,
749
+ help="Path to the file that defines the body for this operation, supports both `yaml` file or a `jinja` template.",
750
+ ),
751
+ ] = None,
752
+ params_file: Optional[str] = args.TEMPLATE_PARAMS_FILE,
753
+ params: Optional[List[str]] = args.TEMPLATE_PARAMS,
754
+ namespace: Optional[str] = typer.Option(None, help="The name of the namespace to update."),
755
+ description: Optional[str] = _NAMESPACE_DESCRIPTION,
756
+ dry_run: Optional[bool] = DRY_RUN, # noqa: ARG001
757
+ output_type: Optional[OutputTypesNoTable] = OUTPUT_TYPES, # noqa: ARG001
758
+ ) -> None:
759
+ """***Update*** a namespace with a new description and metadata.
760
+
761
+ \b
762
+ 📝 ***Example usage:***
763
+ ```bash
764
+ peak metrics update-namespace update-namespace.yaml --namespace new_namespace --description "Updated description"
765
+ ```
766
+
767
+ \b
768
+ 🆗 ***Response:***
769
+ ```json
770
+ {
771
+ "namespace": "new_namespace",
772
+ "description": "Updated description",
773
+ "message": "Updated namespace new_namespace",
774
+ "metadata": {
775
+ "key": "value"
776
+ }
777
+ }
778
+ ```
779
+ """
780
+ metrics_client: Metric = ctx.obj["client"]
781
+ writer: Writer = ctx.obj["writer"]
782
+
783
+ body: Dict[str, Any] = {}
784
+ if file:
785
+ body = helpers.template_handler(file=file, params_file=params_file, params=params)
786
+
787
+ cli_options: Dict[str, Any] = variables_to_dict(
788
+ namespace,
789
+ description,
790
+ )
791
+
792
+ updated_body = combine_dictionaries(body or {}, cli_options)
793
+
794
+ if not updated_body.get("namespace") and not namespace:
795
+ error_message = "Namespace must be provided either through file or CLI option."
796
+ raise typer.BadParameter(error_message)
797
+
798
+ final_namespace = updated_body.pop("namespace", namespace)
799
+ metadata = updated_body.get("metadata")
800
+
801
+ with writer.pager():
802
+ response = metrics_client.update_namespace(
803
+ namespace=final_namespace,
804
+ description=updated_body.get("description"),
805
+ metadata=metadata,
806
+ )
807
+ writer.write(response)