blaxel 0.2.36__py3-none-any.whl → 0.2.38__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/__init__.py +2 -2
- blaxel/core/client/models/create_job_execution_request_env.py +3 -3
- blaxel/core/client/models/preview.py +48 -1
- blaxel/core/client/models/sandbox.py +10 -0
- blaxel/core/jobs/__init__.py +2 -2
- blaxel/core/sandbox/__init__.py +12 -0
- blaxel/core/sandbox/client/api/system/__init__.py +0 -0
- blaxel/core/sandbox/client/api/system/get_health.py +134 -0
- blaxel/core/sandbox/client/api/system/post_upgrade.py +196 -0
- blaxel/core/sandbox/client/models/__init__.py +8 -0
- blaxel/core/sandbox/client/models/content_search_match.py +24 -25
- blaxel/core/sandbox/client/models/content_search_response.py +25 -29
- blaxel/core/sandbox/client/models/find_match.py +13 -14
- blaxel/core/sandbox/client/models/find_response.py +21 -24
- blaxel/core/sandbox/client/models/fuzzy_search_match.py +17 -19
- blaxel/core/sandbox/client/models/fuzzy_search_response.py +21 -24
- blaxel/core/sandbox/client/models/health_response.py +159 -0
- blaxel/core/sandbox/client/models/process_upgrade_state.py +20 -0
- blaxel/core/sandbox/client/models/upgrade_request.py +71 -0
- blaxel/core/sandbox/client/models/upgrade_status.py +125 -0
- blaxel/core/sandbox/default/__init__.py +2 -0
- blaxel/core/sandbox/default/filesystem.py +20 -6
- blaxel/core/sandbox/default/preview.py +48 -1
- blaxel/core/sandbox/default/process.py +66 -21
- blaxel/core/sandbox/default/sandbox.py +36 -5
- blaxel/core/sandbox/default/system.py +71 -0
- blaxel/core/sandbox/sync/__init__.py +2 -0
- blaxel/core/sandbox/sync/filesystem.py +19 -2
- blaxel/core/sandbox/sync/preview.py +50 -3
- blaxel/core/sandbox/sync/process.py +38 -15
- blaxel/core/sandbox/sync/sandbox.py +29 -4
- blaxel/core/sandbox/sync/system.py +71 -0
- blaxel/core/sandbox/types.py +212 -5
- blaxel/core/tools/__init__.py +4 -0
- blaxel/core/volume/volume.py +10 -0
- blaxel/crewai/model.py +81 -44
- blaxel/crewai/tools.py +85 -2
- blaxel/googleadk/model.py +22 -3
- blaxel/googleadk/tools.py +25 -6
- blaxel/langgraph/custom/gemini.py +19 -12
- blaxel/langgraph/model.py +26 -18
- blaxel/langgraph/tools.py +6 -12
- blaxel/livekit/model.py +7 -2
- blaxel/livekit/tools.py +3 -1
- blaxel/llamaindex/model.py +145 -84
- blaxel/llamaindex/tools.py +6 -4
- blaxel/openai/model.py +7 -1
- blaxel/openai/tools.py +13 -3
- blaxel/pydantic/model.py +38 -24
- blaxel/pydantic/tools.py +37 -4
- blaxel-0.2.38.dist-info/METADATA +528 -0
- {blaxel-0.2.36.dist-info → blaxel-0.2.38.dist-info}/RECORD +54 -45
- blaxel-0.2.36.dist-info/METADATA +0 -228
- {blaxel-0.2.36.dist-info → blaxel-0.2.38.dist-info}/WHEEL +0 -0
- {blaxel-0.2.36.dist-info → blaxel-0.2.38.dist-info}/licenses/LICENSE +0 -0
|
@@ -12,46 +12,45 @@ T = TypeVar("T", bound="ContentSearchMatch")
|
|
|
12
12
|
class ContentSearchMatch:
|
|
13
13
|
"""
|
|
14
14
|
Attributes:
|
|
15
|
-
column (
|
|
15
|
+
column (int): Example: 10.
|
|
16
|
+
line (int): Example: 42.
|
|
17
|
+
path (str): Example: src/main.go.
|
|
18
|
+
text (str): Example: const searchText = 'example'.
|
|
16
19
|
context (Union[Unset, str]): Example: previous line
|
|
17
20
|
current line
|
|
18
21
|
next line.
|
|
19
|
-
line (Union[Unset, int]): Example: 42.
|
|
20
|
-
path (Union[Unset, str]): Example: src/main.go.
|
|
21
|
-
text (Union[Unset, str]): Example: const searchText = 'example'.
|
|
22
22
|
"""
|
|
23
23
|
|
|
24
|
-
column:
|
|
24
|
+
column: int
|
|
25
|
+
line: int
|
|
26
|
+
path: str
|
|
27
|
+
text: str
|
|
25
28
|
context: Union[Unset, str] = UNSET
|
|
26
|
-
line: Union[Unset, int] = UNSET
|
|
27
|
-
path: Union[Unset, str] = UNSET
|
|
28
|
-
text: Union[Unset, str] = UNSET
|
|
29
29
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
30
30
|
|
|
31
31
|
def to_dict(self) -> dict[str, Any]:
|
|
32
32
|
column = self.column
|
|
33
33
|
|
|
34
|
-
context = self.context
|
|
35
|
-
|
|
36
34
|
line = self.line
|
|
37
35
|
|
|
38
36
|
path = self.path
|
|
39
37
|
|
|
40
38
|
text = self.text
|
|
41
39
|
|
|
40
|
+
context = self.context
|
|
41
|
+
|
|
42
42
|
field_dict: dict[str, Any] = {}
|
|
43
43
|
field_dict.update(self.additional_properties)
|
|
44
|
-
field_dict.update(
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
field_dict.update(
|
|
45
|
+
{
|
|
46
|
+
"column": column,
|
|
47
|
+
"line": line,
|
|
48
|
+
"path": path,
|
|
49
|
+
"text": text,
|
|
50
|
+
}
|
|
51
|
+
)
|
|
47
52
|
if context is not UNSET:
|
|
48
53
|
field_dict["context"] = context
|
|
49
|
-
if line is not UNSET:
|
|
50
|
-
field_dict["line"] = line
|
|
51
|
-
if path is not UNSET:
|
|
52
|
-
field_dict["path"] = path
|
|
53
|
-
if text is not UNSET:
|
|
54
|
-
field_dict["text"] = text
|
|
55
54
|
|
|
56
55
|
return field_dict
|
|
57
56
|
|
|
@@ -60,22 +59,22 @@ class ContentSearchMatch:
|
|
|
60
59
|
if not src_dict:
|
|
61
60
|
return None
|
|
62
61
|
d = src_dict.copy()
|
|
63
|
-
column = d.pop("column"
|
|
62
|
+
column = d.pop("column")
|
|
64
63
|
|
|
65
|
-
|
|
64
|
+
line = d.pop("line")
|
|
66
65
|
|
|
67
|
-
|
|
66
|
+
path = d.pop("path")
|
|
68
67
|
|
|
69
|
-
|
|
68
|
+
text = d.pop("text")
|
|
70
69
|
|
|
71
|
-
|
|
70
|
+
context = d.pop("context", UNSET)
|
|
72
71
|
|
|
73
72
|
content_search_match = cls(
|
|
74
73
|
column=column,
|
|
75
|
-
context=context,
|
|
76
74
|
line=line,
|
|
77
75
|
path=path,
|
|
78
76
|
text=text,
|
|
77
|
+
context=context,
|
|
79
78
|
)
|
|
80
79
|
|
|
81
80
|
content_search_match.additional_properties = d
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
from typing import TYPE_CHECKING, Any, TypeVar
|
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
2
2
|
|
|
3
3
|
from attrs import define as _attrs_define
|
|
4
4
|
from attrs import field as _attrs_field
|
|
5
5
|
|
|
6
|
-
from ..types import UNSET, Unset
|
|
7
|
-
|
|
8
6
|
if TYPE_CHECKING:
|
|
9
7
|
from ..models.content_search_match import ContentSearchMatch
|
|
10
8
|
|
|
@@ -16,26 +14,24 @@ T = TypeVar("T", bound="ContentSearchResponse")
|
|
|
16
14
|
class ContentSearchResponse:
|
|
17
15
|
"""
|
|
18
16
|
Attributes:
|
|
19
|
-
matches (
|
|
20
|
-
query (
|
|
21
|
-
total (
|
|
17
|
+
matches (list['ContentSearchMatch']):
|
|
18
|
+
query (str): Example: searchText.
|
|
19
|
+
total (int): Example: 5.
|
|
22
20
|
"""
|
|
23
21
|
|
|
24
|
-
matches:
|
|
25
|
-
query:
|
|
26
|
-
total:
|
|
22
|
+
matches: list["ContentSearchMatch"]
|
|
23
|
+
query: str
|
|
24
|
+
total: int
|
|
27
25
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
28
26
|
|
|
29
27
|
def to_dict(self) -> dict[str, Any]:
|
|
30
|
-
matches
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
matches_item = matches_item_data.to_dict()
|
|
38
|
-
matches.append(matches_item)
|
|
28
|
+
matches = []
|
|
29
|
+
for matches_item_data in self.matches:
|
|
30
|
+
if type(matches_item_data) is dict:
|
|
31
|
+
matches_item = matches_item_data
|
|
32
|
+
else:
|
|
33
|
+
matches_item = matches_item_data.to_dict()
|
|
34
|
+
matches.append(matches_item)
|
|
39
35
|
|
|
40
36
|
query = self.query
|
|
41
37
|
|
|
@@ -43,13 +39,13 @@ class ContentSearchResponse:
|
|
|
43
39
|
|
|
44
40
|
field_dict: dict[str, Any] = {}
|
|
45
41
|
field_dict.update(self.additional_properties)
|
|
46
|
-
field_dict.update(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
field_dict.update(
|
|
43
|
+
{
|
|
44
|
+
"matches": matches,
|
|
45
|
+
"query": query,
|
|
46
|
+
"total": total,
|
|
47
|
+
}
|
|
48
|
+
)
|
|
53
49
|
|
|
54
50
|
return field_dict
|
|
55
51
|
|
|
@@ -61,15 +57,15 @@ class ContentSearchResponse:
|
|
|
61
57
|
return None
|
|
62
58
|
d = src_dict.copy()
|
|
63
59
|
matches = []
|
|
64
|
-
_matches = d.pop("matches"
|
|
65
|
-
for matches_item_data in _matches
|
|
60
|
+
_matches = d.pop("matches")
|
|
61
|
+
for matches_item_data in _matches:
|
|
66
62
|
matches_item = ContentSearchMatch.from_dict(matches_item_data)
|
|
67
63
|
|
|
68
64
|
matches.append(matches_item)
|
|
69
65
|
|
|
70
|
-
query = d.pop("query"
|
|
66
|
+
query = d.pop("query")
|
|
71
67
|
|
|
72
|
-
total = d.pop("total"
|
|
68
|
+
total = d.pop("total")
|
|
73
69
|
|
|
74
70
|
content_search_response = cls(
|
|
75
71
|
matches=matches,
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
from typing import Any, TypeVar
|
|
1
|
+
from typing import Any, TypeVar
|
|
2
2
|
|
|
3
3
|
from attrs import define as _attrs_define
|
|
4
4
|
from attrs import field as _attrs_field
|
|
5
5
|
|
|
6
|
-
from ..types import UNSET, Unset
|
|
7
|
-
|
|
8
6
|
T = TypeVar("T", bound="FindMatch")
|
|
9
7
|
|
|
10
8
|
|
|
@@ -12,12 +10,12 @@ T = TypeVar("T", bound="FindMatch")
|
|
|
12
10
|
class FindMatch:
|
|
13
11
|
"""
|
|
14
12
|
Attributes:
|
|
15
|
-
path (
|
|
16
|
-
type_ (
|
|
13
|
+
path (str): Example: src/main.go.
|
|
14
|
+
type_ (str): "file" or "directory" Example: file.
|
|
17
15
|
"""
|
|
18
16
|
|
|
19
|
-
path:
|
|
20
|
-
type_:
|
|
17
|
+
path: str
|
|
18
|
+
type_: str
|
|
21
19
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
22
20
|
|
|
23
21
|
def to_dict(self) -> dict[str, Any]:
|
|
@@ -27,11 +25,12 @@ class FindMatch:
|
|
|
27
25
|
|
|
28
26
|
field_dict: dict[str, Any] = {}
|
|
29
27
|
field_dict.update(self.additional_properties)
|
|
30
|
-
field_dict.update(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
field_dict.update(
|
|
29
|
+
{
|
|
30
|
+
"path": path,
|
|
31
|
+
"type": type_,
|
|
32
|
+
}
|
|
33
|
+
)
|
|
35
34
|
|
|
36
35
|
return field_dict
|
|
37
36
|
|
|
@@ -40,9 +39,9 @@ class FindMatch:
|
|
|
40
39
|
if not src_dict:
|
|
41
40
|
return None
|
|
42
41
|
d = src_dict.copy()
|
|
43
|
-
path = d.pop("path"
|
|
42
|
+
path = d.pop("path")
|
|
44
43
|
|
|
45
|
-
type_ = d.pop("type"
|
|
44
|
+
type_ = d.pop("type") if "type" in d else d.pop("type_")
|
|
46
45
|
|
|
47
46
|
find_match = cls(
|
|
48
47
|
path=path,
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
from typing import TYPE_CHECKING, Any, TypeVar
|
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
2
2
|
|
|
3
3
|
from attrs import define as _attrs_define
|
|
4
4
|
from attrs import field as _attrs_field
|
|
5
5
|
|
|
6
|
-
from ..types import UNSET, Unset
|
|
7
|
-
|
|
8
6
|
if TYPE_CHECKING:
|
|
9
7
|
from ..models.find_match import FindMatch
|
|
10
8
|
|
|
@@ -16,34 +14,33 @@ T = TypeVar("T", bound="FindResponse")
|
|
|
16
14
|
class FindResponse:
|
|
17
15
|
"""
|
|
18
16
|
Attributes:
|
|
19
|
-
matches (
|
|
20
|
-
total (
|
|
17
|
+
matches (list['FindMatch']):
|
|
18
|
+
total (int): Example: 5.
|
|
21
19
|
"""
|
|
22
20
|
|
|
23
|
-
matches:
|
|
24
|
-
total:
|
|
21
|
+
matches: list["FindMatch"]
|
|
22
|
+
total: int
|
|
25
23
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
26
24
|
|
|
27
25
|
def to_dict(self) -> dict[str, Any]:
|
|
28
|
-
matches
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
matches_item = matches_item_data.to_dict()
|
|
36
|
-
matches.append(matches_item)
|
|
26
|
+
matches = []
|
|
27
|
+
for matches_item_data in self.matches:
|
|
28
|
+
if type(matches_item_data) is dict:
|
|
29
|
+
matches_item = matches_item_data
|
|
30
|
+
else:
|
|
31
|
+
matches_item = matches_item_data.to_dict()
|
|
32
|
+
matches.append(matches_item)
|
|
37
33
|
|
|
38
34
|
total = self.total
|
|
39
35
|
|
|
40
36
|
field_dict: dict[str, Any] = {}
|
|
41
37
|
field_dict.update(self.additional_properties)
|
|
42
|
-
field_dict.update(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
field_dict.update(
|
|
39
|
+
{
|
|
40
|
+
"matches": matches,
|
|
41
|
+
"total": total,
|
|
42
|
+
}
|
|
43
|
+
)
|
|
47
44
|
|
|
48
45
|
return field_dict
|
|
49
46
|
|
|
@@ -55,13 +52,13 @@ class FindResponse:
|
|
|
55
52
|
return None
|
|
56
53
|
d = src_dict.copy()
|
|
57
54
|
matches = []
|
|
58
|
-
_matches = d.pop("matches"
|
|
59
|
-
for matches_item_data in _matches
|
|
55
|
+
_matches = d.pop("matches")
|
|
56
|
+
for matches_item_data in _matches:
|
|
60
57
|
matches_item = FindMatch.from_dict(matches_item_data)
|
|
61
58
|
|
|
62
59
|
matches.append(matches_item)
|
|
63
60
|
|
|
64
|
-
total = d.pop("total"
|
|
61
|
+
total = d.pop("total")
|
|
65
62
|
|
|
66
63
|
find_response = cls(
|
|
67
64
|
matches=matches,
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
from typing import Any, TypeVar
|
|
1
|
+
from typing import Any, TypeVar
|
|
2
2
|
|
|
3
3
|
from attrs import define as _attrs_define
|
|
4
4
|
from attrs import field as _attrs_field
|
|
5
5
|
|
|
6
|
-
from ..types import UNSET, Unset
|
|
7
|
-
|
|
8
6
|
T = TypeVar("T", bound="FuzzySearchMatch")
|
|
9
7
|
|
|
10
8
|
|
|
@@ -12,14 +10,14 @@ T = TypeVar("T", bound="FuzzySearchMatch")
|
|
|
12
10
|
class FuzzySearchMatch:
|
|
13
11
|
"""
|
|
14
12
|
Attributes:
|
|
15
|
-
path (
|
|
16
|
-
score (
|
|
17
|
-
type_ (
|
|
13
|
+
path (str): Example: src/main.go.
|
|
14
|
+
score (int): Example: 100.
|
|
15
|
+
type_ (str): "file" or "directory" Example: file.
|
|
18
16
|
"""
|
|
19
17
|
|
|
20
|
-
path:
|
|
21
|
-
score:
|
|
22
|
-
type_:
|
|
18
|
+
path: str
|
|
19
|
+
score: int
|
|
20
|
+
type_: str
|
|
23
21
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
24
22
|
|
|
25
23
|
def to_dict(self) -> dict[str, Any]:
|
|
@@ -31,13 +29,13 @@ class FuzzySearchMatch:
|
|
|
31
29
|
|
|
32
30
|
field_dict: dict[str, Any] = {}
|
|
33
31
|
field_dict.update(self.additional_properties)
|
|
34
|
-
field_dict.update(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
field_dict.update(
|
|
33
|
+
{
|
|
34
|
+
"path": path,
|
|
35
|
+
"score": score,
|
|
36
|
+
"type": type_,
|
|
37
|
+
}
|
|
38
|
+
)
|
|
41
39
|
|
|
42
40
|
return field_dict
|
|
43
41
|
|
|
@@ -46,11 +44,11 @@ class FuzzySearchMatch:
|
|
|
46
44
|
if not src_dict:
|
|
47
45
|
return None
|
|
48
46
|
d = src_dict.copy()
|
|
49
|
-
path = d.pop("path"
|
|
47
|
+
path = d.pop("path")
|
|
50
48
|
|
|
51
|
-
score = d.pop("score"
|
|
49
|
+
score = d.pop("score")
|
|
52
50
|
|
|
53
|
-
type_ = d.pop("type"
|
|
51
|
+
type_ = d.pop("type") if "type" in d else d.pop("type_")
|
|
54
52
|
|
|
55
53
|
fuzzy_search_match = cls(
|
|
56
54
|
path=path,
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
from typing import TYPE_CHECKING, Any, TypeVar
|
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
2
2
|
|
|
3
3
|
from attrs import define as _attrs_define
|
|
4
4
|
from attrs import field as _attrs_field
|
|
5
5
|
|
|
6
|
-
from ..types import UNSET, Unset
|
|
7
|
-
|
|
8
6
|
if TYPE_CHECKING:
|
|
9
7
|
from ..models.fuzzy_search_match import FuzzySearchMatch
|
|
10
8
|
|
|
@@ -16,34 +14,33 @@ T = TypeVar("T", bound="FuzzySearchResponse")
|
|
|
16
14
|
class FuzzySearchResponse:
|
|
17
15
|
"""
|
|
18
16
|
Attributes:
|
|
19
|
-
matches (
|
|
20
|
-
total (
|
|
17
|
+
matches (list['FuzzySearchMatch']):
|
|
18
|
+
total (int): Example: 5.
|
|
21
19
|
"""
|
|
22
20
|
|
|
23
|
-
matches:
|
|
24
|
-
total:
|
|
21
|
+
matches: list["FuzzySearchMatch"]
|
|
22
|
+
total: int
|
|
25
23
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
26
24
|
|
|
27
25
|
def to_dict(self) -> dict[str, Any]:
|
|
28
|
-
matches
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
matches_item = matches_item_data.to_dict()
|
|
36
|
-
matches.append(matches_item)
|
|
26
|
+
matches = []
|
|
27
|
+
for matches_item_data in self.matches:
|
|
28
|
+
if type(matches_item_data) is dict:
|
|
29
|
+
matches_item = matches_item_data
|
|
30
|
+
else:
|
|
31
|
+
matches_item = matches_item_data.to_dict()
|
|
32
|
+
matches.append(matches_item)
|
|
37
33
|
|
|
38
34
|
total = self.total
|
|
39
35
|
|
|
40
36
|
field_dict: dict[str, Any] = {}
|
|
41
37
|
field_dict.update(self.additional_properties)
|
|
42
|
-
field_dict.update(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
field_dict.update(
|
|
39
|
+
{
|
|
40
|
+
"matches": matches,
|
|
41
|
+
"total": total,
|
|
42
|
+
}
|
|
43
|
+
)
|
|
47
44
|
|
|
48
45
|
return field_dict
|
|
49
46
|
|
|
@@ -55,13 +52,13 @@ class FuzzySearchResponse:
|
|
|
55
52
|
return None
|
|
56
53
|
d = src_dict.copy()
|
|
57
54
|
matches = []
|
|
58
|
-
_matches = d.pop("matches"
|
|
59
|
-
for matches_item_data in _matches
|
|
55
|
+
_matches = d.pop("matches")
|
|
56
|
+
for matches_item_data in _matches:
|
|
60
57
|
matches_item = FuzzySearchMatch.from_dict(matches_item_data)
|
|
61
58
|
|
|
62
59
|
matches.append(matches_item)
|
|
63
60
|
|
|
64
|
-
total = d.pop("total"
|
|
61
|
+
total = d.pop("total")
|
|
65
62
|
|
|
66
63
|
fuzzy_search_response = cls(
|
|
67
64
|
matches=matches,
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
2
|
+
|
|
3
|
+
from attrs import define as _attrs_define
|
|
4
|
+
from attrs import field as _attrs_field
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from ..models.upgrade_status import UpgradeStatus
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
T = TypeVar("T", bound="HealthResponse")
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@_attrs_define
|
|
14
|
+
class HealthResponse:
|
|
15
|
+
"""
|
|
16
|
+
Attributes:
|
|
17
|
+
arch (str): Example: amd64.
|
|
18
|
+
build_time (str): Example: 2026-01-29 17:36:52+00:00.
|
|
19
|
+
git_commit (str): Example: abc123.
|
|
20
|
+
go_version (str): Example: go1.25.0.
|
|
21
|
+
last_upgrade (UpgradeStatus):
|
|
22
|
+
os (str): Example: linux.
|
|
23
|
+
started_at (str): Example: 2026-01-29 18:45:49+00:00.
|
|
24
|
+
status (str): Example: ok.
|
|
25
|
+
upgrade_count (int):
|
|
26
|
+
uptime (str): Example: 1h30m.
|
|
27
|
+
uptime_seconds (float): Example: 5400.5.
|
|
28
|
+
version (str): Example: v0.1.0.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
arch: str
|
|
32
|
+
build_time: str
|
|
33
|
+
git_commit: str
|
|
34
|
+
go_version: str
|
|
35
|
+
last_upgrade: "UpgradeStatus"
|
|
36
|
+
os: str
|
|
37
|
+
started_at: str
|
|
38
|
+
status: str
|
|
39
|
+
upgrade_count: int
|
|
40
|
+
uptime: str
|
|
41
|
+
uptime_seconds: float
|
|
42
|
+
version: str
|
|
43
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
44
|
+
|
|
45
|
+
def to_dict(self) -> dict[str, Any]:
|
|
46
|
+
arch = self.arch
|
|
47
|
+
|
|
48
|
+
build_time = self.build_time
|
|
49
|
+
|
|
50
|
+
git_commit = self.git_commit
|
|
51
|
+
|
|
52
|
+
go_version = self.go_version
|
|
53
|
+
|
|
54
|
+
if type(self.last_upgrade) is dict:
|
|
55
|
+
last_upgrade = self.last_upgrade
|
|
56
|
+
else:
|
|
57
|
+
last_upgrade = self.last_upgrade.to_dict()
|
|
58
|
+
|
|
59
|
+
os = self.os
|
|
60
|
+
|
|
61
|
+
started_at = self.started_at
|
|
62
|
+
|
|
63
|
+
status = self.status
|
|
64
|
+
|
|
65
|
+
upgrade_count = self.upgrade_count
|
|
66
|
+
|
|
67
|
+
uptime = self.uptime
|
|
68
|
+
|
|
69
|
+
uptime_seconds = self.uptime_seconds
|
|
70
|
+
|
|
71
|
+
version = self.version
|
|
72
|
+
|
|
73
|
+
field_dict: dict[str, Any] = {}
|
|
74
|
+
field_dict.update(self.additional_properties)
|
|
75
|
+
field_dict.update(
|
|
76
|
+
{
|
|
77
|
+
"arch": arch,
|
|
78
|
+
"buildTime": build_time,
|
|
79
|
+
"gitCommit": git_commit,
|
|
80
|
+
"goVersion": go_version,
|
|
81
|
+
"lastUpgrade": last_upgrade,
|
|
82
|
+
"os": os,
|
|
83
|
+
"startedAt": started_at,
|
|
84
|
+
"status": status,
|
|
85
|
+
"upgradeCount": upgrade_count,
|
|
86
|
+
"uptime": uptime,
|
|
87
|
+
"uptimeSeconds": uptime_seconds,
|
|
88
|
+
"version": version,
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
return field_dict
|
|
93
|
+
|
|
94
|
+
@classmethod
|
|
95
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None:
|
|
96
|
+
from ..models.upgrade_status import UpgradeStatus
|
|
97
|
+
|
|
98
|
+
if not src_dict:
|
|
99
|
+
return None
|
|
100
|
+
d = src_dict.copy()
|
|
101
|
+
arch = d.pop("arch")
|
|
102
|
+
|
|
103
|
+
build_time = d.pop("buildTime") if "buildTime" in d else d.pop("build_time")
|
|
104
|
+
|
|
105
|
+
git_commit = d.pop("gitCommit") if "gitCommit" in d else d.pop("git_commit")
|
|
106
|
+
|
|
107
|
+
go_version = d.pop("goVersion") if "goVersion" in d else d.pop("go_version")
|
|
108
|
+
|
|
109
|
+
last_upgrade = UpgradeStatus.from_dict(
|
|
110
|
+
d.pop("lastUpgrade") if "lastUpgrade" in d else d.pop("last_upgrade")
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
os = d.pop("os")
|
|
114
|
+
|
|
115
|
+
started_at = d.pop("startedAt") if "startedAt" in d else d.pop("started_at")
|
|
116
|
+
|
|
117
|
+
status = d.pop("status")
|
|
118
|
+
|
|
119
|
+
upgrade_count = d.pop("upgradeCount") if "upgradeCount" in d else d.pop("upgrade_count")
|
|
120
|
+
|
|
121
|
+
uptime = d.pop("uptime")
|
|
122
|
+
|
|
123
|
+
uptime_seconds = d.pop("uptimeSeconds") if "uptimeSeconds" in d else d.pop("uptime_seconds")
|
|
124
|
+
|
|
125
|
+
version = d.pop("version")
|
|
126
|
+
|
|
127
|
+
health_response = cls(
|
|
128
|
+
arch=arch,
|
|
129
|
+
build_time=build_time,
|
|
130
|
+
git_commit=git_commit,
|
|
131
|
+
go_version=go_version,
|
|
132
|
+
last_upgrade=last_upgrade,
|
|
133
|
+
os=os,
|
|
134
|
+
started_at=started_at,
|
|
135
|
+
status=status,
|
|
136
|
+
upgrade_count=upgrade_count,
|
|
137
|
+
uptime=uptime,
|
|
138
|
+
uptime_seconds=uptime_seconds,
|
|
139
|
+
version=version,
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
health_response.additional_properties = d
|
|
143
|
+
return health_response
|
|
144
|
+
|
|
145
|
+
@property
|
|
146
|
+
def additional_keys(self) -> list[str]:
|
|
147
|
+
return list(self.additional_properties.keys())
|
|
148
|
+
|
|
149
|
+
def __getitem__(self, key: str) -> Any:
|
|
150
|
+
return self.additional_properties[key]
|
|
151
|
+
|
|
152
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
153
|
+
self.additional_properties[key] = value
|
|
154
|
+
|
|
155
|
+
def __delitem__(self, key: str) -> None:
|
|
156
|
+
del self.additional_properties[key]
|
|
157
|
+
|
|
158
|
+
def __contains__(self, key: str) -> bool:
|
|
159
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class ProcessUpgradeState(str, Enum):
|
|
5
|
+
COMPLETED = "completed"
|
|
6
|
+
FAILED = "failed"
|
|
7
|
+
IDLE = "idle"
|
|
8
|
+
RUNNING = "running"
|
|
9
|
+
|
|
10
|
+
def __str__(self) -> str:
|
|
11
|
+
return str(self.value)
|
|
12
|
+
|
|
13
|
+
@classmethod
|
|
14
|
+
def _missing_(cls, value: object) -> "ProcessUpgradeState | None":
|
|
15
|
+
if isinstance(value, str):
|
|
16
|
+
upper_value = value.upper()
|
|
17
|
+
for member in cls:
|
|
18
|
+
if member.value.upper() == upper_value:
|
|
19
|
+
return member
|
|
20
|
+
return None
|