anyscale 0.26.48__py3-none-any.whl → 0.26.50__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.
- anyscale/_private/anyscale_client/README.md +115 -0
- anyscale/_private/anyscale_client/anyscale_client.py +11 -5
- anyscale/_private/docgen/__main__.py +7 -1
- anyscale/_private/workload/workload_sdk.py +2 -2
- anyscale/client/README.md +6 -1
- anyscale/client/openapi_client/__init__.py +4 -1
- anyscale/client/openapi_client/api/default_api.py +305 -4
- anyscale/client/openapi_client/models/__init__.py +4 -1
- anyscale/client/openapi_client/models/decorated_cloud_deployment.py +481 -0
- anyscale/client/openapi_client/models/decoratedclouddeployment_response.py +121 -0
- anyscale/client/openapi_client/models/metrics_query_response.py +121 -0
- anyscale/client/openapi_client/models/{clouddeployment_response.py → metricsqueryresponse_response.py} +11 -11
- anyscale/commands/cloud_commands.py +4 -1
- anyscale/controllers/kubernetes_verifier.py +5 -2
- anyscale/shared_anyscale_utils/headers.py +3 -0
- anyscale/version.py +1 -1
- {anyscale-0.26.48.dist-info → anyscale-0.26.50.dist-info}/METADATA +1 -1
- {anyscale-0.26.48.dist-info → anyscale-0.26.50.dist-info}/RECORD +23 -20
- {anyscale-0.26.48.dist-info → anyscale-0.26.50.dist-info}/WHEEL +0 -0
- {anyscale-0.26.48.dist-info → anyscale-0.26.50.dist-info}/entry_points.txt +0 -0
- {anyscale-0.26.48.dist-info → anyscale-0.26.50.dist-info}/licenses/LICENSE +0 -0
- {anyscale-0.26.48.dist-info → anyscale-0.26.50.dist-info}/licenses/NOTICE +0 -0
- {anyscale-0.26.48.dist-info → anyscale-0.26.50.dist-info}/top_level.txt +0 -0
@@ -7,6 +7,17 @@ The purpose of centralizing this logic is to:
|
|
7
7
|
- Keep all external dependencies in one place.
|
8
8
|
- Enable writing comprehensive unit tests for upstream components (without using mocks!) using the `FakeAnyscaleClient`.
|
9
9
|
|
10
|
+
## Installation
|
11
|
+
|
12
|
+
To install the anyscale client package in development mode:
|
13
|
+
|
14
|
+
```bash
|
15
|
+
cd frontend/cli
|
16
|
+
pip install -e .
|
17
|
+
```
|
18
|
+
|
19
|
+
This will install the `anyscale` package in editable mode, allowing you to make changes to the code and have them immediately available.
|
20
|
+
|
10
21
|
## Testing
|
11
22
|
|
12
23
|
The `AnyscaleClient` is tested using a fake version of the internal and external OpenAPI clients.
|
@@ -14,3 +25,107 @@ The `AnyscaleClient` is tested using a fake version of the internal and external
|
|
14
25
|
Upstream components should use the `FakeAnyscaleClient` to write their tests.
|
15
26
|
This client should mirror the behavior of the real `AnyscaleClient` as closely as possible (avoid making methods and functionality
|
16
27
|
complete "dummies").
|
28
|
+
|
29
|
+
### Running Tests
|
30
|
+
|
31
|
+
1. **Unit Tests**: Run the test suite to verify client functionality
|
32
|
+
```bash
|
33
|
+
cd frontend/cli
|
34
|
+
python -m pytest tests/unit/test_anyscale_client.py
|
35
|
+
```
|
36
|
+
|
37
|
+
2. **Integration Tests**: Test the client against the actual Anyscale API
|
38
|
+
```bash
|
39
|
+
# Set up your Anyscale credentials
|
40
|
+
export ANYSCALE_TOKEN="your_token_here"
|
41
|
+
|
42
|
+
# Run integration tests
|
43
|
+
python -m pytest tests/test_integrations.py
|
44
|
+
```
|
45
|
+
|
46
|
+
3. **All Client-Related Tests**: Run all tests that use the anyscale client
|
47
|
+
```bash
|
48
|
+
cd frontend/cli
|
49
|
+
python -m pytest tests/ -k "anyscale_client" -v
|
50
|
+
```
|
51
|
+
|
52
|
+
### Testing Job Submission
|
53
|
+
|
54
|
+
To test job submission functionality:
|
55
|
+
|
56
|
+
1. **Create a test job configuration file** (`job.yaml`):
|
57
|
+
```yaml
|
58
|
+
name: test-job
|
59
|
+
compute_config: default:1
|
60
|
+
working_dir: /path/to/working/directory
|
61
|
+
requirements:
|
62
|
+
- numpy==1.24.0
|
63
|
+
- pandas==2.0.0
|
64
|
+
entrypoint: python your_script.py
|
65
|
+
max_retries: 0
|
66
|
+
```
|
67
|
+
|
68
|
+
2. **Submit a test job**:
|
69
|
+
```bash
|
70
|
+
anyscale job submit -f job.yaml
|
71
|
+
```
|
72
|
+
|
73
|
+
3. **Monitor job status**:
|
74
|
+
```bash
|
75
|
+
anyscale job status <job_id>
|
76
|
+
```
|
77
|
+
|
78
|
+
4. **View job logs**:
|
79
|
+
```bash
|
80
|
+
anyscale job logs <job_id>
|
81
|
+
```
|
82
|
+
|
83
|
+
### Example Test Job
|
84
|
+
|
85
|
+
Here's an example job configuration for testing:
|
86
|
+
|
87
|
+
```yaml
|
88
|
+
name: generate-doggos-embeddings
|
89
|
+
compute_config: doggos-azure:1
|
90
|
+
working_dir: azure://cloud-dev-blob/org_7c1Kalm9WcX2bNIjW53GUT/cld_wgmfc248s6t7513awyubirlwu9/runtime_env_packages/pkg_b60e2d10615fb9845a9bad7d9307547a.zip
|
91
|
+
requirements:
|
92
|
+
- matplotlib==3.10.0
|
93
|
+
- torch==2.7.1
|
94
|
+
- transformers==4.52.3
|
95
|
+
- scikit-learn==1.6.0
|
96
|
+
- mlflow==2.19.0
|
97
|
+
- ipywidgets==8.1.3
|
98
|
+
entrypoint: python doggos/embed.py
|
99
|
+
max_retries: 0
|
100
|
+
```
|
101
|
+
|
102
|
+
### Testing with Fake Client
|
103
|
+
|
104
|
+
For unit testing components that depend on the Anyscale client:
|
105
|
+
|
106
|
+
```python
|
107
|
+
from anyscale._private.anyscale_client import FakeAnyscaleClient
|
108
|
+
|
109
|
+
# Create a fake client for testing
|
110
|
+
fake_client = FakeAnyscaleClient()
|
111
|
+
|
112
|
+
# Use the fake client in your tests
|
113
|
+
# The fake client should behave like the real client
|
114
|
+
result = fake_client.submit_job(job_config)
|
115
|
+
assert result.job_id is not None
|
116
|
+
```
|
117
|
+
|
118
|
+
### Debugging
|
119
|
+
|
120
|
+
- Use `--verbose` flag for detailed output: `anyscale job submit -f job.yaml --verbose`
|
121
|
+
- Check job status in the UI: The CLI will provide a URL to view the job in the Anyscale console
|
122
|
+
- Use `--wait` flag to wait for job completion and stream logs: `anyscale job submit -f job.yaml --wait`
|
123
|
+
|
124
|
+
### Common Issues
|
125
|
+
|
126
|
+
1. **Authentication**: Ensure your Anyscale token is properly set
|
127
|
+
2. **Network**: Check your internet connection and firewall settings
|
128
|
+
3. **Dependencies**: Verify all required packages are installed
|
129
|
+
4. **Job Configuration**: Ensure your YAML file is properly formatted
|
130
|
+
|
131
|
+
For more detailed testing scenarios, refer to the test files in the `tests/` directory.
|
@@ -1,5 +1,6 @@
|
|
1
1
|
from abc import ABC, abstractmethod
|
2
2
|
import contextlib
|
3
|
+
from datetime import datetime
|
3
4
|
from functools import wraps
|
4
5
|
import io
|
5
6
|
import json
|
@@ -1292,11 +1293,16 @@ class AnyscaleClient(AnyscaleClientInterface):
|
|
1292
1293
|
else:
|
1293
1294
|
# Default to HTTP PUT.
|
1294
1295
|
internal_logger.debug(f"Uploading file '{file_name}' to cloud storage.")
|
1295
|
-
headers =
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1296
|
+
headers = None
|
1297
|
+
if info.file_uri.startswith("azure"):
|
1298
|
+
headers = {
|
1299
|
+
"x-ms-blob-type": "BlockBlob",
|
1300
|
+
"x-ms-version": "2025-07-05",
|
1301
|
+
"x-ms-date": datetime.utcnow().strftime(
|
1302
|
+
"%a, %d %b %Y %H:%M:%S GMT"
|
1303
|
+
),
|
1304
|
+
"x-ms-blob-content-type": "application/zip",
|
1305
|
+
}
|
1300
1306
|
requests.put(
|
1301
1307
|
info.url, data=zip_file_bytes, headers=headers
|
1302
1308
|
).raise_for_status()
|
@@ -468,7 +468,13 @@ ALL_MODULES = [
|
|
468
468
|
GCPConfig,
|
469
469
|
KubernetesConfig,
|
470
470
|
],
|
471
|
-
cli_command_group_prefix={
|
471
|
+
cli_command_group_prefix={
|
472
|
+
cloud_commands.cloud_deployment_create: "deployment",
|
473
|
+
cloud_commands.cloud_deployment_get: "deployment",
|
474
|
+
cloud_commands.cloud_deployment_update: "deployment",
|
475
|
+
cloud_commands.cloud_deployment_delete: "deployment",
|
476
|
+
cloud_commands.cloud_config_update: "config",
|
477
|
+
},
|
472
478
|
legacy_sdk_commands={
|
473
479
|
# limited support, no replacement yet
|
474
480
|
"get_cloud": None,
|
@@ -143,8 +143,8 @@ class WorkloadSDK(BaseSDK):
|
|
143
143
|
return local_path_to_uri[target]
|
144
144
|
|
145
145
|
if has_multiple_cloud_deployments:
|
146
|
-
|
147
|
-
"
|
146
|
+
self.logger.warning(
|
147
|
+
"For compute configurations with multiple cloud deployments, local directories will only be uploaded to the object storage of the primary cloud deployment."
|
148
148
|
)
|
149
149
|
|
150
150
|
self.logger.info(f"Uploading local dir '{target}' to cloud storage.")
|
anyscale/client/README.md
CHANGED
@@ -308,6 +308,8 @@ Class | Method | HTTP request | Description
|
|
308
308
|
*DefaultApi* | [**put_workspace_proxied_dataplane_artifacts_api_v2_experimental_workspaces_workspace_id_proxied_dataplane_artifacts_put**](docs/DefaultApi.md#put_workspace_proxied_dataplane_artifacts_api_v2_experimental_workspaces_workspace_id_proxied_dataplane_artifacts_put) | **PUT** /api/v2/experimental_workspaces/{workspace_id}/proxied_dataplane_artifacts | Put Workspace Proxied Dataplane Artifacts
|
309
309
|
*DefaultApi* | [**put_workspace_wandb_run_details_api_v2_integrations_workspace_wandb_run_details_workspace_id_put**](docs/DefaultApi.md#put_workspace_wandb_run_details_api_v2_integrations_workspace_wandb_run_details_workspace_id_put) | **PUT** /api/v2/integrations/workspace_wandb_run_details/{workspace_id} | Put Workspace Wandb Run Details
|
310
310
|
*DefaultApi* | [**query_aggregated_logs_api_v2_logs_query_aggregated_logs_get**](docs/DefaultApi.md#query_aggregated_logs_api_v2_logs_query_aggregated_logs_get) | **GET** /api/v2/logs/query_aggregated_logs | Query Aggregated Logs
|
311
|
+
*DefaultApi* | [**query_api_v2_metrics_query_get**](docs/DefaultApi.md#query_api_v2_metrics_query_get) | **GET** /api/v2/metrics/query | Query
|
312
|
+
*DefaultApi* | [**query_range_api_v2_metrics_query_range_get**](docs/DefaultApi.md#query_range_api_v2_metrics_query_range_get) | **GET** /api/v2/metrics/query_range | Query Range
|
311
313
|
*DefaultApi* | [**receive_cli_usage_api_v2_cli_usage_post**](docs/DefaultApi.md#receive_cli_usage_api_v2_cli_usage_post) | **POST** /api/v2/cli_usage/ | Receive Cli Usage
|
312
314
|
*DefaultApi* | [**redirect_to_service_api_v2_sessions_cluster_id_services_get**](docs/DefaultApi.md#redirect_to_service_api_v2_sessions_cluster_id_services_get) | **GET** /api/v2/sessions/{cluster_id}/services | Redirect To Service
|
313
315
|
*DefaultApi* | [**redirect_to_tools_api_v2_services_v2_service_id_tools_get**](docs/DefaultApi.md#redirect_to_tools_api_v2_services_v2_service_id_tools_get) | **GET** /api/v2/services-v2/{service_id}/tools | Redirect To Tools
|
@@ -484,7 +486,6 @@ Class | Method | HTTP request | Description
|
|
484
486
|
- [ClouddatabucketpresigneduploadinfoResponse](docs/ClouddatabucketpresigneduploadinfoResponse.md)
|
485
487
|
- [ClouddatabucketpresignedurlresponseResponse](docs/ClouddatabucketpresignedurlresponseResponse.md)
|
486
488
|
- [ClouddeploymentListResponse](docs/ClouddeploymentListResponse.md)
|
487
|
-
- [ClouddeploymentResponse](docs/ClouddeploymentResponse.md)
|
488
489
|
- [ClouddeploymentconfigResponse](docs/ClouddeploymentconfigResponse.md)
|
489
490
|
- [CloudoverviewdashboardResponse](docs/CloudoverviewdashboardResponse.md)
|
490
491
|
- [CloudregionandzonesResponse](docs/CloudregionandzonesResponse.md)
|
@@ -583,6 +584,7 @@ Class | Method | HTTP request | Description
|
|
583
584
|
- [DatasetuploadResponse](docs/DatasetuploadResponse.md)
|
584
585
|
- [DecoratedApplicationTemplate](docs/DecoratedApplicationTemplate.md)
|
585
586
|
- [DecoratedBuild](docs/DecoratedBuild.md)
|
587
|
+
- [DecoratedCloudDeployment](docs/DecoratedCloudDeployment.md)
|
586
588
|
- [DecoratedComputeTemplate](docs/DecoratedComputeTemplate.md)
|
587
589
|
- [DecoratedComputeTemplateConfig](docs/DecoratedComputeTemplateConfig.md)
|
588
590
|
- [DecoratedInteractiveSession](docs/DecoratedInteractiveSession.md)
|
@@ -603,6 +605,7 @@ Class | Method | HTTP request | Description
|
|
603
605
|
- [DecoratedapplicationtemplateResponse](docs/DecoratedapplicationtemplateResponse.md)
|
604
606
|
- [DecoratedbuildListResponse](docs/DecoratedbuildListResponse.md)
|
605
607
|
- [DecoratedbuildResponse](docs/DecoratedbuildResponse.md)
|
608
|
+
- [DecoratedclouddeploymentResponse](docs/DecoratedclouddeploymentResponse.md)
|
606
609
|
- [DecoratedcomputetemplateListResponse](docs/DecoratedcomputetemplateListResponse.md)
|
607
610
|
- [DecoratedcomputetemplateResponse](docs/DecoratedcomputetemplateResponse.md)
|
608
611
|
- [DecoratedinteractivesessionListResponse](docs/DecoratedinteractivesessionListResponse.md)
|
@@ -748,6 +751,8 @@ Class | Method | HTTP request | Description
|
|
748
751
|
- [MachinepoolsearchresultListResponse](docs/MachinepoolsearchresultListResponse.md)
|
749
752
|
- [MachinestateinfoListResponse](docs/MachinestateinfoListResponse.md)
|
750
753
|
- [Metric](docs/Metric.md)
|
754
|
+
- [MetricsQueryResponse](docs/MetricsQueryResponse.md)
|
755
|
+
- [MetricsqueryresponseResponse](docs/MetricsqueryresponseResponse.md)
|
751
756
|
- [MetronomeCustomerInfoModel](docs/MetronomeCustomerInfoModel.md)
|
752
757
|
- [MetronomeDashboardType](docs/MetronomeDashboardType.md)
|
753
758
|
- [MetronomecustomerinfomodelListResponse](docs/MetronomecustomerinfomodelListResponse.md)
|
@@ -130,7 +130,6 @@ from openapi_client.models.cloudcollaborator_list_response import Cloudcollabora
|
|
130
130
|
from openapi_client.models.clouddatabucketpresigneduploadinfo_response import ClouddatabucketpresigneduploadinfoResponse
|
131
131
|
from openapi_client.models.clouddatabucketpresignedurlresponse_response import ClouddatabucketpresignedurlresponseResponse
|
132
132
|
from openapi_client.models.clouddeployment_list_response import ClouddeploymentListResponse
|
133
|
-
from openapi_client.models.clouddeployment_response import ClouddeploymentResponse
|
134
133
|
from openapi_client.models.clouddeploymentconfig_response import ClouddeploymentconfigResponse
|
135
134
|
from openapi_client.models.cloudoverviewdashboard_response import CloudoverviewdashboardResponse
|
136
135
|
from openapi_client.models.cloudregionandzones_response import CloudregionandzonesResponse
|
@@ -229,6 +228,7 @@ from openapi_client.models.dataset_upload import DatasetUpload
|
|
229
228
|
from openapi_client.models.datasetupload_response import DatasetuploadResponse
|
230
229
|
from openapi_client.models.decorated_application_template import DecoratedApplicationTemplate
|
231
230
|
from openapi_client.models.decorated_build import DecoratedBuild
|
231
|
+
from openapi_client.models.decorated_cloud_deployment import DecoratedCloudDeployment
|
232
232
|
from openapi_client.models.decorated_compute_template import DecoratedComputeTemplate
|
233
233
|
from openapi_client.models.decorated_compute_template_config import DecoratedComputeTemplateConfig
|
234
234
|
from openapi_client.models.decorated_interactive_session import DecoratedInteractiveSession
|
@@ -249,6 +249,7 @@ from openapi_client.models.decoratedapplicationtemplate_list_response import Dec
|
|
249
249
|
from openapi_client.models.decoratedapplicationtemplate_response import DecoratedapplicationtemplateResponse
|
250
250
|
from openapi_client.models.decoratedbuild_list_response import DecoratedbuildListResponse
|
251
251
|
from openapi_client.models.decoratedbuild_response import DecoratedbuildResponse
|
252
|
+
from openapi_client.models.decoratedclouddeployment_response import DecoratedclouddeploymentResponse
|
252
253
|
from openapi_client.models.decoratedcomputetemplate_list_response import DecoratedcomputetemplateListResponse
|
253
254
|
from openapi_client.models.decoratedcomputetemplate_response import DecoratedcomputetemplateResponse
|
254
255
|
from openapi_client.models.decoratedinteractivesession_list_response import DecoratedinteractivesessionListResponse
|
@@ -394,6 +395,8 @@ from openapi_client.models.machine_state_info import MachineStateInfo
|
|
394
395
|
from openapi_client.models.machinepoolsearchresult_list_response import MachinepoolsearchresultListResponse
|
395
396
|
from openapi_client.models.machinestateinfo_list_response import MachinestateinfoListResponse
|
396
397
|
from openapi_client.models.metric import Metric
|
398
|
+
from openapi_client.models.metrics_query_response import MetricsQueryResponse
|
399
|
+
from openapi_client.models.metricsqueryresponse_response import MetricsqueryresponseResponse
|
397
400
|
from openapi_client.models.metronome_customer_info_model import MetronomeCustomerInfoModel
|
398
401
|
from openapi_client.models.metronome_dashboard_type import MetronomeDashboardType
|
399
402
|
from openapi_client.models.metronomecustomerinfomodel_list_response import MetronomecustomerinfomodelListResponse
|
@@ -11748,7 +11748,7 @@ class DefaultApi(object):
|
|
11748
11748
|
number provided, it will be total request
|
11749
11749
|
timeout. It can also be a pair (tuple) of
|
11750
11750
|
(connection, read) timeouts.
|
11751
|
-
:return:
|
11751
|
+
:return: DecoratedclouddeploymentResponse
|
11752
11752
|
If the method is called asynchronously,
|
11753
11753
|
returns the request thread.
|
11754
11754
|
"""
|
@@ -11775,7 +11775,7 @@ class DefaultApi(object):
|
|
11775
11775
|
number provided, it will be total request
|
11776
11776
|
timeout. It can also be a pair (tuple) of
|
11777
11777
|
(connection, read) timeouts.
|
11778
|
-
:return: tuple(
|
11778
|
+
:return: tuple(DecoratedclouddeploymentResponse, status_code(int), headers(HTTPHeaderDict))
|
11779
11779
|
If the method is called asynchronously,
|
11780
11780
|
returns the request thread.
|
11781
11781
|
"""
|
@@ -11843,7 +11843,7 @@ class DefaultApi(object):
|
|
11843
11843
|
body=body_params,
|
11844
11844
|
post_params=form_params,
|
11845
11845
|
files=local_var_files,
|
11846
|
-
response_type='
|
11846
|
+
response_type='DecoratedclouddeploymentResponse', # noqa: E501
|
11847
11847
|
auth_settings=auth_settings,
|
11848
11848
|
async_req=local_var_params.get('async_req'),
|
11849
11849
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
@@ -21707,6 +21707,7 @@ class DefaultApi(object):
|
|
21707
21707
|
|
21708
21708
|
:param async_req bool: execute request asynchronously
|
21709
21709
|
:param str cloud_id: (required)
|
21710
|
+
:param bool via_edge_proxy:
|
21710
21711
|
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
21711
21712
|
be returned without reading/decoding response
|
21712
21713
|
data. Default is True.
|
@@ -21732,6 +21733,7 @@ class DefaultApi(object):
|
|
21732
21733
|
|
21733
21734
|
:param async_req bool: execute request asynchronously
|
21734
21735
|
:param str cloud_id: (required)
|
21736
|
+
:param bool via_edge_proxy:
|
21735
21737
|
:param _return_http_data_only: response data without head status code
|
21736
21738
|
and headers
|
21737
21739
|
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
@@ -21749,7 +21751,8 @@ class DefaultApi(object):
|
|
21749
21751
|
local_var_params = locals()
|
21750
21752
|
|
21751
21753
|
all_params = [
|
21752
|
-
'cloud_id'
|
21754
|
+
'cloud_id',
|
21755
|
+
'via_edge_proxy'
|
21753
21756
|
]
|
21754
21757
|
all_params.extend(
|
21755
21758
|
[
|
@@ -21780,6 +21783,8 @@ class DefaultApi(object):
|
|
21780
21783
|
path_params['cloud_id'] = local_var_params['cloud_id'] # noqa: E501
|
21781
21784
|
|
21782
21785
|
query_params = []
|
21786
|
+
if 'via_edge_proxy' in local_var_params and local_var_params['via_edge_proxy'] is not None: # noqa: E501
|
21787
|
+
query_params.append(('via_edge_proxy', local_var_params['via_edge_proxy'])) # noqa: E501
|
21783
21788
|
|
21784
21789
|
header_params = {}
|
21785
21790
|
|
@@ -28214,6 +28219,302 @@ class DefaultApi(object):
|
|
28214
28219
|
_request_timeout=local_var_params.get('_request_timeout'),
|
28215
28220
|
collection_formats=collection_formats)
|
28216
28221
|
|
28222
|
+
def query_api_v2_metrics_query_get(self, promql_query, **kwargs): # noqa: E501
|
28223
|
+
"""Query # noqa: E501
|
28224
|
+
|
28225
|
+
Query metrics using PromQL query for various resource types # noqa: E501
|
28226
|
+
This method makes a synchronous HTTP request by default. To make an
|
28227
|
+
asynchronous HTTP request, please pass async_req=True
|
28228
|
+
>>> thread = api.query_api_v2_metrics_query_get(promql_query, async_req=True)
|
28229
|
+
>>> result = thread.get()
|
28230
|
+
|
28231
|
+
:param async_req bool: execute request asynchronously
|
28232
|
+
:param str promql_query: PromQL query string to execute. This should be a valid Prometheus Query Language expression. (required)
|
28233
|
+
:param str cluster_id: The cluster id used to query metrics. Exactly one of cluster_id, workspace_id, ha_job_id, or service_id must be set.
|
28234
|
+
:param str workspace_id: The workspace id used to query metrics. Exactly one of cluster_id, workspace_id, ha_job_id, or service_id must be set.
|
28235
|
+
:param str ha_job_id: The production job id used to query metrics. Exactly one of cluster_id, workspace_id, ha_job_id, or service_id must be set.
|
28236
|
+
:param str service_id: The service id used to query metrics. Exactly one of cluster_id, workspace_id, ha_job_id, or service_id must be set.
|
28237
|
+
:param float time: Unix timestamp for the query time. If not provided, uses current time.
|
28238
|
+
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
28239
|
+
be returned without reading/decoding response
|
28240
|
+
data. Default is True.
|
28241
|
+
:param _request_timeout: timeout setting for this request. If one
|
28242
|
+
number provided, it will be total request
|
28243
|
+
timeout. It can also be a pair (tuple) of
|
28244
|
+
(connection, read) timeouts.
|
28245
|
+
:return: MetricsqueryresponseResponse
|
28246
|
+
If the method is called asynchronously,
|
28247
|
+
returns the request thread.
|
28248
|
+
"""
|
28249
|
+
kwargs['_return_http_data_only'] = True
|
28250
|
+
return self.query_api_v2_metrics_query_get_with_http_info(promql_query, **kwargs) # noqa: E501
|
28251
|
+
|
28252
|
+
def query_api_v2_metrics_query_get_with_http_info(self, promql_query, **kwargs): # noqa: E501
|
28253
|
+
"""Query # noqa: E501
|
28254
|
+
|
28255
|
+
Query metrics using PromQL query for various resource types # noqa: E501
|
28256
|
+
This method makes a synchronous HTTP request by default. To make an
|
28257
|
+
asynchronous HTTP request, please pass async_req=True
|
28258
|
+
>>> thread = api.query_api_v2_metrics_query_get_with_http_info(promql_query, async_req=True)
|
28259
|
+
>>> result = thread.get()
|
28260
|
+
|
28261
|
+
:param async_req bool: execute request asynchronously
|
28262
|
+
:param str promql_query: PromQL query string to execute. This should be a valid Prometheus Query Language expression. (required)
|
28263
|
+
:param str cluster_id: The cluster id used to query metrics. Exactly one of cluster_id, workspace_id, ha_job_id, or service_id must be set.
|
28264
|
+
:param str workspace_id: The workspace id used to query metrics. Exactly one of cluster_id, workspace_id, ha_job_id, or service_id must be set.
|
28265
|
+
:param str ha_job_id: The production job id used to query metrics. Exactly one of cluster_id, workspace_id, ha_job_id, or service_id must be set.
|
28266
|
+
:param str service_id: The service id used to query metrics. Exactly one of cluster_id, workspace_id, ha_job_id, or service_id must be set.
|
28267
|
+
:param float time: Unix timestamp for the query time. If not provided, uses current time.
|
28268
|
+
:param _return_http_data_only: response data without head status code
|
28269
|
+
and headers
|
28270
|
+
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
28271
|
+
be returned without reading/decoding response
|
28272
|
+
data. Default is True.
|
28273
|
+
:param _request_timeout: timeout setting for this request. If one
|
28274
|
+
number provided, it will be total request
|
28275
|
+
timeout. It can also be a pair (tuple) of
|
28276
|
+
(connection, read) timeouts.
|
28277
|
+
:return: tuple(MetricsqueryresponseResponse, status_code(int), headers(HTTPHeaderDict))
|
28278
|
+
If the method is called asynchronously,
|
28279
|
+
returns the request thread.
|
28280
|
+
"""
|
28281
|
+
|
28282
|
+
local_var_params = locals()
|
28283
|
+
|
28284
|
+
all_params = [
|
28285
|
+
'promql_query',
|
28286
|
+
'cluster_id',
|
28287
|
+
'workspace_id',
|
28288
|
+
'ha_job_id',
|
28289
|
+
'service_id',
|
28290
|
+
'time'
|
28291
|
+
]
|
28292
|
+
all_params.extend(
|
28293
|
+
[
|
28294
|
+
'async_req',
|
28295
|
+
'_return_http_data_only',
|
28296
|
+
'_preload_content',
|
28297
|
+
'_request_timeout'
|
28298
|
+
]
|
28299
|
+
)
|
28300
|
+
|
28301
|
+
for key, val in six.iteritems(local_var_params['kwargs']):
|
28302
|
+
if key not in all_params:
|
28303
|
+
raise ApiTypeError(
|
28304
|
+
"Got an unexpected keyword argument '%s'"
|
28305
|
+
" to method query_api_v2_metrics_query_get" % key
|
28306
|
+
)
|
28307
|
+
local_var_params[key] = val
|
28308
|
+
del local_var_params['kwargs']
|
28309
|
+
# verify the required parameter 'promql_query' is set
|
28310
|
+
if self.api_client.client_side_validation and ('promql_query' not in local_var_params or # noqa: E501
|
28311
|
+
local_var_params['promql_query'] is None): # noqa: E501
|
28312
|
+
raise ApiValueError("Missing the required parameter `promql_query` when calling `query_api_v2_metrics_query_get`") # noqa: E501
|
28313
|
+
|
28314
|
+
collection_formats = {}
|
28315
|
+
|
28316
|
+
path_params = {}
|
28317
|
+
|
28318
|
+
query_params = []
|
28319
|
+
if 'promql_query' in local_var_params and local_var_params['promql_query'] is not None: # noqa: E501
|
28320
|
+
query_params.append(('promql_query', local_var_params['promql_query'])) # noqa: E501
|
28321
|
+
if 'cluster_id' in local_var_params and local_var_params['cluster_id'] is not None: # noqa: E501
|
28322
|
+
query_params.append(('cluster_id', local_var_params['cluster_id'])) # noqa: E501
|
28323
|
+
if 'workspace_id' in local_var_params and local_var_params['workspace_id'] is not None: # noqa: E501
|
28324
|
+
query_params.append(('workspace_id', local_var_params['workspace_id'])) # noqa: E501
|
28325
|
+
if 'ha_job_id' in local_var_params and local_var_params['ha_job_id'] is not None: # noqa: E501
|
28326
|
+
query_params.append(('ha_job_id', local_var_params['ha_job_id'])) # noqa: E501
|
28327
|
+
if 'service_id' in local_var_params and local_var_params['service_id'] is not None: # noqa: E501
|
28328
|
+
query_params.append(('service_id', local_var_params['service_id'])) # noqa: E501
|
28329
|
+
if 'time' in local_var_params and local_var_params['time'] is not None: # noqa: E501
|
28330
|
+
query_params.append(('time', local_var_params['time'])) # noqa: E501
|
28331
|
+
|
28332
|
+
header_params = {}
|
28333
|
+
|
28334
|
+
form_params = []
|
28335
|
+
local_var_files = {}
|
28336
|
+
|
28337
|
+
body_params = None
|
28338
|
+
# HTTP header `Accept`
|
28339
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
28340
|
+
['application/json']) # noqa: E501
|
28341
|
+
|
28342
|
+
# Authentication setting
|
28343
|
+
auth_settings = [] # noqa: E501
|
28344
|
+
|
28345
|
+
return self.api_client.call_api(
|
28346
|
+
'/api/v2/metrics/query', 'GET',
|
28347
|
+
path_params,
|
28348
|
+
query_params,
|
28349
|
+
header_params,
|
28350
|
+
body=body_params,
|
28351
|
+
post_params=form_params,
|
28352
|
+
files=local_var_files,
|
28353
|
+
response_type='MetricsqueryresponseResponse', # noqa: E501
|
28354
|
+
auth_settings=auth_settings,
|
28355
|
+
async_req=local_var_params.get('async_req'),
|
28356
|
+
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
28357
|
+
_preload_content=local_var_params.get('_preload_content', True),
|
28358
|
+
_request_timeout=local_var_params.get('_request_timeout'),
|
28359
|
+
collection_formats=collection_formats)
|
28360
|
+
|
28361
|
+
def query_range_api_v2_metrics_query_range_get(self, promql_query, start, end, **kwargs): # noqa: E501
|
28362
|
+
"""Query Range # noqa: E501
|
28363
|
+
|
28364
|
+
Query metrics using PromQL range query for various resource types # noqa: E501
|
28365
|
+
This method makes a synchronous HTTP request by default. To make an
|
28366
|
+
asynchronous HTTP request, please pass async_req=True
|
28367
|
+
>>> thread = api.query_range_api_v2_metrics_query_range_get(promql_query, start, end, async_req=True)
|
28368
|
+
>>> result = thread.get()
|
28369
|
+
|
28370
|
+
:param async_req bool: execute request asynchronously
|
28371
|
+
:param str promql_query: PromQL query string to execute. This should be a valid Prometheus Query Language expression. (required)
|
28372
|
+
:param float start: Start timestamp (Unix timestamp) for the range query. (required)
|
28373
|
+
:param float end: End timestamp (Unix timestamp) for the range query. (required)
|
28374
|
+
:param str cluster_id: The cluster id used to query metrics. Exactly one of cluster_id, workspace_id, ha_job_id, or service_id must be set.
|
28375
|
+
:param str workspace_id: The workspace id used to query metrics. Exactly one of cluster_id, workspace_id, ha_job_id, or service_id must be set.
|
28376
|
+
:param str ha_job_id: The production job id used to query metrics. Exactly one of cluster_id, workspace_id, ha_job_id, or service_id must be set.
|
28377
|
+
:param str service_id: The service id used to query metrics. Exactly one of cluster_id, workspace_id, ha_job_id, or service_id must be set.
|
28378
|
+
:param str step: Query resolution step width in seconds (e.g., '15s', '1m', '5m').
|
28379
|
+
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
28380
|
+
be returned without reading/decoding response
|
28381
|
+
data. Default is True.
|
28382
|
+
:param _request_timeout: timeout setting for this request. If one
|
28383
|
+
number provided, it will be total request
|
28384
|
+
timeout. It can also be a pair (tuple) of
|
28385
|
+
(connection, read) timeouts.
|
28386
|
+
:return: MetricsqueryresponseResponse
|
28387
|
+
If the method is called asynchronously,
|
28388
|
+
returns the request thread.
|
28389
|
+
"""
|
28390
|
+
kwargs['_return_http_data_only'] = True
|
28391
|
+
return self.query_range_api_v2_metrics_query_range_get_with_http_info(promql_query, start, end, **kwargs) # noqa: E501
|
28392
|
+
|
28393
|
+
def query_range_api_v2_metrics_query_range_get_with_http_info(self, promql_query, start, end, **kwargs): # noqa: E501
|
28394
|
+
"""Query Range # noqa: E501
|
28395
|
+
|
28396
|
+
Query metrics using PromQL range query for various resource types # noqa: E501
|
28397
|
+
This method makes a synchronous HTTP request by default. To make an
|
28398
|
+
asynchronous HTTP request, please pass async_req=True
|
28399
|
+
>>> thread = api.query_range_api_v2_metrics_query_range_get_with_http_info(promql_query, start, end, async_req=True)
|
28400
|
+
>>> result = thread.get()
|
28401
|
+
|
28402
|
+
:param async_req bool: execute request asynchronously
|
28403
|
+
:param str promql_query: PromQL query string to execute. This should be a valid Prometheus Query Language expression. (required)
|
28404
|
+
:param float start: Start timestamp (Unix timestamp) for the range query. (required)
|
28405
|
+
:param float end: End timestamp (Unix timestamp) for the range query. (required)
|
28406
|
+
:param str cluster_id: The cluster id used to query metrics. Exactly one of cluster_id, workspace_id, ha_job_id, or service_id must be set.
|
28407
|
+
:param str workspace_id: The workspace id used to query metrics. Exactly one of cluster_id, workspace_id, ha_job_id, or service_id must be set.
|
28408
|
+
:param str ha_job_id: The production job id used to query metrics. Exactly one of cluster_id, workspace_id, ha_job_id, or service_id must be set.
|
28409
|
+
:param str service_id: The service id used to query metrics. Exactly one of cluster_id, workspace_id, ha_job_id, or service_id must be set.
|
28410
|
+
:param str step: Query resolution step width in seconds (e.g., '15s', '1m', '5m').
|
28411
|
+
:param _return_http_data_only: response data without head status code
|
28412
|
+
and headers
|
28413
|
+
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
28414
|
+
be returned without reading/decoding response
|
28415
|
+
data. Default is True.
|
28416
|
+
:param _request_timeout: timeout setting for this request. If one
|
28417
|
+
number provided, it will be total request
|
28418
|
+
timeout. It can also be a pair (tuple) of
|
28419
|
+
(connection, read) timeouts.
|
28420
|
+
:return: tuple(MetricsqueryresponseResponse, status_code(int), headers(HTTPHeaderDict))
|
28421
|
+
If the method is called asynchronously,
|
28422
|
+
returns the request thread.
|
28423
|
+
"""
|
28424
|
+
|
28425
|
+
local_var_params = locals()
|
28426
|
+
|
28427
|
+
all_params = [
|
28428
|
+
'promql_query',
|
28429
|
+
'start',
|
28430
|
+
'end',
|
28431
|
+
'cluster_id',
|
28432
|
+
'workspace_id',
|
28433
|
+
'ha_job_id',
|
28434
|
+
'service_id',
|
28435
|
+
'step'
|
28436
|
+
]
|
28437
|
+
all_params.extend(
|
28438
|
+
[
|
28439
|
+
'async_req',
|
28440
|
+
'_return_http_data_only',
|
28441
|
+
'_preload_content',
|
28442
|
+
'_request_timeout'
|
28443
|
+
]
|
28444
|
+
)
|
28445
|
+
|
28446
|
+
for key, val in six.iteritems(local_var_params['kwargs']):
|
28447
|
+
if key not in all_params:
|
28448
|
+
raise ApiTypeError(
|
28449
|
+
"Got an unexpected keyword argument '%s'"
|
28450
|
+
" to method query_range_api_v2_metrics_query_range_get" % key
|
28451
|
+
)
|
28452
|
+
local_var_params[key] = val
|
28453
|
+
del local_var_params['kwargs']
|
28454
|
+
# verify the required parameter 'promql_query' is set
|
28455
|
+
if self.api_client.client_side_validation and ('promql_query' not in local_var_params or # noqa: E501
|
28456
|
+
local_var_params['promql_query'] is None): # noqa: E501
|
28457
|
+
raise ApiValueError("Missing the required parameter `promql_query` when calling `query_range_api_v2_metrics_query_range_get`") # noqa: E501
|
28458
|
+
# verify the required parameter 'start' is set
|
28459
|
+
if self.api_client.client_side_validation and ('start' not in local_var_params or # noqa: E501
|
28460
|
+
local_var_params['start'] is None): # noqa: E501
|
28461
|
+
raise ApiValueError("Missing the required parameter `start` when calling `query_range_api_v2_metrics_query_range_get`") # noqa: E501
|
28462
|
+
# verify the required parameter 'end' is set
|
28463
|
+
if self.api_client.client_side_validation and ('end' not in local_var_params or # noqa: E501
|
28464
|
+
local_var_params['end'] is None): # noqa: E501
|
28465
|
+
raise ApiValueError("Missing the required parameter `end` when calling `query_range_api_v2_metrics_query_range_get`") # noqa: E501
|
28466
|
+
|
28467
|
+
collection_formats = {}
|
28468
|
+
|
28469
|
+
path_params = {}
|
28470
|
+
|
28471
|
+
query_params = []
|
28472
|
+
if 'promql_query' in local_var_params and local_var_params['promql_query'] is not None: # noqa: E501
|
28473
|
+
query_params.append(('promql_query', local_var_params['promql_query'])) # noqa: E501
|
28474
|
+
if 'start' in local_var_params and local_var_params['start'] is not None: # noqa: E501
|
28475
|
+
query_params.append(('start', local_var_params['start'])) # noqa: E501
|
28476
|
+
if 'end' in local_var_params and local_var_params['end'] is not None: # noqa: E501
|
28477
|
+
query_params.append(('end', local_var_params['end'])) # noqa: E501
|
28478
|
+
if 'cluster_id' in local_var_params and local_var_params['cluster_id'] is not None: # noqa: E501
|
28479
|
+
query_params.append(('cluster_id', local_var_params['cluster_id'])) # noqa: E501
|
28480
|
+
if 'workspace_id' in local_var_params and local_var_params['workspace_id'] is not None: # noqa: E501
|
28481
|
+
query_params.append(('workspace_id', local_var_params['workspace_id'])) # noqa: E501
|
28482
|
+
if 'ha_job_id' in local_var_params and local_var_params['ha_job_id'] is not None: # noqa: E501
|
28483
|
+
query_params.append(('ha_job_id', local_var_params['ha_job_id'])) # noqa: E501
|
28484
|
+
if 'service_id' in local_var_params and local_var_params['service_id'] is not None: # noqa: E501
|
28485
|
+
query_params.append(('service_id', local_var_params['service_id'])) # noqa: E501
|
28486
|
+
if 'step' in local_var_params and local_var_params['step'] is not None: # noqa: E501
|
28487
|
+
query_params.append(('step', local_var_params['step'])) # noqa: E501
|
28488
|
+
|
28489
|
+
header_params = {}
|
28490
|
+
|
28491
|
+
form_params = []
|
28492
|
+
local_var_files = {}
|
28493
|
+
|
28494
|
+
body_params = None
|
28495
|
+
# HTTP header `Accept`
|
28496
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
28497
|
+
['application/json']) # noqa: E501
|
28498
|
+
|
28499
|
+
# Authentication setting
|
28500
|
+
auth_settings = [] # noqa: E501
|
28501
|
+
|
28502
|
+
return self.api_client.call_api(
|
28503
|
+
'/api/v2/metrics/query_range', 'GET',
|
28504
|
+
path_params,
|
28505
|
+
query_params,
|
28506
|
+
header_params,
|
28507
|
+
body=body_params,
|
28508
|
+
post_params=form_params,
|
28509
|
+
files=local_var_files,
|
28510
|
+
response_type='MetricsqueryresponseResponse', # noqa: E501
|
28511
|
+
auth_settings=auth_settings,
|
28512
|
+
async_req=local_var_params.get('async_req'),
|
28513
|
+
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
28514
|
+
_preload_content=local_var_params.get('_preload_content', True),
|
28515
|
+
_request_timeout=local_var_params.get('_request_timeout'),
|
28516
|
+
collection_formats=collection_formats)
|
28517
|
+
|
28217
28518
|
def receive_cli_usage_api_v2_cli_usage_post(self, cli_usage_payload, **kwargs): # noqa: E501
|
28218
28519
|
"""Receive Cli Usage # noqa: E501
|
28219
28520
|
|
@@ -116,7 +116,6 @@ from openapi_client.models.cloudcollaborator_list_response import Cloudcollabora
|
|
116
116
|
from openapi_client.models.clouddatabucketpresigneduploadinfo_response import ClouddatabucketpresigneduploadinfoResponse
|
117
117
|
from openapi_client.models.clouddatabucketpresignedurlresponse_response import ClouddatabucketpresignedurlresponseResponse
|
118
118
|
from openapi_client.models.clouddeployment_list_response import ClouddeploymentListResponse
|
119
|
-
from openapi_client.models.clouddeployment_response import ClouddeploymentResponse
|
120
119
|
from openapi_client.models.clouddeploymentconfig_response import ClouddeploymentconfigResponse
|
121
120
|
from openapi_client.models.cloudoverviewdashboard_response import CloudoverviewdashboardResponse
|
122
121
|
from openapi_client.models.cloudregionandzones_response import CloudregionandzonesResponse
|
@@ -215,6 +214,7 @@ from openapi_client.models.dataset_upload import DatasetUpload
|
|
215
214
|
from openapi_client.models.datasetupload_response import DatasetuploadResponse
|
216
215
|
from openapi_client.models.decorated_application_template import DecoratedApplicationTemplate
|
217
216
|
from openapi_client.models.decorated_build import DecoratedBuild
|
217
|
+
from openapi_client.models.decorated_cloud_deployment import DecoratedCloudDeployment
|
218
218
|
from openapi_client.models.decorated_compute_template import DecoratedComputeTemplate
|
219
219
|
from openapi_client.models.decorated_compute_template_config import DecoratedComputeTemplateConfig
|
220
220
|
from openapi_client.models.decorated_interactive_session import DecoratedInteractiveSession
|
@@ -235,6 +235,7 @@ from openapi_client.models.decoratedapplicationtemplate_list_response import Dec
|
|
235
235
|
from openapi_client.models.decoratedapplicationtemplate_response import DecoratedapplicationtemplateResponse
|
236
236
|
from openapi_client.models.decoratedbuild_list_response import DecoratedbuildListResponse
|
237
237
|
from openapi_client.models.decoratedbuild_response import DecoratedbuildResponse
|
238
|
+
from openapi_client.models.decoratedclouddeployment_response import DecoratedclouddeploymentResponse
|
238
239
|
from openapi_client.models.decoratedcomputetemplate_list_response import DecoratedcomputetemplateListResponse
|
239
240
|
from openapi_client.models.decoratedcomputetemplate_response import DecoratedcomputetemplateResponse
|
240
241
|
from openapi_client.models.decoratedinteractivesession_list_response import DecoratedinteractivesessionListResponse
|
@@ -380,6 +381,8 @@ from openapi_client.models.machine_state_info import MachineStateInfo
|
|
380
381
|
from openapi_client.models.machinepoolsearchresult_list_response import MachinepoolsearchresultListResponse
|
381
382
|
from openapi_client.models.machinestateinfo_list_response import MachinestateinfoListResponse
|
382
383
|
from openapi_client.models.metric import Metric
|
384
|
+
from openapi_client.models.metrics_query_response import MetricsQueryResponse
|
385
|
+
from openapi_client.models.metricsqueryresponse_response import MetricsqueryresponseResponse
|
383
386
|
from openapi_client.models.metronome_customer_info_model import MetronomeCustomerInfoModel
|
384
387
|
from openapi_client.models.metronome_dashboard_type import MetronomeDashboardType
|
385
388
|
from openapi_client.models.metronomecustomerinfomodel_list_response import MetronomecustomerinfomodelListResponse
|