blaxel 0.1.21__py3-none-any.whl → 0.1.22rc70__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.
- blaxel/agents/__init__.py +1 -1
- blaxel/client/models/__init__.py +18 -0
- blaxel/client/models/billable_time_metric.py +70 -0
- blaxel/client/models/jobs_chart_value.py +2 -2
- blaxel/{sandbox/client/models/process_kill_request.py → client/models/logs_response.py} +17 -14
- blaxel/client/models/logs_response_data.py +99 -0
- blaxel/client/models/memory_allocation_by_name.py +70 -0
- blaxel/client/models/metadata.py +9 -0
- blaxel/client/models/resource.py +79 -0
- blaxel/client/models/resource_log_chart.py +133 -0
- blaxel/client/models/resource_log_response.py +83 -0
- blaxel/client/models/resource_metrics.py +24 -0
- blaxel/client/models/resource_trace.py +97 -0
- blaxel/client/models/websocket_message.py +106 -0
- blaxel/common/internal.py +1 -0
- blaxel/jobs/__init__.py +1 -1
- blaxel/sandbox/base.py +1 -2
- blaxel/sandbox/client/api/process/delete_process_identifier_kill.py +0 -26
- blaxel/sandbox/client/models/__init__.py +2 -2
- blaxel/sandbox/client/models/process_request.py +25 -1
- blaxel/sandbox/client/models/process_request_env.py +49 -0
- blaxel/tools/__init__.py +1 -1
- {blaxel-0.1.21.dist-info → blaxel-0.1.22rc70.dist-info}/METADATA +1 -1
- {blaxel-0.1.21.dist-info → blaxel-0.1.22rc70.dist-info}/RECORD +26 -17
- {blaxel-0.1.21.dist-info → blaxel-0.1.22rc70.dist-info}/WHEEL +0 -0
- {blaxel-0.1.21.dist-info → blaxel-0.1.22rc70.dist-info}/licenses/LICENSE +0 -0
blaxel/agents/__init__.py
CHANGED
@@ -6,7 +6,7 @@ from ..cache import find_from_cache
|
|
6
6
|
from ..client import client
|
7
7
|
from ..client.api.agents import get_agent
|
8
8
|
from ..client.models import Agent
|
9
|
-
from ..common.internal import
|
9
|
+
from ..common.internal import get_forced_url, get_global_unique_hash
|
10
10
|
from ..common.settings import settings
|
11
11
|
from ..instrumentation.span import SpanManager
|
12
12
|
|
blaxel/client/models/__init__.py
CHANGED
@@ -4,6 +4,7 @@ from .acl import ACL
|
|
4
4
|
from .agent import Agent
|
5
5
|
from .agent_spec import AgentSpec
|
6
6
|
from .api_key import ApiKey
|
7
|
+
from .billable_time_metric import BillableTimeMetric
|
7
8
|
from .check_workspace_availability_body import CheckWorkspaceAvailabilityBody
|
8
9
|
from .configuration import Configuration
|
9
10
|
from .continent import Continent
|
@@ -71,9 +72,12 @@ from .knowledgebase_spec_options import KnowledgebaseSpecOptions
|
|
71
72
|
from .last_n_requests_metric import LastNRequestsMetric
|
72
73
|
from .latency_metric import LatencyMetric
|
73
74
|
from .location_response import LocationResponse
|
75
|
+
from .logs_response import LogsResponse
|
76
|
+
from .logs_response_data import LogsResponseData
|
74
77
|
from .mcp_definition import MCPDefinition
|
75
78
|
from .mcp_definition_entrypoint import MCPDefinitionEntrypoint
|
76
79
|
from .mcp_definition_form import MCPDefinitionForm
|
80
|
+
from .memory_allocation_by_name import MemoryAllocationByName
|
77
81
|
from .memory_allocation_metric import MemoryAllocationMetric
|
78
82
|
from .metadata import Metadata
|
79
83
|
from .metadata_labels import MetadataLabels
|
@@ -123,7 +127,10 @@ from .request_total_metric import RequestTotalMetric
|
|
123
127
|
from .request_total_metric_request_total_per_code import RequestTotalMetricRequestTotalPerCode
|
124
128
|
from .request_total_metric_rps_per_code import RequestTotalMetricRpsPerCode
|
125
129
|
from .request_total_response_data import RequestTotalResponseData
|
130
|
+
from .resource import Resource
|
126
131
|
from .resource_log import ResourceLog
|
132
|
+
from .resource_log_chart import ResourceLogChart
|
133
|
+
from .resource_log_response import ResourceLogResponse
|
127
134
|
from .resource_metrics import ResourceMetrics
|
128
135
|
from .resource_metrics_request_total_per_code import ResourceMetricsRequestTotalPerCode
|
129
136
|
from .resource_metrics_request_total_per_code_previous import (
|
@@ -131,6 +138,7 @@ from .resource_metrics_request_total_per_code_previous import (
|
|
131
138
|
)
|
132
139
|
from .resource_metrics_rps_per_code import ResourceMetricsRpsPerCode
|
133
140
|
from .resource_metrics_rps_per_code_previous import ResourceMetricsRpsPerCodePrevious
|
141
|
+
from .resource_trace import ResourceTrace
|
134
142
|
from .revision_configuration import RevisionConfiguration
|
135
143
|
from .revision_metadata import RevisionMetadata
|
136
144
|
from .runtime import Runtime
|
@@ -162,6 +170,7 @@ from .update_workspace_service_account_body import UpdateWorkspaceServiceAccount
|
|
162
170
|
from .update_workspace_service_account_response_200 import UpdateWorkspaceServiceAccountResponse200
|
163
171
|
from .update_workspace_user_role_body import UpdateWorkspaceUserRoleBody
|
164
172
|
from .websocket_channel import WebsocketChannel
|
173
|
+
from .websocket_message import WebsocketMessage
|
165
174
|
from .workspace import Workspace
|
166
175
|
from .workspace_labels import WorkspaceLabels
|
167
176
|
from .workspace_runtime import WorkspaceRuntime
|
@@ -172,6 +181,7 @@ __all__ = (
|
|
172
181
|
"Agent",
|
173
182
|
"AgentSpec",
|
174
183
|
"ApiKey",
|
184
|
+
"BillableTimeMetric",
|
175
185
|
"CheckWorkspaceAvailabilityBody",
|
176
186
|
"Configuration",
|
177
187
|
"Continent",
|
@@ -237,9 +247,12 @@ __all__ = (
|
|
237
247
|
"LastNRequestsMetric",
|
238
248
|
"LatencyMetric",
|
239
249
|
"LocationResponse",
|
250
|
+
"LogsResponse",
|
251
|
+
"LogsResponseData",
|
240
252
|
"MCPDefinition",
|
241
253
|
"MCPDefinitionEntrypoint",
|
242
254
|
"MCPDefinitionForm",
|
255
|
+
"MemoryAllocationByName",
|
243
256
|
"MemoryAllocationMetric",
|
244
257
|
"Metadata",
|
245
258
|
"MetadataLabels",
|
@@ -285,12 +298,16 @@ __all__ = (
|
|
285
298
|
"RequestTotalMetricRequestTotalPerCode",
|
286
299
|
"RequestTotalMetricRpsPerCode",
|
287
300
|
"RequestTotalResponseData",
|
301
|
+
"Resource",
|
288
302
|
"ResourceLog",
|
303
|
+
"ResourceLogChart",
|
304
|
+
"ResourceLogResponse",
|
289
305
|
"ResourceMetrics",
|
290
306
|
"ResourceMetricsRequestTotalPerCode",
|
291
307
|
"ResourceMetricsRequestTotalPerCodePrevious",
|
292
308
|
"ResourceMetricsRpsPerCode",
|
293
309
|
"ResourceMetricsRpsPerCodePrevious",
|
310
|
+
"ResourceTrace",
|
294
311
|
"RevisionConfiguration",
|
295
312
|
"RevisionMetadata",
|
296
313
|
"Runtime",
|
@@ -322,6 +339,7 @@ __all__ = (
|
|
322
339
|
"UpdateWorkspaceServiceAccountResponse200",
|
323
340
|
"UpdateWorkspaceUserRoleBody",
|
324
341
|
"WebsocketChannel",
|
342
|
+
"WebsocketMessage",
|
325
343
|
"Workspace",
|
326
344
|
"WorkspaceLabels",
|
327
345
|
"WorkspaceRuntime",
|
@@ -0,0 +1,70 @@
|
|
1
|
+
from typing import Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="BillableTimeMetric")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class BillableTimeMetric:
|
13
|
+
"""Billable time metric
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
billable_time (Union[Unset, float]): Billable time
|
17
|
+
total_allocation (Union[Unset, float]): Total memory allocation in GB-seconds
|
18
|
+
"""
|
19
|
+
|
20
|
+
billable_time: Union[Unset, float] = UNSET
|
21
|
+
total_allocation: Union[Unset, float] = UNSET
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
23
|
+
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
25
|
+
billable_time = self.billable_time
|
26
|
+
|
27
|
+
total_allocation = self.total_allocation
|
28
|
+
|
29
|
+
field_dict: dict[str, Any] = {}
|
30
|
+
field_dict.update(self.additional_properties)
|
31
|
+
field_dict.update({})
|
32
|
+
if billable_time is not UNSET:
|
33
|
+
field_dict["billableTime"] = billable_time
|
34
|
+
if total_allocation is not UNSET:
|
35
|
+
field_dict["totalAllocation"] = total_allocation
|
36
|
+
|
37
|
+
return field_dict
|
38
|
+
|
39
|
+
@classmethod
|
40
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
41
|
+
if not src_dict:
|
42
|
+
return None
|
43
|
+
d = src_dict.copy()
|
44
|
+
billable_time = d.pop("billableTime", UNSET)
|
45
|
+
|
46
|
+
total_allocation = d.pop("totalAllocation", UNSET)
|
47
|
+
|
48
|
+
billable_time_metric = cls(
|
49
|
+
billable_time=billable_time,
|
50
|
+
total_allocation=total_allocation,
|
51
|
+
)
|
52
|
+
|
53
|
+
billable_time_metric.additional_properties = d
|
54
|
+
return billable_time_metric
|
55
|
+
|
56
|
+
@property
|
57
|
+
def additional_keys(self) -> list[str]:
|
58
|
+
return list(self.additional_properties.keys())
|
59
|
+
|
60
|
+
def __getitem__(self, key: str) -> Any:
|
61
|
+
return self.additional_properties[key]
|
62
|
+
|
63
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
64
|
+
self.additional_properties[key] = value
|
65
|
+
|
66
|
+
def __delitem__(self, key: str) -> None:
|
67
|
+
del self.additional_properties[key]
|
68
|
+
|
69
|
+
def __contains__(self, key: str) -> bool:
|
70
|
+
return key in self.additional_properties
|
@@ -14,11 +14,11 @@ class JobsChartValue:
|
|
14
14
|
|
15
15
|
Attributes:
|
16
16
|
timestamp (Union[Unset, str]): Metric timestamp
|
17
|
-
value (Union[Unset,
|
17
|
+
value (Union[Unset, float]): Metric value
|
18
18
|
"""
|
19
19
|
|
20
20
|
timestamp: Union[Unset, str] = UNSET
|
21
|
-
value: Union[Unset,
|
21
|
+
value: Union[Unset, float] = UNSET
|
22
22
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
23
23
|
|
24
24
|
def to_dict(self) -> dict[str, Any]:
|
@@ -1,31 +1,34 @@
|
|
1
|
-
from typing import Any, TypeVar, Union
|
1
|
+
from typing import Any, TypeVar, Union, cast
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
5
5
|
|
6
6
|
from ..types import UNSET, Unset
|
7
7
|
|
8
|
-
T = TypeVar("T", bound="
|
8
|
+
T = TypeVar("T", bound="LogsResponse")
|
9
9
|
|
10
10
|
|
11
11
|
@_attrs_define
|
12
|
-
class
|
13
|
-
"""
|
12
|
+
class LogsResponse:
|
13
|
+
"""Response for logs
|
14
|
+
|
14
15
|
Attributes:
|
15
|
-
|
16
|
+
data (Union[Unset, list[Any]]): Data
|
16
17
|
"""
|
17
18
|
|
18
|
-
|
19
|
+
data: Union[Unset, list[Any]] = UNSET
|
19
20
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
20
21
|
|
21
22
|
def to_dict(self) -> dict[str, Any]:
|
22
|
-
|
23
|
+
data: Union[Unset, list[Any]] = UNSET
|
24
|
+
if not isinstance(self.data, Unset):
|
25
|
+
data = self.data
|
23
26
|
|
24
27
|
field_dict: dict[str, Any] = {}
|
25
28
|
field_dict.update(self.additional_properties)
|
26
29
|
field_dict.update({})
|
27
|
-
if
|
28
|
-
field_dict["
|
30
|
+
if data is not UNSET:
|
31
|
+
field_dict["data"] = data
|
29
32
|
|
30
33
|
return field_dict
|
31
34
|
|
@@ -34,14 +37,14 @@ class ProcessKillRequest:
|
|
34
37
|
if not src_dict:
|
35
38
|
return None
|
36
39
|
d = src_dict.copy()
|
37
|
-
|
40
|
+
data = cast(list[Any], d.pop("data", UNSET))
|
38
41
|
|
39
|
-
|
40
|
-
|
42
|
+
logs_response = cls(
|
43
|
+
data=data,
|
41
44
|
)
|
42
45
|
|
43
|
-
|
44
|
-
return
|
46
|
+
logs_response.additional_properties = d
|
47
|
+
return logs_response
|
45
48
|
|
46
49
|
@property
|
47
50
|
def additional_keys(self) -> list[str]:
|
@@ -0,0 +1,99 @@
|
|
1
|
+
from typing import Any, TypeVar, Union, cast
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="LogsResponseData")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class LogsResponseData:
|
13
|
+
"""Response data for logs
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
body (Union[Unset, str]): Body of the log
|
17
|
+
log_attributes (Union[Unset, list[Any]]): Log attributes
|
18
|
+
severity_number (Union[Unset, int]): Severity number of the log
|
19
|
+
timestamp (Union[Unset, str]): Timestamp of the log
|
20
|
+
trace_id (Union[Unset, str]): Trace ID of the log
|
21
|
+
"""
|
22
|
+
|
23
|
+
body: Union[Unset, str] = UNSET
|
24
|
+
log_attributes: Union[Unset, list[Any]] = UNSET
|
25
|
+
severity_number: Union[Unset, int] = UNSET
|
26
|
+
timestamp: Union[Unset, str] = UNSET
|
27
|
+
trace_id: Union[Unset, str] = UNSET
|
28
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
29
|
+
|
30
|
+
def to_dict(self) -> dict[str, Any]:
|
31
|
+
body = self.body
|
32
|
+
|
33
|
+
log_attributes: Union[Unset, list[Any]] = UNSET
|
34
|
+
if not isinstance(self.log_attributes, Unset):
|
35
|
+
log_attributes = self.log_attributes
|
36
|
+
|
37
|
+
severity_number = self.severity_number
|
38
|
+
|
39
|
+
timestamp = self.timestamp
|
40
|
+
|
41
|
+
trace_id = self.trace_id
|
42
|
+
|
43
|
+
field_dict: dict[str, Any] = {}
|
44
|
+
field_dict.update(self.additional_properties)
|
45
|
+
field_dict.update({})
|
46
|
+
if body is not UNSET:
|
47
|
+
field_dict["body"] = body
|
48
|
+
if log_attributes is not UNSET:
|
49
|
+
field_dict["logAttributes"] = log_attributes
|
50
|
+
if severity_number is not UNSET:
|
51
|
+
field_dict["severityNumber"] = severity_number
|
52
|
+
if timestamp is not UNSET:
|
53
|
+
field_dict["timestamp"] = timestamp
|
54
|
+
if trace_id is not UNSET:
|
55
|
+
field_dict["traceId"] = trace_id
|
56
|
+
|
57
|
+
return field_dict
|
58
|
+
|
59
|
+
@classmethod
|
60
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
61
|
+
if not src_dict:
|
62
|
+
return None
|
63
|
+
d = src_dict.copy()
|
64
|
+
body = d.pop("body", UNSET)
|
65
|
+
|
66
|
+
log_attributes = cast(list[Any], d.pop("logAttributes", UNSET))
|
67
|
+
|
68
|
+
severity_number = d.pop("severityNumber", UNSET)
|
69
|
+
|
70
|
+
timestamp = d.pop("timestamp", UNSET)
|
71
|
+
|
72
|
+
trace_id = d.pop("traceId", UNSET)
|
73
|
+
|
74
|
+
logs_response_data = cls(
|
75
|
+
body=body,
|
76
|
+
log_attributes=log_attributes,
|
77
|
+
severity_number=severity_number,
|
78
|
+
timestamp=timestamp,
|
79
|
+
trace_id=trace_id,
|
80
|
+
)
|
81
|
+
|
82
|
+
logs_response_data.additional_properties = d
|
83
|
+
return logs_response_data
|
84
|
+
|
85
|
+
@property
|
86
|
+
def additional_keys(self) -> list[str]:
|
87
|
+
return list(self.additional_properties.keys())
|
88
|
+
|
89
|
+
def __getitem__(self, key: str) -> Any:
|
90
|
+
return self.additional_properties[key]
|
91
|
+
|
92
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
93
|
+
self.additional_properties[key] = value
|
94
|
+
|
95
|
+
def __delitem__(self, key: str) -> None:
|
96
|
+
del self.additional_properties[key]
|
97
|
+
|
98
|
+
def __contains__(self, key: str) -> bool:
|
99
|
+
return key in self.additional_properties
|
@@ -0,0 +1,70 @@
|
|
1
|
+
from typing import Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="MemoryAllocationByName")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class MemoryAllocationByName:
|
13
|
+
"""Memory allocation by service name
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
allocation (Union[Unset, float]): Memory allocation value
|
17
|
+
name (Union[Unset, str]): Name
|
18
|
+
"""
|
19
|
+
|
20
|
+
allocation: Union[Unset, float] = UNSET
|
21
|
+
name: Union[Unset, str] = UNSET
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
23
|
+
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
25
|
+
allocation = self.allocation
|
26
|
+
|
27
|
+
name = self.name
|
28
|
+
|
29
|
+
field_dict: dict[str, Any] = {}
|
30
|
+
field_dict.update(self.additional_properties)
|
31
|
+
field_dict.update({})
|
32
|
+
if allocation is not UNSET:
|
33
|
+
field_dict["allocation"] = allocation
|
34
|
+
if name is not UNSET:
|
35
|
+
field_dict["name"] = name
|
36
|
+
|
37
|
+
return field_dict
|
38
|
+
|
39
|
+
@classmethod
|
40
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
41
|
+
if not src_dict:
|
42
|
+
return None
|
43
|
+
d = src_dict.copy()
|
44
|
+
allocation = d.pop("allocation", UNSET)
|
45
|
+
|
46
|
+
name = d.pop("name", UNSET)
|
47
|
+
|
48
|
+
memory_allocation_by_name = cls(
|
49
|
+
allocation=allocation,
|
50
|
+
name=name,
|
51
|
+
)
|
52
|
+
|
53
|
+
memory_allocation_by_name.additional_properties = d
|
54
|
+
return memory_allocation_by_name
|
55
|
+
|
56
|
+
@property
|
57
|
+
def additional_keys(self) -> list[str]:
|
58
|
+
return list(self.additional_properties.keys())
|
59
|
+
|
60
|
+
def __getitem__(self, key: str) -> Any:
|
61
|
+
return self.additional_properties[key]
|
62
|
+
|
63
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
64
|
+
self.additional_properties[key] = value
|
65
|
+
|
66
|
+
def __delitem__(self, key: str) -> None:
|
67
|
+
del self.additional_properties[key]
|
68
|
+
|
69
|
+
def __contains__(self, key: str) -> bool:
|
70
|
+
return key in self.additional_properties
|
blaxel/client/models/metadata.py
CHANGED
@@ -24,6 +24,7 @@ class Metadata:
|
|
24
24
|
display_name (Union[Unset, str]): Model display name
|
25
25
|
labels (Union[Unset, MetadataLabels]): Labels
|
26
26
|
name (Union[Unset, str]): Model name
|
27
|
+
plan (Union[Unset, Any]): Plan
|
27
28
|
workspace (Union[Unset, str]): Workspace name
|
28
29
|
"""
|
29
30
|
|
@@ -34,6 +35,7 @@ class Metadata:
|
|
34
35
|
display_name: Union[Unset, str] = UNSET
|
35
36
|
labels: Union[Unset, "MetadataLabels"] = UNSET
|
36
37
|
name: Union[Unset, str] = UNSET
|
38
|
+
plan: Union[Unset, Any] = UNSET
|
37
39
|
workspace: Union[Unset, str] = UNSET
|
38
40
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
39
41
|
|
@@ -56,6 +58,8 @@ class Metadata:
|
|
56
58
|
|
57
59
|
name = self.name
|
58
60
|
|
61
|
+
plan = self.plan
|
62
|
+
|
59
63
|
workspace = self.workspace
|
60
64
|
|
61
65
|
field_dict: dict[str, Any] = {}
|
@@ -75,6 +79,8 @@ class Metadata:
|
|
75
79
|
field_dict["labels"] = labels
|
76
80
|
if name is not UNSET:
|
77
81
|
field_dict["name"] = name
|
82
|
+
if plan is not UNSET:
|
83
|
+
field_dict["plan"] = plan
|
78
84
|
if workspace is not UNSET:
|
79
85
|
field_dict["workspace"] = workspace
|
80
86
|
|
@@ -106,6 +112,8 @@ class Metadata:
|
|
106
112
|
|
107
113
|
name = d.pop("name", UNSET)
|
108
114
|
|
115
|
+
plan = d.pop("plan", UNSET)
|
116
|
+
|
109
117
|
workspace = d.pop("workspace", UNSET)
|
110
118
|
|
111
119
|
metadata = cls(
|
@@ -116,6 +124,7 @@ class Metadata:
|
|
116
124
|
display_name=display_name,
|
117
125
|
labels=labels,
|
118
126
|
name=name,
|
127
|
+
plan=plan,
|
119
128
|
workspace=workspace,
|
120
129
|
)
|
121
130
|
|
@@ -0,0 +1,79 @@
|
|
1
|
+
from typing import Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="Resource")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class Resource:
|
13
|
+
"""Resource
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
name (Union[Unset, str]): Name of the resource
|
17
|
+
type_ (Union[Unset, str]): Type of the resource
|
18
|
+
workspace (Union[Unset, str]): Workspace of the resource
|
19
|
+
"""
|
20
|
+
|
21
|
+
name: Union[Unset, str] = UNSET
|
22
|
+
type_: Union[Unset, str] = UNSET
|
23
|
+
workspace: Union[Unset, str] = UNSET
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
25
|
+
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
27
|
+
name = self.name
|
28
|
+
|
29
|
+
type_ = self.type_
|
30
|
+
|
31
|
+
workspace = self.workspace
|
32
|
+
|
33
|
+
field_dict: dict[str, Any] = {}
|
34
|
+
field_dict.update(self.additional_properties)
|
35
|
+
field_dict.update({})
|
36
|
+
if name is not UNSET:
|
37
|
+
field_dict["name"] = name
|
38
|
+
if type_ is not UNSET:
|
39
|
+
field_dict["type"] = type_
|
40
|
+
if workspace is not UNSET:
|
41
|
+
field_dict["workspace"] = workspace
|
42
|
+
|
43
|
+
return field_dict
|
44
|
+
|
45
|
+
@classmethod
|
46
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
47
|
+
if not src_dict:
|
48
|
+
return None
|
49
|
+
d = src_dict.copy()
|
50
|
+
name = d.pop("name", UNSET)
|
51
|
+
|
52
|
+
type_ = d.pop("type", UNSET)
|
53
|
+
|
54
|
+
workspace = d.pop("workspace", UNSET)
|
55
|
+
|
56
|
+
resource = cls(
|
57
|
+
name=name,
|
58
|
+
type_=type_,
|
59
|
+
workspace=workspace,
|
60
|
+
)
|
61
|
+
|
62
|
+
resource.additional_properties = d
|
63
|
+
return resource
|
64
|
+
|
65
|
+
@property
|
66
|
+
def additional_keys(self) -> list[str]:
|
67
|
+
return list(self.additional_properties.keys())
|
68
|
+
|
69
|
+
def __getitem__(self, key: str) -> Any:
|
70
|
+
return self.additional_properties[key]
|
71
|
+
|
72
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
73
|
+
self.additional_properties[key] = value
|
74
|
+
|
75
|
+
def __delitem__(self, key: str) -> None:
|
76
|
+
del self.additional_properties[key]
|
77
|
+
|
78
|
+
def __contains__(self, key: str) -> bool:
|
79
|
+
return key in self.additional_properties
|
@@ -0,0 +1,133 @@
|
|
1
|
+
from typing import Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="ResourceLogChart")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class ResourceLogChart:
|
13
|
+
"""Chart for a resource log
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
count (Union[Unset, int]): Count of the log
|
17
|
+
debug (Union[Unset, int]): Debug count of the log
|
18
|
+
error (Union[Unset, int]): Error count of the log
|
19
|
+
fatal (Union[Unset, int]): Fatal count of the log
|
20
|
+
info (Union[Unset, int]): Info count of the log
|
21
|
+
timestamp (Union[Unset, str]): Timestamp of the log
|
22
|
+
trace (Union[Unset, int]): Trace count of the log
|
23
|
+
unknown (Union[Unset, int]): Unknown count of the log
|
24
|
+
warning (Union[Unset, int]): Warning count of the log
|
25
|
+
"""
|
26
|
+
|
27
|
+
count: Union[Unset, int] = UNSET
|
28
|
+
debug: Union[Unset, int] = UNSET
|
29
|
+
error: Union[Unset, int] = UNSET
|
30
|
+
fatal: Union[Unset, int] = UNSET
|
31
|
+
info: Union[Unset, int] = UNSET
|
32
|
+
timestamp: Union[Unset, str] = UNSET
|
33
|
+
trace: Union[Unset, int] = UNSET
|
34
|
+
unknown: Union[Unset, int] = UNSET
|
35
|
+
warning: Union[Unset, int] = UNSET
|
36
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
37
|
+
|
38
|
+
def to_dict(self) -> dict[str, Any]:
|
39
|
+
count = self.count
|
40
|
+
|
41
|
+
debug = self.debug
|
42
|
+
|
43
|
+
error = self.error
|
44
|
+
|
45
|
+
fatal = self.fatal
|
46
|
+
|
47
|
+
info = self.info
|
48
|
+
|
49
|
+
timestamp = self.timestamp
|
50
|
+
|
51
|
+
trace = self.trace
|
52
|
+
|
53
|
+
unknown = self.unknown
|
54
|
+
|
55
|
+
warning = self.warning
|
56
|
+
|
57
|
+
field_dict: dict[str, Any] = {}
|
58
|
+
field_dict.update(self.additional_properties)
|
59
|
+
field_dict.update({})
|
60
|
+
if count is not UNSET:
|
61
|
+
field_dict["count"] = count
|
62
|
+
if debug is not UNSET:
|
63
|
+
field_dict["debug"] = debug
|
64
|
+
if error is not UNSET:
|
65
|
+
field_dict["error"] = error
|
66
|
+
if fatal is not UNSET:
|
67
|
+
field_dict["fatal"] = fatal
|
68
|
+
if info is not UNSET:
|
69
|
+
field_dict["info"] = info
|
70
|
+
if timestamp is not UNSET:
|
71
|
+
field_dict["timestamp"] = timestamp
|
72
|
+
if trace is not UNSET:
|
73
|
+
field_dict["trace"] = trace
|
74
|
+
if unknown is not UNSET:
|
75
|
+
field_dict["unknown"] = unknown
|
76
|
+
if warning is not UNSET:
|
77
|
+
field_dict["warning"] = warning
|
78
|
+
|
79
|
+
return field_dict
|
80
|
+
|
81
|
+
@classmethod
|
82
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
83
|
+
if not src_dict:
|
84
|
+
return None
|
85
|
+
d = src_dict.copy()
|
86
|
+
count = d.pop("count", UNSET)
|
87
|
+
|
88
|
+
debug = d.pop("debug", UNSET)
|
89
|
+
|
90
|
+
error = d.pop("error", UNSET)
|
91
|
+
|
92
|
+
fatal = d.pop("fatal", UNSET)
|
93
|
+
|
94
|
+
info = d.pop("info", UNSET)
|
95
|
+
|
96
|
+
timestamp = d.pop("timestamp", UNSET)
|
97
|
+
|
98
|
+
trace = d.pop("trace", UNSET)
|
99
|
+
|
100
|
+
unknown = d.pop("unknown", UNSET)
|
101
|
+
|
102
|
+
warning = d.pop("warning", UNSET)
|
103
|
+
|
104
|
+
resource_log_chart = cls(
|
105
|
+
count=count,
|
106
|
+
debug=debug,
|
107
|
+
error=error,
|
108
|
+
fatal=fatal,
|
109
|
+
info=info,
|
110
|
+
timestamp=timestamp,
|
111
|
+
trace=trace,
|
112
|
+
unknown=unknown,
|
113
|
+
warning=warning,
|
114
|
+
)
|
115
|
+
|
116
|
+
resource_log_chart.additional_properties = d
|
117
|
+
return resource_log_chart
|
118
|
+
|
119
|
+
@property
|
120
|
+
def additional_keys(self) -> list[str]:
|
121
|
+
return list(self.additional_properties.keys())
|
122
|
+
|
123
|
+
def __getitem__(self, key: str) -> Any:
|
124
|
+
return self.additional_properties[key]
|
125
|
+
|
126
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
127
|
+
self.additional_properties[key] = value
|
128
|
+
|
129
|
+
def __delitem__(self, key: str) -> None:
|
130
|
+
del self.additional_properties[key]
|
131
|
+
|
132
|
+
def __contains__(self, key: str) -> bool:
|
133
|
+
return key in self.additional_properties
|