loopix-sdk 2.30.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.
Files changed (238) hide show
  1. loopix/__init__.py +260 -0
  2. loopix/api/__init__.py +287 -0
  3. loopix/api/client/__init__.py +8 -0
  4. loopix/api/client/api/__init__.py +1 -0
  5. loopix/api/client/api/sandboxes/__init__.py +1 -0
  6. loopix/api/client/api/sandboxes/delete_sandboxes_sandbox_id.py +161 -0
  7. loopix/api/client/api/sandboxes/get_sandboxes.py +176 -0
  8. loopix/api/client/api/sandboxes/get_sandboxes_metrics.py +173 -0
  9. loopix/api/client/api/sandboxes/get_sandboxes_sandbox_id.py +163 -0
  10. loopix/api/client/api/sandboxes/get_sandboxes_sandbox_id_logs.py +199 -0
  11. loopix/api/client/api/sandboxes/get_sandboxes_sandbox_id_metrics.py +212 -0
  12. loopix/api/client/api/sandboxes/get_v2_sandboxes.py +230 -0
  13. loopix/api/client/api/sandboxes/get_v_2_sandboxes_sandbox_id_logs.py +254 -0
  14. loopix/api/client/api/sandboxes/post_sandboxes.py +172 -0
  15. loopix/api/client/api/sandboxes/post_sandboxes_sandbox_id_connect.py +193 -0
  16. loopix/api/client/api/sandboxes/post_sandboxes_sandbox_id_pause.py +187 -0
  17. loopix/api/client/api/sandboxes/post_sandboxes_sandbox_id_refreshes.py +181 -0
  18. loopix/api/client/api/sandboxes/post_sandboxes_sandbox_id_resume.py +189 -0
  19. loopix/api/client/api/sandboxes/post_sandboxes_sandbox_id_snapshots.py +195 -0
  20. loopix/api/client/api/sandboxes/post_sandboxes_sandbox_id_timeout.py +193 -0
  21. loopix/api/client/api/sandboxes/put_sandboxes_sandbox_id_network.py +199 -0
  22. loopix/api/client/api/snapshots/__init__.py +1 -0
  23. loopix/api/client/api/snapshots/get_snapshots.py +202 -0
  24. loopix/api/client/api/tags/__init__.py +1 -0
  25. loopix/api/client/api/tags/delete_templates_tags.py +174 -0
  26. loopix/api/client/api/tags/get_templates_template_id_tags.py +172 -0
  27. loopix/api/client/api/tags/post_templates_tags.py +176 -0
  28. loopix/api/client/api/templates/__init__.py +1 -0
  29. loopix/api/client/api/templates/delete_templates_template_id.py +157 -0
  30. loopix/api/client/api/templates/get_templates.py +172 -0
  31. loopix/api/client/api/templates/get_templates_aliases_alias.py +167 -0
  32. loopix/api/client/api/templates/get_templates_template_id.py +195 -0
  33. loopix/api/client/api/templates/get_templates_template_id_builds_build_id_logs.py +272 -0
  34. loopix/api/client/api/templates/get_templates_template_id_builds_build_id_status.py +232 -0
  35. loopix/api/client/api/templates/get_templates_template_id_files_hash.py +180 -0
  36. loopix/api/client/api/templates/patch_templates_template_id.py +183 -0
  37. loopix/api/client/api/templates/patch_v_2_templates_template_id.py +185 -0
  38. loopix/api/client/api/templates/post_templates.py +172 -0
  39. loopix/api/client/api/templates/post_templates_template_id.py +181 -0
  40. loopix/api/client/api/templates/post_templates_template_id_builds_build_id.py +170 -0
  41. loopix/api/client/api/templates/post_v2_templates.py +172 -0
  42. loopix/api/client/api/templates/post_v3_templates.py +176 -0
  43. loopix/api/client/api/templates/post_v_2_templates_template_id_builds_build_id.py +192 -0
  44. loopix/api/client/api/volumes/__init__.py +1 -0
  45. loopix/api/client/api/volumes/delete_volumes_volume_id.py +161 -0
  46. loopix/api/client/api/volumes/get_volumes.py +140 -0
  47. loopix/api/client/api/volumes/get_volumes_volume_id.py +163 -0
  48. loopix/api/client/api/volumes/post_volumes.py +172 -0
  49. loopix/api/client/client.py +286 -0
  50. loopix/api/client/errors.py +16 -0
  51. loopix/api/client/models/__init__.py +185 -0
  52. loopix/api/client/models/admin_build_cancel_result.py +67 -0
  53. loopix/api/client/models/admin_sandbox_kill_result.py +67 -0
  54. loopix/api/client/models/assign_template_tags_request.py +67 -0
  55. loopix/api/client/models/assigned_template_tags.py +68 -0
  56. loopix/api/client/models/aws_registry.py +85 -0
  57. loopix/api/client/models/aws_registry_type.py +8 -0
  58. loopix/api/client/models/build_log_entry.py +89 -0
  59. loopix/api/client/models/build_status_reason.py +95 -0
  60. loopix/api/client/models/connect_sandbox.py +59 -0
  61. loopix/api/client/models/created_access_token.py +100 -0
  62. loopix/api/client/models/created_team_api_key.py +166 -0
  63. loopix/api/client/models/delete_template_tags_request.py +67 -0
  64. loopix/api/client/models/disk_metrics.py +91 -0
  65. loopix/api/client/models/error.py +67 -0
  66. loopix/api/client/models/gcp_registry.py +69 -0
  67. loopix/api/client/models/gcp_registry_type.py +8 -0
  68. loopix/api/client/models/general_registry.py +77 -0
  69. loopix/api/client/models/general_registry_type.py +8 -0
  70. loopix/api/client/models/identifier_masking_details.py +83 -0
  71. loopix/api/client/models/listed_sandbox.py +179 -0
  72. loopix/api/client/models/log_level.py +11 -0
  73. loopix/api/client/models/logs_direction.py +9 -0
  74. loopix/api/client/models/logs_source.py +9 -0
  75. loopix/api/client/models/machine_info.py +83 -0
  76. loopix/api/client/models/max_team_metric.py +78 -0
  77. loopix/api/client/models/mcp_type_0.py +44 -0
  78. loopix/api/client/models/new_access_token.py +59 -0
  79. loopix/api/client/models/new_sandbox.py +224 -0
  80. loopix/api/client/models/new_team_api_key.py +59 -0
  81. loopix/api/client/models/new_volume.py +59 -0
  82. loopix/api/client/models/node.py +160 -0
  83. loopix/api/client/models/node_detail.py +160 -0
  84. loopix/api/client/models/node_metrics.py +122 -0
  85. loopix/api/client/models/node_status.py +12 -0
  86. loopix/api/client/models/node_status_change.py +82 -0
  87. loopix/api/client/models/post_sandboxes_sandbox_id_refreshes_body.py +59 -0
  88. loopix/api/client/models/post_sandboxes_sandbox_id_snapshots_body.py +60 -0
  89. loopix/api/client/models/post_sandboxes_sandbox_id_timeout_body.py +59 -0
  90. loopix/api/client/models/resumed_sandbox.py +68 -0
  91. loopix/api/client/models/sandbox.py +145 -0
  92. loopix/api/client/models/sandbox_auto_resume_config.py +60 -0
  93. loopix/api/client/models/sandbox_detail.py +267 -0
  94. loopix/api/client/models/sandbox_lifecycle.py +70 -0
  95. loopix/api/client/models/sandbox_log.py +70 -0
  96. loopix/api/client/models/sandbox_log_entry.py +93 -0
  97. loopix/api/client/models/sandbox_log_entry_fields.py +44 -0
  98. loopix/api/client/models/sandbox_logs.py +91 -0
  99. loopix/api/client/models/sandbox_logs_v2_response.py +73 -0
  100. loopix/api/client/models/sandbox_metric.py +126 -0
  101. loopix/api/client/models/sandbox_network_config.py +118 -0
  102. loopix/api/client/models/sandbox_network_config_rules.py +72 -0
  103. loopix/api/client/models/sandbox_network_rule.py +74 -0
  104. loopix/api/client/models/sandbox_network_transform.py +79 -0
  105. loopix/api/client/models/sandbox_network_transform_headers.py +47 -0
  106. loopix/api/client/models/sandbox_network_update_config.py +114 -0
  107. loopix/api/client/models/sandbox_network_update_config_rules.py +71 -0
  108. loopix/api/client/models/sandbox_on_timeout.py +9 -0
  109. loopix/api/client/models/sandbox_pause_request.py +62 -0
  110. loopix/api/client/models/sandbox_state.py +9 -0
  111. loopix/api/client/models/sandbox_volume_mount.py +67 -0
  112. loopix/api/client/models/sandboxes_with_metrics.py +59 -0
  113. loopix/api/client/models/snapshot_info.py +70 -0
  114. loopix/api/client/models/team.py +83 -0
  115. loopix/api/client/models/team_api_key.py +158 -0
  116. loopix/api/client/models/team_metric.py +86 -0
  117. loopix/api/client/models/team_user.py +75 -0
  118. loopix/api/client/models/template.py +225 -0
  119. loopix/api/client/models/template_alias_response.py +67 -0
  120. loopix/api/client/models/template_build.py +139 -0
  121. loopix/api/client/models/template_build_file_upload.py +70 -0
  122. loopix/api/client/models/template_build_info.py +126 -0
  123. loopix/api/client/models/template_build_logs_response.py +73 -0
  124. loopix/api/client/models/template_build_request.py +115 -0
  125. loopix/api/client/models/template_build_request_v2.py +88 -0
  126. loopix/api/client/models/template_build_request_v3.py +107 -0
  127. loopix/api/client/models/template_build_start_v2.py +184 -0
  128. loopix/api/client/models/template_build_status.py +11 -0
  129. loopix/api/client/models/template_legacy.py +207 -0
  130. loopix/api/client/models/template_request_response_v3.py +99 -0
  131. loopix/api/client/models/template_step.py +91 -0
  132. loopix/api/client/models/template_tag.py +78 -0
  133. loopix/api/client/models/template_update_request.py +59 -0
  134. loopix/api/client/models/template_update_response.py +59 -0
  135. loopix/api/client/models/template_with_builds.py +156 -0
  136. loopix/api/client/models/update_team_api_key.py +59 -0
  137. loopix/api/client/models/volume.py +67 -0
  138. loopix/api/client/models/volume_and_token.py +75 -0
  139. loopix/api/client/models/volume_token.py +59 -0
  140. loopix/api/client/py.typed +1 -0
  141. loopix/api/client/types.py +54 -0
  142. loopix/api/client_async/__init__.py +74 -0
  143. loopix/api/client_sync/__init__.py +73 -0
  144. loopix/api/metadata.py +14 -0
  145. loopix/connection_config.py +309 -0
  146. loopix/envd/api.py +170 -0
  147. loopix/envd/filesystem/filesystem_connect.py +193 -0
  148. loopix/envd/filesystem/filesystem_pb2.py +80 -0
  149. loopix/envd/filesystem/filesystem_pb2.pyi +272 -0
  150. loopix/envd/process/process_connect.py +174 -0
  151. loopix/envd/process/process_pb2.py +96 -0
  152. loopix/envd/process/process_pb2.pyi +316 -0
  153. loopix/envd/rpc.py +139 -0
  154. loopix/envd/versions.py +11 -0
  155. loopix/exceptions.py +133 -0
  156. loopix/io_utils.py +57 -0
  157. loopix/paginator.py +52 -0
  158. loopix/py.typed +0 -0
  159. loopix/sandbox/_git/__init__.py +85 -0
  160. loopix/sandbox/_git/args.py +363 -0
  161. loopix/sandbox/_git/auth.py +132 -0
  162. loopix/sandbox/_git/config.py +32 -0
  163. loopix/sandbox/_git/parse.py +222 -0
  164. loopix/sandbox/_git/types.py +149 -0
  165. loopix/sandbox/commands/command_handle.py +69 -0
  166. loopix/sandbox/commands/main.py +39 -0
  167. loopix/sandbox/filesystem/filesystem.py +337 -0
  168. loopix/sandbox/filesystem/watch_handle.py +70 -0
  169. loopix/sandbox/main.py +227 -0
  170. loopix/sandbox/mcp.py +1949 -0
  171. loopix/sandbox/network.py +8 -0
  172. loopix/sandbox/sandbox_api.py +624 -0
  173. loopix/sandbox/signature.py +47 -0
  174. loopix/sandbox/utils.py +34 -0
  175. loopix/sandbox_async/commands/command.py +396 -0
  176. loopix/sandbox_async/commands/command_handle.py +298 -0
  177. loopix/sandbox_async/commands/pty.py +257 -0
  178. loopix/sandbox_async/filesystem/filesystem.py +720 -0
  179. loopix/sandbox_async/filesystem/watch_handle.py +97 -0
  180. loopix/sandbox_async/git.py +1100 -0
  181. loopix/sandbox_async/main.py +987 -0
  182. loopix/sandbox_async/paginator.py +140 -0
  183. loopix/sandbox_async/sandbox_api.py +504 -0
  184. loopix/sandbox_async/utils.py +7 -0
  185. loopix/sandbox_domains.py +5 -0
  186. loopix/sandbox_sync/commands/command.py +420 -0
  187. loopix/sandbox_sync/commands/command_handle.py +239 -0
  188. loopix/sandbox_sync/commands/pty.py +279 -0
  189. loopix/sandbox_sync/filesystem/filesystem.py +710 -0
  190. loopix/sandbox_sync/filesystem/watch_handle.py +102 -0
  191. loopix/sandbox_sync/git.py +1077 -0
  192. loopix/sandbox_sync/main.py +975 -0
  193. loopix/sandbox_sync/paginator.py +140 -0
  194. loopix/sandbox_sync/sandbox_api.py +491 -0
  195. loopix/template/consts.py +45 -0
  196. loopix/template/dockerfile_parser.py +286 -0
  197. loopix/template/logger.py +232 -0
  198. loopix/template/main.py +1368 -0
  199. loopix/template/readycmd.py +144 -0
  200. loopix/template/types.py +194 -0
  201. loopix/template/utils.py +426 -0
  202. loopix/template_async/build_api.py +419 -0
  203. loopix/template_async/main.py +528 -0
  204. loopix/template_sync/build_api.py +409 -0
  205. loopix/template_sync/main.py +529 -0
  206. loopix/volume/client/__init__.py +8 -0
  207. loopix/volume/client/api/__init__.py +1 -0
  208. loopix/volume/client/api/volumes/__init__.py +1 -0
  209. loopix/volume/client/api/volumes/delete_volumecontent_volume_id_path.py +174 -0
  210. loopix/volume/client/api/volumes/get_volumecontent_volume_id_dir.py +204 -0
  211. loopix/volume/client/api/volumes/get_volumecontent_volume_id_file.py +179 -0
  212. loopix/volume/client/api/volumes/get_volumecontent_volume_id_path.py +176 -0
  213. loopix/volume/client/api/volumes/patch_volumecontent_volume_id_path.py +203 -0
  214. loopix/volume/client/api/volumes/post_volumecontent_volume_id_dir.py +239 -0
  215. loopix/volume/client/api/volumes/put_volumecontent_volume_id_file.py +259 -0
  216. loopix/volume/client/client.py +286 -0
  217. loopix/volume/client/errors.py +16 -0
  218. loopix/volume/client/models/__init__.py +13 -0
  219. loopix/volume/client/models/error.py +67 -0
  220. loopix/volume/client/models/patch_volumecontent_volume_id_path_body.py +77 -0
  221. loopix/volume/client/models/volume_entry_stat.py +145 -0
  222. loopix/volume/client/models/volume_entry_stat_type.py +11 -0
  223. loopix/volume/client/py.typed +1 -0
  224. loopix/volume/client/types.py +54 -0
  225. loopix/volume/client_async/__init__.py +88 -0
  226. loopix/volume/client_sync/__init__.py +80 -0
  227. loopix/volume/connection_config.py +145 -0
  228. loopix/volume/types.py +62 -0
  229. loopix/volume/utils.py +52 -0
  230. loopix/volume/volume_async.py +639 -0
  231. loopix/volume/volume_sync.py +639 -0
  232. loopix_connect/__init__.py +1 -0
  233. loopix_connect/client.py +534 -0
  234. loopix_connect/py.typed +0 -0
  235. loopix_sdk-2.30.0.dist-info/METADATA +98 -0
  236. loopix_sdk-2.30.0.dist-info/RECORD +238 -0
  237. loopix_sdk-2.30.0.dist-info/WHEEL +4 -0
  238. loopix_sdk-2.30.0.dist-info/licenses/LICENSE +9 -0
