alchemy-python 0.1.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.
- alchemy/.fern/metadata.json +18 -0
- alchemy/CONTRIBUTING.md +125 -0
- alchemy/__init__.py +380 -0
- alchemy/_default_clients.py +30 -0
- alchemy/auth/__init__.py +4 -0
- alchemy/auth/client.py +767 -0
- alchemy/auth/raw_client.py +866 -0
- alchemy/client.py +717 -0
- alchemy/core/__init__.py +127 -0
- alchemy/core/api_error.py +23 -0
- alchemy/core/client_wrapper.py +155 -0
- alchemy/core/datetime_utils.py +70 -0
- alchemy/core/file.py +67 -0
- alchemy/core/force_multipart.py +18 -0
- alchemy/core/http_client.py +940 -0
- alchemy/core/http_response.py +63 -0
- alchemy/core/http_sse/__init__.py +42 -0
- alchemy/core/http_sse/_api.py +455 -0
- alchemy/core/http_sse/_decoders.py +74 -0
- alchemy/core/http_sse/_exceptions.py +7 -0
- alchemy/core/http_sse/_models.py +17 -0
- alchemy/core/jsonable_encoder.py +133 -0
- alchemy/core/logging.py +107 -0
- alchemy/core/oauth_token_provider.py +73 -0
- alchemy/core/parse_error.py +36 -0
- alchemy/core/pydantic_utilities.py +486 -0
- alchemy/core/query_encoder.py +58 -0
- alchemy/core/remove_none_from_dict.py +11 -0
- alchemy/core/request_options.py +40 -0
- alchemy/core/serialization.py +347 -0
- alchemy/environment.py +7 -0
- alchemy/function/__init__.py +34 -0
- alchemy/function/client.py +808 -0
- alchemy/function/raw_client.py +903 -0
- alchemy/function/version/__init__.py +4 -0
- alchemy/function/version/client.py +364 -0
- alchemy/function/version/raw_client.py +410 -0
- alchemy/host/__init__.py +4 -0
- alchemy/host/client.py +227 -0
- alchemy/host/raw_client.py +242 -0
- alchemy/instance/__init__.py +4 -0
- alchemy/instance/client.py +136 -0
- alchemy/instance/raw_client.py +141 -0
- alchemy/invocation/__init__.py +4 -0
- alchemy/invocation/client.py +570 -0
- alchemy/invocation/raw_client.py +636 -0
- alchemy/member/__init__.py +4 -0
- alchemy/member/client.py +441 -0
- alchemy/member/raw_client.py +504 -0
- alchemy/metrics/__init__.py +4 -0
- alchemy/metrics/client.py +428 -0
- alchemy/metrics/raw_client.py +478 -0
- alchemy/py.typed +0 -0
- alchemy/raw_client.py +138 -0
- alchemy/reference.md +3300 -0
- alchemy/runtime/__init__.py +4 -0
- alchemy/runtime/client.py +141 -0
- alchemy/runtime/raw_client.py +140 -0
- alchemy/service_account/__init__.py +4 -0
- alchemy/service_account/client.py +429 -0
- alchemy/service_account/raw_client.py +490 -0
- alchemy/template/__init__.py +4 -0
- alchemy/template/client.py +141 -0
- alchemy/template/raw_client.py +140 -0
- alchemy/types/__init__.py +344 -0
- alchemy/types/auth_v1accept_invite_response.py +5 -0
- alchemy/types/auth_v1create_service_account_response.py +34 -0
- alchemy/types/auth_v1get_auth_config_request.py +5 -0
- alchemy/types/auth_v1get_auth_config_response.py +53 -0
- alchemy/types/auth_v1get_session_request.py +9 -0
- alchemy/types/auth_v1get_session_response.py +28 -0
- alchemy/types/auth_v1get_token_response.py +29 -0
- alchemy/types/auth_v1invite_member_response.py +29 -0
- alchemy/types/auth_v1list_members_request.py +5 -0
- alchemy/types/auth_v1list_members_response.py +34 -0
- alchemy/types/auth_v1list_service_accounts_request.py +5 -0
- alchemy/types/auth_v1list_service_accounts_response.py +29 -0
- alchemy/types/auth_v1login_response.py +5 -0
- alchemy/types/auth_v1logout_request.py +8 -0
- alchemy/types/auth_v1logout_response.py +5 -0
- alchemy/types/auth_v1member.py +31 -0
- alchemy/types/auth_v1register_response.py +23 -0
- alchemy/types/auth_v1remove_member_response.py +5 -0
- alchemy/types/auth_v1remove_service_account_response.py +5 -0
- alchemy/types/auth_v1role.py +5 -0
- alchemy/types/auth_v1rotate_service_account_secret_response.py +31 -0
- alchemy/types/auth_v1service_account.py +35 -0
- alchemy/types/auth_v1set_member_role_response.py +5 -0
- alchemy/types/connect_error.py +38 -0
- alchemy/types/connect_error_code.py +25 -0
- alchemy/types/connect_error_details_any.py +36 -0
- alchemy/types/connect_protocol_version.py +5 -0
- alchemy/types/connect_timeout_header.py +6 -0
- alchemy/types/functions_v1arrow_contract.py +50 -0
- alchemy/types/functions_v1contract.py +8 -0
- alchemy/types/functions_v1contract_arrow.py +20 -0
- alchemy/types/functions_v1contract_json_schema.py +26 -0
- alchemy/types/functions_v1contract_violation.py +32 -0
- alchemy/types/functions_v1create_function_response.py +22 -0
- alchemy/types/functions_v1create_function_version_response.py +20 -0
- alchemy/types/functions_v1delete_function_response.py +5 -0
- alchemy/types/functions_v1function.py +100 -0
- alchemy/types/functions_v1function_error.py +30 -0
- alchemy/types/functions_v1function_error_kind.py +15 -0
- alchemy/types/functions_v1function_spec.py +58 -0
- alchemy/types/functions_v1function_version.py +81 -0
- alchemy/types/functions_v1function_version_status.py +13 -0
- alchemy/types/functions_v1get_function_response.py +20 -0
- alchemy/types/functions_v1get_function_version_response.py +20 -0
- alchemy/types/functions_v1get_host_request.py +5 -0
- alchemy/types/functions_v1get_host_response.py +20 -0
- alchemy/types/functions_v1get_invocation_logs_request.py +31 -0
- alchemy/types/functions_v1get_invocation_logs_response.py +24 -0
- alchemy/types/functions_v1get_invocation_response.py +20 -0
- alchemy/types/functions_v1get_version_request.py +5 -0
- alchemy/types/functions_v1get_version_response.py +25 -0
- alchemy/types/functions_v1host.py +58 -0
- alchemy/types/functions_v1instance.py +54 -0
- alchemy/types/functions_v1instance_status.py +14 -0
- alchemy/types/functions_v1invocation.py +106 -0
- alchemy/types/functions_v1invocation_protocol.py +8 -0
- alchemy/types/functions_v1invocation_stats.py +41 -0
- alchemy/types/functions_v1invocation_status.py +18 -0
- alchemy/types/functions_v1invoke_async_response.py +34 -0
- alchemy/types/functions_v1invoke_response.py +8 -0
- alchemy/types/functions_v1invoke_response_error.py +20 -0
- alchemy/types/functions_v1invoke_response_output.py +19 -0
- alchemy/types/functions_v1json_schema_contract.py +28 -0
- alchemy/types/functions_v1list_function_versions_response.py +22 -0
- alchemy/types/functions_v1list_functions_response.py +22 -0
- alchemy/types/functions_v1list_hosts_request.py +5 -0
- alchemy/types/functions_v1list_hosts_response.py +23 -0
- alchemy/types/functions_v1list_instances_response.py +20 -0
- alchemy/types/functions_v1list_invocations_response.py +22 -0
- alchemy/types/functions_v1list_runtimes_request.py +5 -0
- alchemy/types/functions_v1list_runtimes_response.py +22 -0
- alchemy/types/functions_v1list_templates_request.py +5 -0
- alchemy/types/functions_v1list_templates_response.py +20 -0
- alchemy/types/functions_v1network.py +5 -0
- alchemy/types/functions_v1pagination_request.py +31 -0
- alchemy/types/functions_v1pagination_response.py +33 -0
- alchemy/types/functions_v1resources.py +28 -0
- alchemy/types/functions_v1runtime.py +59 -0
- alchemy/types/functions_v1runtime_starters.py +29 -0
- alchemy/types/functions_v1source.py +31 -0
- alchemy/types/functions_v1source_file.py +28 -0
- alchemy/types/functions_v1source_layer.py +27 -0
- alchemy/types/functions_v1source_limits.py +30 -0
- alchemy/types/functions_v1start_kind.py +8 -0
- alchemy/types/functions_v1tail_invocations_request.py +32 -0
- alchemy/types/functions_v1tail_invocations_response.py +34 -0
- alchemy/types/functions_v1template.py +94 -0
- alchemy/types/functions_v1template_source.py +27 -0
- alchemy/types/functions_v1update_function_response.py +20 -0
- alchemy/types/google_protobuf_list_value.py +10 -0
- alchemy/types/google_protobuf_null_value.py +5 -0
- alchemy/types/google_protobuf_struct.py +10 -0
- alchemy/types/google_protobuf_value.py +5 -0
- alchemy/types/metrics_v1aggregate_row.py +24 -0
- alchemy/types/metrics_v1get_queue_response.py +25 -0
- alchemy/types/metrics_v1metric.py +16 -0
- alchemy/types/metrics_v1metric_dimension.py +14 -0
- alchemy/types/metrics_v1metric_filter.py +26 -0
- alchemy/types/metrics_v1metric_granularity.py +13 -0
- alchemy/types/metrics_v1query_aggregate_response.py +20 -0
- alchemy/types/metrics_v1query_timeseries_response.py +20 -0
- alchemy/types/metrics_v1timeseries.py +28 -0
- alchemy/types/metrics_v1timeseries_point.py +28 -0
- alchemy_python-0.1.0.dist-info/METADATA +196 -0
- alchemy_python-0.1.0.dist-info/RECORD +172 -0
- alchemy_python-0.1.0.dist-info/WHEEL +4 -0
- alchemy_python-0.1.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
+
from ..core.request_options import RequestOptions
|
|
7
|
+
from ..types.connect_timeout_header import ConnectTimeoutHeader
|
|
8
|
+
from ..types.metrics_v1get_queue_response import MetricsV1GetQueueResponse
|
|
9
|
+
from ..types.metrics_v1metric import MetricsV1Metric
|
|
10
|
+
from ..types.metrics_v1metric_dimension import MetricsV1MetricDimension
|
|
11
|
+
from ..types.metrics_v1metric_filter import MetricsV1MetricFilter
|
|
12
|
+
from ..types.metrics_v1metric_granularity import MetricsV1MetricGranularity
|
|
13
|
+
from ..types.metrics_v1query_aggregate_response import MetricsV1QueryAggregateResponse
|
|
14
|
+
from ..types.metrics_v1query_timeseries_response import MetricsV1QueryTimeseriesResponse
|
|
15
|
+
from .raw_client import AsyncRawMetricsClient, RawMetricsClient
|
|
16
|
+
|
|
17
|
+
# this is used as the default value for optional parameters
|
|
18
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class MetricsClient:
|
|
22
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
23
|
+
self._raw_client = RawMetricsClient(client_wrapper=client_wrapper)
|
|
24
|
+
|
|
25
|
+
@property
|
|
26
|
+
def with_raw_response(self) -> RawMetricsClient:
|
|
27
|
+
"""
|
|
28
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
29
|
+
|
|
30
|
+
Returns
|
|
31
|
+
-------
|
|
32
|
+
RawMetricsClient
|
|
33
|
+
"""
|
|
34
|
+
return self._raw_client
|
|
35
|
+
|
|
36
|
+
def get_queue(
|
|
37
|
+
self,
|
|
38
|
+
*,
|
|
39
|
+
connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
|
|
40
|
+
function_ids: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
41
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
42
|
+
) -> MetricsV1GetQueueResponse:
|
|
43
|
+
"""
|
|
44
|
+
GetQueue is what is in flight right now, from the queue rather than
|
|
45
|
+
the invocations table: invocations waiting to start, and running.
|
|
46
|
+
|
|
47
|
+
Parameters
|
|
48
|
+
----------
|
|
49
|
+
connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
|
|
50
|
+
Define the timeout, in ms
|
|
51
|
+
|
|
52
|
+
function_ids : typing.Optional[typing.Sequence[str]]
|
|
53
|
+
|
|
54
|
+
request_options : typing.Optional[RequestOptions]
|
|
55
|
+
Request-specific configuration.
|
|
56
|
+
|
|
57
|
+
Returns
|
|
58
|
+
-------
|
|
59
|
+
MetricsV1GetQueueResponse
|
|
60
|
+
Success
|
|
61
|
+
|
|
62
|
+
Examples
|
|
63
|
+
--------
|
|
64
|
+
from alchemy import Alchemy
|
|
65
|
+
|
|
66
|
+
client = Alchemy(
|
|
67
|
+
client_id="YOUR_CLIENT_ID",
|
|
68
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
69
|
+
)
|
|
70
|
+
client.metrics.get_queue(
|
|
71
|
+
connect_timeout_ms=1000.0,
|
|
72
|
+
)
|
|
73
|
+
"""
|
|
74
|
+
_response = self._raw_client.get_queue(
|
|
75
|
+
connect_timeout_ms=connect_timeout_ms, function_ids=function_ids, request_options=request_options
|
|
76
|
+
)
|
|
77
|
+
return _response.data
|
|
78
|
+
|
|
79
|
+
def query_aggregate(
|
|
80
|
+
self,
|
|
81
|
+
*,
|
|
82
|
+
connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
|
|
83
|
+
metrics: typing.Optional[typing.Sequence[MetricsV1Metric]] = OMIT,
|
|
84
|
+
since_ms: typing.Optional[str] = OMIT,
|
|
85
|
+
until_ms: typing.Optional[str] = OMIT,
|
|
86
|
+
group_by: typing.Optional[MetricsV1MetricDimension] = OMIT,
|
|
87
|
+
filters: typing.Optional[typing.Sequence[MetricsV1MetricFilter]] = OMIT,
|
|
88
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
89
|
+
) -> MetricsV1QueryAggregateResponse:
|
|
90
|
+
"""
|
|
91
|
+
Parameters
|
|
92
|
+
----------
|
|
93
|
+
connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
|
|
94
|
+
Define the timeout, in ms
|
|
95
|
+
|
|
96
|
+
metrics : typing.Optional[typing.Sequence[MetricsV1Metric]]
|
|
97
|
+
|
|
98
|
+
since_ms : typing.Optional[str]
|
|
99
|
+
inclusive
|
|
100
|
+
|
|
101
|
+
until_ms : typing.Optional[str]
|
|
102
|
+
exclusive; unset = now
|
|
103
|
+
|
|
104
|
+
group_by : typing.Optional[MetricsV1MetricDimension]
|
|
105
|
+
UNSPECIFIED = single total row, key ""
|
|
106
|
+
|
|
107
|
+
filters : typing.Optional[typing.Sequence[MetricsV1MetricFilter]]
|
|
108
|
+
|
|
109
|
+
request_options : typing.Optional[RequestOptions]
|
|
110
|
+
Request-specific configuration.
|
|
111
|
+
|
|
112
|
+
Returns
|
|
113
|
+
-------
|
|
114
|
+
MetricsV1QueryAggregateResponse
|
|
115
|
+
Success
|
|
116
|
+
|
|
117
|
+
Examples
|
|
118
|
+
--------
|
|
119
|
+
from alchemy import Alchemy
|
|
120
|
+
|
|
121
|
+
client = Alchemy(
|
|
122
|
+
client_id="YOUR_CLIENT_ID",
|
|
123
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
124
|
+
)
|
|
125
|
+
client.metrics.query_aggregate(
|
|
126
|
+
connect_timeout_ms=1000.0,
|
|
127
|
+
)
|
|
128
|
+
"""
|
|
129
|
+
_response = self._raw_client.query_aggregate(
|
|
130
|
+
connect_timeout_ms=connect_timeout_ms,
|
|
131
|
+
metrics=metrics,
|
|
132
|
+
since_ms=since_ms,
|
|
133
|
+
until_ms=until_ms,
|
|
134
|
+
group_by=group_by,
|
|
135
|
+
filters=filters,
|
|
136
|
+
request_options=request_options,
|
|
137
|
+
)
|
|
138
|
+
return _response.data
|
|
139
|
+
|
|
140
|
+
def query_timeseries(
|
|
141
|
+
self,
|
|
142
|
+
*,
|
|
143
|
+
connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
|
|
144
|
+
metrics: typing.Optional[typing.Sequence[MetricsV1Metric]] = OMIT,
|
|
145
|
+
since_ms: typing.Optional[str] = OMIT,
|
|
146
|
+
until_ms: typing.Optional[str] = OMIT,
|
|
147
|
+
granularity: typing.Optional[MetricsV1MetricGranularity] = OMIT,
|
|
148
|
+
tz_offset_minutes: typing.Optional[int] = OMIT,
|
|
149
|
+
group_by: typing.Optional[MetricsV1MetricDimension] = OMIT,
|
|
150
|
+
filters: typing.Optional[typing.Sequence[MetricsV1MetricFilter]] = OMIT,
|
|
151
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
152
|
+
) -> MetricsV1QueryTimeseriesResponse:
|
|
153
|
+
"""
|
|
154
|
+
Parameters
|
|
155
|
+
----------
|
|
156
|
+
connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
|
|
157
|
+
Define the timeout, in ms
|
|
158
|
+
|
|
159
|
+
metrics : typing.Optional[typing.Sequence[MetricsV1Metric]]
|
|
160
|
+
metrics are computed together per bucket; point values align with this
|
|
161
|
+
order positionally.
|
|
162
|
+
|
|
163
|
+
since_ms : typing.Optional[str]
|
|
164
|
+
inclusive
|
|
165
|
+
|
|
166
|
+
until_ms : typing.Optional[str]
|
|
167
|
+
exclusive; unset = now
|
|
168
|
+
|
|
169
|
+
granularity : typing.Optional[MetricsV1MetricGranularity]
|
|
170
|
+
|
|
171
|
+
tz_offset_minutes : typing.Optional[int]
|
|
172
|
+
tz_offset_minutes shifts bucket boundaries east of UTC so DAY buckets
|
|
173
|
+
match the viewer's local calendar day.
|
|
174
|
+
|
|
175
|
+
group_by : typing.Optional[MetricsV1MetricDimension]
|
|
176
|
+
UNSPECIFIED = one total series, key ""
|
|
177
|
+
|
|
178
|
+
filters : typing.Optional[typing.Sequence[MetricsV1MetricFilter]]
|
|
179
|
+
|
|
180
|
+
request_options : typing.Optional[RequestOptions]
|
|
181
|
+
Request-specific configuration.
|
|
182
|
+
|
|
183
|
+
Returns
|
|
184
|
+
-------
|
|
185
|
+
MetricsV1QueryTimeseriesResponse
|
|
186
|
+
Success
|
|
187
|
+
|
|
188
|
+
Examples
|
|
189
|
+
--------
|
|
190
|
+
from alchemy import Alchemy
|
|
191
|
+
|
|
192
|
+
client = Alchemy(
|
|
193
|
+
client_id="YOUR_CLIENT_ID",
|
|
194
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
195
|
+
)
|
|
196
|
+
client.metrics.query_timeseries(
|
|
197
|
+
connect_timeout_ms=1000.0,
|
|
198
|
+
)
|
|
199
|
+
"""
|
|
200
|
+
_response = self._raw_client.query_timeseries(
|
|
201
|
+
connect_timeout_ms=connect_timeout_ms,
|
|
202
|
+
metrics=metrics,
|
|
203
|
+
since_ms=since_ms,
|
|
204
|
+
until_ms=until_ms,
|
|
205
|
+
granularity=granularity,
|
|
206
|
+
tz_offset_minutes=tz_offset_minutes,
|
|
207
|
+
group_by=group_by,
|
|
208
|
+
filters=filters,
|
|
209
|
+
request_options=request_options,
|
|
210
|
+
)
|
|
211
|
+
return _response.data
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
class AsyncMetricsClient:
|
|
215
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
216
|
+
self._raw_client = AsyncRawMetricsClient(client_wrapper=client_wrapper)
|
|
217
|
+
|
|
218
|
+
@property
|
|
219
|
+
def with_raw_response(self) -> AsyncRawMetricsClient:
|
|
220
|
+
"""
|
|
221
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
222
|
+
|
|
223
|
+
Returns
|
|
224
|
+
-------
|
|
225
|
+
AsyncRawMetricsClient
|
|
226
|
+
"""
|
|
227
|
+
return self._raw_client
|
|
228
|
+
|
|
229
|
+
async def get_queue(
|
|
230
|
+
self,
|
|
231
|
+
*,
|
|
232
|
+
connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
|
|
233
|
+
function_ids: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
234
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
235
|
+
) -> MetricsV1GetQueueResponse:
|
|
236
|
+
"""
|
|
237
|
+
GetQueue is what is in flight right now, from the queue rather than
|
|
238
|
+
the invocations table: invocations waiting to start, and running.
|
|
239
|
+
|
|
240
|
+
Parameters
|
|
241
|
+
----------
|
|
242
|
+
connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
|
|
243
|
+
Define the timeout, in ms
|
|
244
|
+
|
|
245
|
+
function_ids : typing.Optional[typing.Sequence[str]]
|
|
246
|
+
|
|
247
|
+
request_options : typing.Optional[RequestOptions]
|
|
248
|
+
Request-specific configuration.
|
|
249
|
+
|
|
250
|
+
Returns
|
|
251
|
+
-------
|
|
252
|
+
MetricsV1GetQueueResponse
|
|
253
|
+
Success
|
|
254
|
+
|
|
255
|
+
Examples
|
|
256
|
+
--------
|
|
257
|
+
import asyncio
|
|
258
|
+
|
|
259
|
+
from alchemy import AsyncAlchemy
|
|
260
|
+
|
|
261
|
+
client = AsyncAlchemy(
|
|
262
|
+
client_id="YOUR_CLIENT_ID",
|
|
263
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
async def main() -> None:
|
|
268
|
+
await client.metrics.get_queue(
|
|
269
|
+
connect_timeout_ms=1000.0,
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
asyncio.run(main())
|
|
274
|
+
"""
|
|
275
|
+
_response = await self._raw_client.get_queue(
|
|
276
|
+
connect_timeout_ms=connect_timeout_ms, function_ids=function_ids, request_options=request_options
|
|
277
|
+
)
|
|
278
|
+
return _response.data
|
|
279
|
+
|
|
280
|
+
async def query_aggregate(
|
|
281
|
+
self,
|
|
282
|
+
*,
|
|
283
|
+
connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
|
|
284
|
+
metrics: typing.Optional[typing.Sequence[MetricsV1Metric]] = OMIT,
|
|
285
|
+
since_ms: typing.Optional[str] = OMIT,
|
|
286
|
+
until_ms: typing.Optional[str] = OMIT,
|
|
287
|
+
group_by: typing.Optional[MetricsV1MetricDimension] = OMIT,
|
|
288
|
+
filters: typing.Optional[typing.Sequence[MetricsV1MetricFilter]] = OMIT,
|
|
289
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
290
|
+
) -> MetricsV1QueryAggregateResponse:
|
|
291
|
+
"""
|
|
292
|
+
Parameters
|
|
293
|
+
----------
|
|
294
|
+
connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
|
|
295
|
+
Define the timeout, in ms
|
|
296
|
+
|
|
297
|
+
metrics : typing.Optional[typing.Sequence[MetricsV1Metric]]
|
|
298
|
+
|
|
299
|
+
since_ms : typing.Optional[str]
|
|
300
|
+
inclusive
|
|
301
|
+
|
|
302
|
+
until_ms : typing.Optional[str]
|
|
303
|
+
exclusive; unset = now
|
|
304
|
+
|
|
305
|
+
group_by : typing.Optional[MetricsV1MetricDimension]
|
|
306
|
+
UNSPECIFIED = single total row, key ""
|
|
307
|
+
|
|
308
|
+
filters : typing.Optional[typing.Sequence[MetricsV1MetricFilter]]
|
|
309
|
+
|
|
310
|
+
request_options : typing.Optional[RequestOptions]
|
|
311
|
+
Request-specific configuration.
|
|
312
|
+
|
|
313
|
+
Returns
|
|
314
|
+
-------
|
|
315
|
+
MetricsV1QueryAggregateResponse
|
|
316
|
+
Success
|
|
317
|
+
|
|
318
|
+
Examples
|
|
319
|
+
--------
|
|
320
|
+
import asyncio
|
|
321
|
+
|
|
322
|
+
from alchemy import AsyncAlchemy
|
|
323
|
+
|
|
324
|
+
client = AsyncAlchemy(
|
|
325
|
+
client_id="YOUR_CLIENT_ID",
|
|
326
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
327
|
+
)
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
async def main() -> None:
|
|
331
|
+
await client.metrics.query_aggregate(
|
|
332
|
+
connect_timeout_ms=1000.0,
|
|
333
|
+
)
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
asyncio.run(main())
|
|
337
|
+
"""
|
|
338
|
+
_response = await self._raw_client.query_aggregate(
|
|
339
|
+
connect_timeout_ms=connect_timeout_ms,
|
|
340
|
+
metrics=metrics,
|
|
341
|
+
since_ms=since_ms,
|
|
342
|
+
until_ms=until_ms,
|
|
343
|
+
group_by=group_by,
|
|
344
|
+
filters=filters,
|
|
345
|
+
request_options=request_options,
|
|
346
|
+
)
|
|
347
|
+
return _response.data
|
|
348
|
+
|
|
349
|
+
async def query_timeseries(
|
|
350
|
+
self,
|
|
351
|
+
*,
|
|
352
|
+
connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
|
|
353
|
+
metrics: typing.Optional[typing.Sequence[MetricsV1Metric]] = OMIT,
|
|
354
|
+
since_ms: typing.Optional[str] = OMIT,
|
|
355
|
+
until_ms: typing.Optional[str] = OMIT,
|
|
356
|
+
granularity: typing.Optional[MetricsV1MetricGranularity] = OMIT,
|
|
357
|
+
tz_offset_minutes: typing.Optional[int] = OMIT,
|
|
358
|
+
group_by: typing.Optional[MetricsV1MetricDimension] = OMIT,
|
|
359
|
+
filters: typing.Optional[typing.Sequence[MetricsV1MetricFilter]] = OMIT,
|
|
360
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
361
|
+
) -> MetricsV1QueryTimeseriesResponse:
|
|
362
|
+
"""
|
|
363
|
+
Parameters
|
|
364
|
+
----------
|
|
365
|
+
connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
|
|
366
|
+
Define the timeout, in ms
|
|
367
|
+
|
|
368
|
+
metrics : typing.Optional[typing.Sequence[MetricsV1Metric]]
|
|
369
|
+
metrics are computed together per bucket; point values align with this
|
|
370
|
+
order positionally.
|
|
371
|
+
|
|
372
|
+
since_ms : typing.Optional[str]
|
|
373
|
+
inclusive
|
|
374
|
+
|
|
375
|
+
until_ms : typing.Optional[str]
|
|
376
|
+
exclusive; unset = now
|
|
377
|
+
|
|
378
|
+
granularity : typing.Optional[MetricsV1MetricGranularity]
|
|
379
|
+
|
|
380
|
+
tz_offset_minutes : typing.Optional[int]
|
|
381
|
+
tz_offset_minutes shifts bucket boundaries east of UTC so DAY buckets
|
|
382
|
+
match the viewer's local calendar day.
|
|
383
|
+
|
|
384
|
+
group_by : typing.Optional[MetricsV1MetricDimension]
|
|
385
|
+
UNSPECIFIED = one total series, key ""
|
|
386
|
+
|
|
387
|
+
filters : typing.Optional[typing.Sequence[MetricsV1MetricFilter]]
|
|
388
|
+
|
|
389
|
+
request_options : typing.Optional[RequestOptions]
|
|
390
|
+
Request-specific configuration.
|
|
391
|
+
|
|
392
|
+
Returns
|
|
393
|
+
-------
|
|
394
|
+
MetricsV1QueryTimeseriesResponse
|
|
395
|
+
Success
|
|
396
|
+
|
|
397
|
+
Examples
|
|
398
|
+
--------
|
|
399
|
+
import asyncio
|
|
400
|
+
|
|
401
|
+
from alchemy import AsyncAlchemy
|
|
402
|
+
|
|
403
|
+
client = AsyncAlchemy(
|
|
404
|
+
client_id="YOUR_CLIENT_ID",
|
|
405
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
406
|
+
)
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
async def main() -> None:
|
|
410
|
+
await client.metrics.query_timeseries(
|
|
411
|
+
connect_timeout_ms=1000.0,
|
|
412
|
+
)
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
asyncio.run(main())
|
|
416
|
+
"""
|
|
417
|
+
_response = await self._raw_client.query_timeseries(
|
|
418
|
+
connect_timeout_ms=connect_timeout_ms,
|
|
419
|
+
metrics=metrics,
|
|
420
|
+
since_ms=since_ms,
|
|
421
|
+
until_ms=until_ms,
|
|
422
|
+
granularity=granularity,
|
|
423
|
+
tz_offset_minutes=tz_offset_minutes,
|
|
424
|
+
group_by=group_by,
|
|
425
|
+
filters=filters,
|
|
426
|
+
request_options=request_options,
|
|
427
|
+
)
|
|
428
|
+
return _response.data
|