@@ -0,0 +1,224 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.mcp_type_0 import McpType0
11
+ from ..models.sandbox_auto_resume_config import SandboxAutoResumeConfig
12
+ from ..models.sandbox_network_config import SandboxNetworkConfig
13
+ from ..models.sandbox_volume_mount import SandboxVolumeMount
14
+
15
+
16
+ T = TypeVar("T", bound="NewSandbox")
17
+
18
+
19
+ @_attrs_define
20
+ class NewSandbox:
21
+ """
22
+ Attributes:
23
+ template_id (str): Identifier of the required template
24
+ allow_internet_access (Union[Unset, bool]): Allow sandbox to access the internet. When set to false, it behaves
25
+ the same as specifying denyOut to 0.0.0.0/0 in the network config.
26
+ auto_pause (Union[Unset, bool]): Automatically pauses the sandbox after the timeout Default: False.
27
+ auto_pause_memory (Union[Unset, bool]): Controls the snapshot kind taken when the sandbox auto-pauses on timeout
28
+ (only relevant when autoPause is true). When false, the auto-pause drops the in-memory state and persists only
29
+ the filesystem (a filesystem-only snapshot); resuming it cold-boots (reboots) the sandbox from disk. Such a
30
+ snapshot cannot be auto-resumed by traffic and must be resumed explicitly, so it cannot be combined with
31
+ autoResume. Defaults to true (full memory snapshot). Default: True.
32
+ auto_resume (Union[Unset, SandboxAutoResumeConfig]): Auto-resume configuration for paused sandboxes.
33
+ env_vars (Union[Unset, Any]):
34
+ mcp (Union['McpType0', None, Unset]): MCP configuration for the sandbox
35
+ metadata (Union[Unset, Any]):
36
+ network (Union[Unset, SandboxNetworkConfig]):
37
+ secure (Union[Unset, bool]): Secure all system communication with sandbox
38
+ timeout (Union[Unset, int]): Time to live for the sandbox in seconds. Default: 15.
39
+ volume_mounts (Union[Unset, list['SandboxVolumeMount']]):
40
+ """
41
+
42
+ template_id: str
43
+ allow_internet_access: Union[Unset, bool] = UNSET
44
+ auto_pause: Union[Unset, bool] = False
45
+ auto_pause_memory: Union[Unset, bool] = True
46
+ auto_resume: Union[Unset, "SandboxAutoResumeConfig"] = UNSET
47
+ env_vars: Union[Unset, Any] = UNSET
48
+ mcp: Union["McpType0", None, Unset] = UNSET
49
+ metadata: Union[Unset, Any] = UNSET
50
+ network: Union[Unset, "SandboxNetworkConfig"] = UNSET
51
+ secure: Union[Unset, bool] = UNSET
52
+ timeout: Union[Unset, int] = 15
53
+ volume_mounts: Union[Unset, list["SandboxVolumeMount"]] = UNSET
54
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
55
+
56
+ def to_dict(self) -> dict[str, Any]:
57
+ from ..models.mcp_type_0 import McpType0
58
+
59
+ template_id = self.template_id
60
+
61
+ allow_internet_access = self.allow_internet_access
62
+
63
+ auto_pause = self.auto_pause
64
+
65
+ auto_pause_memory = self.auto_pause_memory
66
+
67
+ auto_resume: Union[Unset, dict[str, Any]] = UNSET
68
+ if not isinstance(self.auto_resume, Unset):
69
+ auto_resume = self.auto_resume.to_dict()
70
+
71
+ env_vars = self.env_vars
72
+
73
+ mcp: Union[None, Unset, dict[str, Any]]
74
+ if isinstance(self.mcp, Unset):
75
+ mcp = UNSET
76
+ elif isinstance(self.mcp, McpType0):
77
+ mcp = self.mcp.to_dict()
78
+ else:
79
+ mcp = self.mcp
80
+
81
+ metadata = self.metadata
82
+
83
+ network: Union[Unset, dict[str, Any]] = UNSET
84
+ if not isinstance(self.network, Unset):
85
+ network = self.network.to_dict()
86
+
87
+ secure = self.secure
88
+
89
+ timeout = self.timeout
90
+
91
+ volume_mounts: Union[Unset, list[dict[str, Any]]] = UNSET
92
+ if not isinstance(self.volume_mounts, Unset):
93
+ volume_mounts = []
94
+ for volume_mounts_item_data in self.volume_mounts:
95
+ volume_mounts_item = volume_mounts_item_data.to_dict()
96
+ volume_mounts.append(volume_mounts_item)
97
+
98
+ field_dict: dict[str, Any] = {}
99
+ field_dict.update(self.additional_properties)
100
+ field_dict.update(
101
+ {
102
+ "templateID": template_id,
103
+ }
104
+ )
105
+ if allow_internet_access is not UNSET:
106
+ field_dict["allow_internet_access"] = allow_internet_access
107
+ if auto_pause is not UNSET:
108
+ field_dict["autoPause"] = auto_pause
109
+ if auto_pause_memory is not UNSET:
110
+ field_dict["autoPauseMemory"] = auto_pause_memory
111
+ if auto_resume is not UNSET:
112
+ field_dict["autoResume"] = auto_resume
113
+ if env_vars is not UNSET:
114
+ field_dict["envVars"] = env_vars
115
+ if mcp is not UNSET:
116
+ field_dict["mcp"] = mcp
117
+ if metadata is not UNSET:
118
+ field_dict["metadata"] = metadata
119
+ if network is not UNSET:
120
+ field_dict["network"] = network
121
+ if secure is not UNSET:
122
+ field_dict["secure"] = secure
123
+ if timeout is not UNSET:
124
+ field_dict["timeout"] = timeout
125
+ if volume_mounts is not UNSET:
126
+ field_dict["volumeMounts"] = volume_mounts
127
+
128
+ return field_dict
129
+
130
+ @classmethod
131
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
132
+ from ..models.mcp_type_0 import McpType0
133
+ from ..models.sandbox_auto_resume_config import SandboxAutoResumeConfig
134
+ from ..models.sandbox_network_config import SandboxNetworkConfig
135
+ from ..models.sandbox_volume_mount import SandboxVolumeMount
136
+
137
+ d = dict(src_dict)
138
+ template_id = d.pop("templateID")
139
+
140
+ allow_internet_access = d.pop("allow_internet_access", UNSET)
141
+
142
+ auto_pause = d.pop("autoPause", UNSET)
143
+
144
+ auto_pause_memory = d.pop("autoPauseMemory", UNSET)
145
+
146
+ _auto_resume = d.pop("autoResume", UNSET)
147
+ auto_resume: Union[Unset, SandboxAutoResumeConfig]
148
+ if isinstance(_auto_resume, Unset):
149
+ auto_resume = UNSET
150
+ else:
151
+ auto_resume = SandboxAutoResumeConfig.from_dict(_auto_resume)
152
+
153
+ env_vars = d.pop("envVars", UNSET)
154
+
155
+ def _parse_mcp(data: object) -> Union["McpType0", None, Unset]:
156
+ if data is None:
157
+ return data
158
+ if isinstance(data, Unset):
159
+ return data
160
+ try:
161
+ if not isinstance(data, dict):
162
+ raise TypeError()
163
+ componentsschemas_mcp_type_0 = McpType0.from_dict(data)
164
+
165
+ return componentsschemas_mcp_type_0
166
+ except: # noqa: E722
167
+ pass
168
+ return cast(Union["McpType0", None, Unset], data)
169
+
170
+ mcp = _parse_mcp(d.pop("mcp", UNSET))
171
+
172
+ metadata = d.pop("metadata", UNSET)
173
+
174
+ _network = d.pop("network", UNSET)
175
+ network: Union[Unset, SandboxNetworkConfig]
176
+ if isinstance(_network, Unset):
177
+ network = UNSET
178
+ else:
179
+ network = SandboxNetworkConfig.from_dict(_network)
180
+
181
+ secure = d.pop("secure", UNSET)
182
+
183
+ timeout = d.pop("timeout", UNSET)
184
+
185
+ volume_mounts = []
186
+ _volume_mounts = d.pop("volumeMounts", UNSET)
187
+ for volume_mounts_item_data in _volume_mounts or []:
188
+ volume_mounts_item = SandboxVolumeMount.from_dict(volume_mounts_item_data)
189
+
190
+ volume_mounts.append(volume_mounts_item)
191
+
192
+ new_sandbox = cls(
193
+ template_id=template_id,
194
+ allow_internet_access=allow_internet_access,
195
+ auto_pause=auto_pause,
196
+ auto_pause_memory=auto_pause_memory,
197
+ auto_resume=auto_resume,
198
+ env_vars=env_vars,
199
+ mcp=mcp,
200
+ metadata=metadata,
201
+ network=network,
202
+ secure=secure,
203
+ timeout=timeout,
204
+ volume_mounts=volume_mounts,
205
+ )
206
+
207
+ new_sandbox.additional_properties = d
208
+ return new_sandbox
209
+
210
+ @property
211
+ def additional_keys(self) -> list[str]:
212
+ return list(self.additional_properties.keys())
213
+
214
+ def __getitem__(self, key: str) -> Any:
215
+ return self.additional_properties[key]
216
+
217
+ def __setitem__(self, key: str, value: Any) -> None:
218
+ self.additional_properties[key] = value
219
+
220
+ def __delitem__(self, key: str) -> None:
221
+ del self.additional_properties[key]
222
+
223
+ def __contains__(self, key: str) -> bool:
224
+ return key in self.additional_properties
@@ -0,0 +1,59 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ T = TypeVar("T", bound="NewTeamAPIKey")
8
+
9
+
10
+ @_attrs_define
11
+ class NewTeamAPIKey:
12
+ """
13
+ Attributes:
14
+ name (str): Name of the API key
15
+ """
16
+
17
+ name: str
18
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
19
+
20
+ def to_dict(self) -> dict[str, Any]:
21
+ name = self.name
22
+
23
+ field_dict: dict[str, Any] = {}
24
+ field_dict.update(self.additional_properties)
25
+ field_dict.update(
26
+ {
27
+ "name": name,
28
+ }
29
+ )
30
+
31
+ return field_dict
32
+
33
+ @classmethod
34
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
35
+ d = dict(src_dict)
36
+ name = d.pop("name")
37
+
38
+ new_team_api_key = cls(
39
+ name=name,
40
+ )
41
+
42
+ new_team_api_key.additional_properties = d
43
+ return new_team_api_key
44
+
45
+ @property
46
+ def additional_keys(self) -> list[str]:
47
+ return list(self.additional_properties.keys())
48
+
49
+ def __getitem__(self, key: str) -> Any:
50
+ return self.additional_properties[key]
51
+
52
+ def __setitem__(self, key: str, value: Any) -> None:
53
+ self.additional_properties[key] = value
54
+
55
+ def __delitem__(self, key: str) -> None:
56
+ del self.additional_properties[key]
57
+
58
+ def __contains__(self, key: str) -> bool:
59
+ return key in self.additional_properties
@@ -0,0 +1,59 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ T = TypeVar("T", bound="NewVolume")
8
+
9
+
10
+ @_attrs_define
11
+ class NewVolume:
12
+ """
13
+ Attributes:
14
+ name (str): Name of the volume
15
+ """
16
+
17
+ name: str
18
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
19
+
20
+ def to_dict(self) -> dict[str, Any]:
21
+ name = self.name
22
+
23
+ field_dict: dict[str, Any] = {}
24
+ field_dict.update(self.additional_properties)
25
+ field_dict.update(
26
+ {
27
+ "name": name,
28
+ }
29
+ )
30
+
31
+ return field_dict
32
+
33
+ @classmethod
34
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
35
+ d = dict(src_dict)
36
+ name = d.pop("name")
37
+
38
+ new_volume = cls(
39
+ name=name,
40
+ )
41
+
42
+ new_volume.additional_properties = d
43
+ return new_volume
44
+
45
+ @property
46
+ def additional_keys(self) -> list[str]:
47
+ return list(self.additional_properties.keys())
48
+
49
+ def __getitem__(self, key: str) -> Any:
50
+ return self.additional_properties[key]
51
+
52
+ def __setitem__(self, key: str, value: Any) -> None:
53
+ self.additional_properties[key] = value
54
+
55
+ def __delitem__(self, key: str) -> None:
56
+ del self.additional_properties[key]
57
+
58
+ def __contains__(self, key: str) -> bool:
59
+ return key in self.additional_properties
@@ -0,0 +1,160 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, Any, TypeVar
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..models.node_status import NodeStatus
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.machine_info import MachineInfo
11
+ from ..models.node_metrics import NodeMetrics
12
+
13
+
14
+ T = TypeVar("T", bound="Node")
15
+
16
+
17
+ @_attrs_define
18
+ class Node:
19
+ """
20
+ Attributes:
21
+ cluster_id (str): Identifier of the cluster
22
+ commit (str): Commit of the orchestrator
23
+ create_fails (int): Number of sandbox create fails
24
+ create_successes (int): Number of sandbox create successes
25
+ id (str): Identifier of the node
26
+ machine_info (MachineInfo):
27
+ metrics (NodeMetrics): Node metrics
28
+ sandbox_count (int): Number of sandboxes running on the node
29
+ sandbox_starting_count (int): Number of starting Sandboxes
30
+ service_instance_id (str): Service instance identifier of the node
31
+ status (NodeStatus): Status of the node.
32
+ - draining: the node is bound to be shut down. It will not accept new sandboxes and will stop once all existing
33
+ sandboxes are done.
34
+ - standby: the node is not actively used, but it can return to ready and continue serving traffic.
35
+ version (str): Version of the orchestrator
36
+ """
37
+
38
+ cluster_id: str
39
+ commit: str
40
+ create_fails: int
41
+ create_successes: int
42
+ id: str
43
+ machine_info: "MachineInfo"
44
+ metrics: "NodeMetrics"
45
+ sandbox_count: int
46
+ sandbox_starting_count: int
47
+ service_instance_id: str
48
+ status: NodeStatus
49
+ version: str
50
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
51
+
52
+ def to_dict(self) -> dict[str, Any]:
53
+ cluster_id = self.cluster_id
54
+
55
+ commit = self.commit
56
+
57
+ create_fails = self.create_fails
58
+
59
+ create_successes = self.create_successes
60
+
61
+ id = self.id
62
+
63
+ machine_info = self.machine_info.to_dict()
64
+
65
+ metrics = self.metrics.to_dict()
66
+
67
+ sandbox_count = self.sandbox_count
68
+
69
+ sandbox_starting_count = self.sandbox_starting_count
70
+
71
+ service_instance_id = self.service_instance_id
72
+
73
+ status = self.status.value
74
+
75
+ version = self.version
76
+
77
+ field_dict: dict[str, Any] = {}
78
+ field_dict.update(self.additional_properties)
79
+ field_dict.update(
80
+ {
81
+ "clusterID": cluster_id,
82
+ "commit": commit,
83
+ "createFails": create_fails,
84
+ "createSuccesses": create_successes,
85
+ "id": id,
86
+ "machineInfo": machine_info,
87
+ "metrics": metrics,
88
+ "sandboxCount": sandbox_count,
89
+ "sandboxStartingCount": sandbox_starting_count,
90
+ "serviceInstanceID": service_instance_id,
91
+ "status": status,
92
+ "version": version,
93
+ }
94
+ )
95
+
96
+ return field_dict
97
+
98
+ @classmethod
99
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
100
+ from ..models.machine_info import MachineInfo
101
+ from ..models.node_metrics import NodeMetrics
102
+
103
+ d = dict(src_dict)
104
+ cluster_id = d.pop("clusterID")
105
+
106
+ commit = d.pop("commit")
107
+
108
+ create_fails = d.pop("createFails")
109
+
110
+ create_successes = d.pop("createSuccesses")
111
+
112
+ id = d.pop("id")
113
+
114
+ machine_info = MachineInfo.from_dict(d.pop("machineInfo"))
115
+
116
+ metrics = NodeMetrics.from_dict(d.pop("metrics"))
117
+
118
+ sandbox_count = d.pop("sandboxCount")
119
+
120
+ sandbox_starting_count = d.pop("sandboxStartingCount")
121
+
122
+ service_instance_id = d.pop("serviceInstanceID")
123
+
124
+ status = NodeStatus(d.pop("status"))
125
+
126
+ version = d.pop("version")
127
+
128
+ node = cls(
129
+ cluster_id=cluster_id,
130
+ commit=commit,
131
+ create_fails=create_fails,
132
+ create_successes=create_successes,
133
+ id=id,
134
+ machine_info=machine_info,
135
+ metrics=metrics,
136
+ sandbox_count=sandbox_count,
137
+ sandbox_starting_count=sandbox_starting_count,
138
+ service_instance_id=service_instance_id,
139
+ status=status,
140
+ version=version,
141
+ )
142
+
143
+ node.additional_properties = d
144
+ return node
145
+
146
+ @property
147
+ def additional_keys(self) -> list[str]:
148
+ return list(self.additional_properties.keys())
149
+
150
+ def __getitem__(self, key: str) -> Any:
151
+ return self.additional_properties[key]
152
+
153
+ def __setitem__(self, key: str, value: Any) -> None:
154
+ self.additional_properties[key] = value
155
+
156
+ def __delitem__(self, key: str) -> None:
157
+ del self.additional_properties[key]
158
+
159
+ def __contains__(self, key: str) -> bool:
160
+ return key in self.additional_properties
@@ -0,0 +1,160 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, Any, TypeVar, cast
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..models.node_status import NodeStatus
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.machine_info import MachineInfo
11
+ from ..models.node_metrics import NodeMetrics
12
+
13
+
14
+ T = TypeVar("T", bound="NodeDetail")
15
+
16
+
17
+ @_attrs_define
18
+ class NodeDetail:
19
+ """
20
+ Attributes:
21
+ cached_builds (list[str]): List of cached builds id on the node
22
+ cluster_id (str): Identifier of the cluster
23
+ commit (str): Commit of the orchestrator
24
+ create_fails (int): Number of sandbox create fails
25
+ create_successes (int): Number of sandbox create successes
26
+ id (str): Identifier of the node
27
+ machine_info (MachineInfo):
28
+ metrics (NodeMetrics): Node metrics
29
+ sandbox_count (int): Number of sandboxes running on the node
30
+ service_instance_id (str): Service instance identifier of the node
31
+ status (NodeStatus): Status of the node.
32
+ - draining: the node is bound to be shut down. It will not accept new sandboxes and will stop once all existing
33
+ sandboxes are done.
34
+ - standby: the node is not actively used, but it can return to ready and continue serving traffic.
35
+ version (str): Version of the orchestrator
36
+ """
37
+
38
+ cached_builds: list[str]
39
+ cluster_id: str
40
+ commit: str
41
+ create_fails: int
42
+ create_successes: int
43
+ id: str
44
+ machine_info: "MachineInfo"
45
+ metrics: "NodeMetrics"
46
+ sandbox_count: int
47
+ service_instance_id: str
48
+ status: NodeStatus
49
+ version: str
50
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
51
+
52
+ def to_dict(self) -> dict[str, Any]:
53
+ cached_builds = self.cached_builds
54
+
55
+ cluster_id = self.cluster_id
56
+
57
+ commit = self.commit
58
+
59
+ create_fails = self.create_fails
60
+
61
+ create_successes = self.create_successes
62
+
63
+ id = self.id
64
+
65
+ machine_info = self.machine_info.to_dict()
66
+
67
+ metrics = self.metrics.to_dict()
68
+
69
+ sandbox_count = self.sandbox_count
70
+
71
+ service_instance_id = self.service_instance_id
72
+
73
+ status = self.status.value
74
+
75
+ version = self.version
76
+
77
+ field_dict: dict[str, Any] = {}
78
+ field_dict.update(self.additional_properties)
79
+ field_dict.update(
80
+ {
81
+ "cachedBuilds": cached_builds,
82
+ "clusterID": cluster_id,
83
+ "commit": commit,
84
+ "createFails": create_fails,
85
+ "createSuccesses": create_successes,
86
+ "id": id,
87
+ "machineInfo": machine_info,
88
+ "metrics": metrics,
89
+ "sandboxCount": sandbox_count,
90
+ "serviceInstanceID": service_instance_id,
91
+ "status": status,
92
+ "version": version,
93
+ }
94
+ )
95
+
96
+ return field_dict
97
+
98
+ @classmethod
99
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
100
+ from ..models.machine_info import MachineInfo
101
+ from ..models.node_metrics import NodeMetrics
102
+
103
+ d = dict(src_dict)
104
+ cached_builds = cast(list[str], d.pop("cachedBuilds"))
105
+
106
+ cluster_id = d.pop("clusterID")
107
+
108
+ commit = d.pop("commit")
109
+
110
+ create_fails = d.pop("createFails")
111
+
112
+ create_successes = d.pop("createSuccesses")
113
+
114
+ id = d.pop("id")
115
+
116
+ machine_info = MachineInfo.from_dict(d.pop("machineInfo"))
117
+
118
+ metrics = NodeMetrics.from_dict(d.pop("metrics"))
119
+
120
+ sandbox_count = d.pop("sandboxCount")
121
+
122
+ service_instance_id = d.pop("serviceInstanceID")
123
+
124
+ status = NodeStatus(d.pop("status"))
125
+
126
+ version = d.pop("version")
127
+
128
+ node_detail = cls(
129
+ cached_builds=cached_builds,
130
+ cluster_id=cluster_id,
131
+ commit=commit,
132
+ create_fails=create_fails,
133
+ create_successes=create_successes,
134
+ id=id,
135
+ machine_info=machine_info,
136
+ metrics=metrics,
137
+ sandbox_count=sandbox_count,
138
+ service_instance_id=service_instance_id,
139
+ status=status,
140
+ version=version,
141
+ )
142
+
143
+ node_detail.additional_properties = d
144
+ return node_detail
145
+
146
+ @property
147
+ def additional_keys(self) -> list[str]:
148
+ return list(self.additional_properties.keys())
149
+
150
+ def __getitem__(self, key: str) -> Any:
151
+ return self.additional_properties[key]
152
+
153
+ def __setitem__(self, key: str, value: Any) -> None:
154
+ self.additional_properties[key] = value
155
+
156
+ def __delitem__(self, key: str) -> None:
157
+ del self.additional_properties[key]
158
+
159
+ def __contains__(self, key: str) -> bool:
160
+ return key in self.additional_properties