blaxel 0.2.26rc119__py3-none-any.whl → 0.2.28__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/__init__.py +9 -1
- blaxel/core/client/api/{privateclusters/create_private_cluster.py → images/cleanup_images.py} +31 -25
- blaxel/core/client/models/__init__.py +2 -4
- blaxel/core/client/models/agent.py +1 -0
- blaxel/core/client/models/agent_spec.py +1 -24
- blaxel/core/client/models/billable_time_metric.py +1 -0
- blaxel/core/{sandbox/client/models/find_match.py → client/models/cleanup_images_response_200.py} +19 -19
- blaxel/core/client/models/configuration.py +1 -0
- blaxel/core/client/models/core_event.py +9 -0
- blaxel/core/client/models/core_spec.py +1 -24
- blaxel/core/client/models/core_spec_configurations.py +1 -0
- blaxel/core/client/models/create_job_execution_request.py +1 -0
- blaxel/core/client/models/create_job_execution_response.py +1 -0
- blaxel/core/client/models/custom_domain.py +1 -0
- blaxel/core/client/models/custom_domain_metadata.py +1 -0
- blaxel/core/client/models/custom_domain_spec.py +1 -0
- blaxel/core/client/models/delete_volume_template_version_response_200.py +1 -0
- blaxel/core/client/models/entrypoint.py +1 -0
- blaxel/core/client/models/form.py +1 -0
- blaxel/core/client/models/function.py +1 -0
- blaxel/core/client/models/function_spec.py +1 -24
- blaxel/core/client/models/image.py +1 -0
- blaxel/core/client/models/image_spec.py +1 -0
- blaxel/core/client/models/integration.py +1 -0
- blaxel/core/client/models/integration_connection.py +1 -0
- blaxel/core/client/models/integration_connection_spec.py +1 -0
- blaxel/core/client/models/integration_endpoint.py +1 -0
- blaxel/core/client/models/integration_endpoints.py +2 -0
- blaxel/core/client/models/job.py +1 -0
- blaxel/core/client/models/job_execution.py +1 -0
- blaxel/core/client/models/job_execution_spec.py +1 -0
- blaxel/core/client/models/job_execution_task.py +1 -0
- blaxel/core/client/models/job_metrics.py +1 -0
- blaxel/core/client/models/job_spec.py +1 -24
- blaxel/core/client/models/jobs_network_chart.py +1 -0
- blaxel/core/client/models/jobs_success_failed_chart.py +1 -0
- blaxel/core/client/models/latency_metric.py +1 -0
- blaxel/core/client/models/location_response.py +1 -0
- blaxel/core/client/models/mcp_definition.py +1 -0
- blaxel/core/client/models/metadata.py +1 -0
- blaxel/core/client/models/metrics.py +34 -0
- blaxel/core/client/models/model.py +1 -0
- blaxel/core/client/models/model_spec.py +1 -24
- blaxel/core/client/models/pending_invitation_accept.py +1 -0
- blaxel/core/client/models/pending_invitation_render.py +1 -0
- blaxel/core/client/models/policy.py +1 -0
- blaxel/core/client/models/policy_spec.py +1 -0
- blaxel/core/client/models/preview.py +1 -0
- blaxel/core/client/models/preview_spec.py +1 -0
- blaxel/core/client/models/preview_token.py +1 -0
- blaxel/core/client/models/public_ips.py +1 -0
- blaxel/core/client/models/request_duration_over_time_metrics.py +1 -0
- blaxel/core/client/models/request_total_by_origin_metric.py +1 -0
- blaxel/core/client/models/request_total_metric.py +1 -0
- blaxel/core/client/models/resource_metrics.py +1 -0
- blaxel/core/client/models/revision_configuration.py +9 -0
- blaxel/core/client/models/runtime.py +1 -0
- blaxel/core/client/models/sandbox.py +1 -0
- blaxel/core/client/models/sandbox_definition.py +1 -0
- blaxel/core/client/models/sandbox_lifecycle.py +1 -0
- blaxel/core/client/models/sandbox_spec.py +1 -24
- blaxel/core/client/models/serverless_config.py +1 -0
- blaxel/core/client/models/start_sandbox.py +1 -0
- blaxel/core/client/models/stop_sandbox.py +1 -0
- blaxel/core/client/models/store_agent.py +1 -0
- blaxel/core/client/models/store_configuration.py +1 -0
- blaxel/core/client/models/template.py +1 -0
- blaxel/core/client/models/time_to_first_token_over_time_metrics.py +1 -0
- blaxel/core/client/models/token_rate_metrics.py +1 -0
- blaxel/core/client/models/trigger.py +10 -0
- blaxel/core/client/models/trigger_configuration.py +28 -0
- blaxel/core/client/models/volume.py +1 -0
- blaxel/core/client/models/volume_template.py +1 -0
- blaxel/core/client/models/websocket_channel.py +9 -0
- blaxel/core/client/models/workspace.py +1 -0
- blaxel/core/client/response_interceptor.py +0 -1
- blaxel/core/common/__init__.py +10 -0
- blaxel/core/common/autoload.py +5 -4
- blaxel/core/common/settings.py +29 -0
- blaxel/core/common/webhook.py +187 -0
- blaxel/core/jobs/__init__.py +355 -8
- blaxel/core/sandbox/client/models/__init__.py +0 -16
- blaxel/core/sandbox/default/action.py +10 -27
- blaxel/core/sandbox/default/filesystem.py +52 -187
- blaxel/core/sandbox/default/interpreter.py +55 -62
- blaxel/core/sandbox/default/process.py +46 -66
- blaxel/core/sandbox/sync/filesystem.py +5 -2
- blaxel/googleadk/model.py +0 -1
- blaxel/livekit/model.py +0 -1
- {blaxel-0.2.26rc119.dist-info → blaxel-0.2.28.dist-info}/METADATA +2 -2
- {blaxel-0.2.26rc119.dist-info → blaxel-0.2.28.dist-info}/RECORD +94 -117
- blaxel/core/client/api/privateclusters/__init__.py +0 -0
- blaxel/core/client/api/privateclusters/delete_private_cluster.py +0 -152
- blaxel/core/client/api/privateclusters/get_private_cluster.py +0 -155
- blaxel/core/client/api/privateclusters/get_private_cluster_health.py +0 -97
- blaxel/core/client/api/privateclusters/list_private_clusters.py +0 -136
- blaxel/core/client/api/privateclusters/update_private_cluster.py +0 -152
- blaxel/core/client/api/privateclusters/update_private_cluster_health.py +0 -97
- blaxel/core/client/models/model_private_cluster.py +0 -79
- blaxel/core/client/models/private_cluster.py +0 -183
- blaxel/core/sandbox/client/api/filesystem/delete_filesystem_tree_path.py +0 -188
- blaxel/core/sandbox/client/api/filesystem/get_filesystem_content_search_path.py +0 -265
- blaxel/core/sandbox/client/api/filesystem/get_filesystem_find_path.py +0 -248
- blaxel/core/sandbox/client/api/filesystem/get_filesystem_search_path.py +0 -237
- blaxel/core/sandbox/client/api/filesystem/get_filesystem_tree_path.py +0 -197
- blaxel/core/sandbox/client/api/filesystem/put_filesystem_tree_path.py +0 -223
- blaxel/core/sandbox/client/api/websocket/__init__.py +0 -0
- blaxel/core/sandbox/client/api/websocket/get_ws.py +0 -81
- blaxel/core/sandbox/client/models/content_search_match.py +0 -98
- blaxel/core/sandbox/client/models/content_search_response.py +0 -97
- blaxel/core/sandbox/client/models/find_response.py +0 -88
- blaxel/core/sandbox/client/models/fuzzy_search_match.py +0 -78
- blaxel/core/sandbox/client/models/fuzzy_search_response.py +0 -88
- blaxel/core/sandbox/client/models/tree_request.py +0 -76
- blaxel/core/sandbox/client/models/tree_request_files.py +0 -49
- {blaxel-0.2.26rc119.dist-info → blaxel-0.2.28.dist-info}/WHEEL +0 -0
- {blaxel-0.2.26rc119.dist-info → blaxel-0.2.28.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,183 +0,0 @@
|
|
|
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="PrivateCluster")
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@_attrs_define
|
|
12
|
-
class PrivateCluster:
|
|
13
|
-
"""A private cluster where models can be located on.
|
|
14
|
-
|
|
15
|
-
Attributes:
|
|
16
|
-
created_at (Union[Unset, str]): The date and time when the resource was created
|
|
17
|
-
updated_at (Union[Unset, str]): The date and time when the resource was updated
|
|
18
|
-
created_by (Union[Unset, str]): The user or service account who created the resource
|
|
19
|
-
updated_by (Union[Unset, str]): The user or service account who updated the resource
|
|
20
|
-
continent (Union[Unset, str]): The private cluster's continent, used to determine the closest private cluster to
|
|
21
|
-
serve inference requests based on the user's location
|
|
22
|
-
country (Union[Unset, str]): The country where the private cluster is located, used to determine the closest
|
|
23
|
-
private cluster to serve inference requests based on the user's location
|
|
24
|
-
display_name (Union[Unset, str]): The private cluster's display Name
|
|
25
|
-
healthy (Union[Unset, bool]): Whether the private cluster is healthy or not, used to determine if the private
|
|
26
|
-
cluster is ready to run inference
|
|
27
|
-
last_health_check_time (Union[Unset, str]): The private cluster's unique name
|
|
28
|
-
latitude (Union[Unset, str]): The private cluster's latitude, used to determine the closest private cluster to
|
|
29
|
-
serve inference requests based on the user's location
|
|
30
|
-
longitude (Union[Unset, str]): The private cluster's longitude, used to determine the closest private cluster to
|
|
31
|
-
serve inference requests based on the user's location
|
|
32
|
-
name (Union[Unset, str]): The name of the private cluster, it must be unique
|
|
33
|
-
owned_by (Union[Unset, str]): The service account (operator) that owns the cluster
|
|
34
|
-
workspace (Union[Unset, str]): The workspace the private cluster belongs to
|
|
35
|
-
"""
|
|
36
|
-
|
|
37
|
-
created_at: Union[Unset, str] = UNSET
|
|
38
|
-
updated_at: Union[Unset, str] = UNSET
|
|
39
|
-
created_by: Union[Unset, str] = UNSET
|
|
40
|
-
updated_by: Union[Unset, str] = UNSET
|
|
41
|
-
continent: Union[Unset, str] = UNSET
|
|
42
|
-
country: Union[Unset, str] = UNSET
|
|
43
|
-
display_name: Union[Unset, str] = UNSET
|
|
44
|
-
healthy: Union[Unset, bool] = UNSET
|
|
45
|
-
last_health_check_time: Union[Unset, str] = UNSET
|
|
46
|
-
latitude: Union[Unset, str] = UNSET
|
|
47
|
-
longitude: Union[Unset, str] = UNSET
|
|
48
|
-
name: Union[Unset, str] = UNSET
|
|
49
|
-
owned_by: Union[Unset, str] = UNSET
|
|
50
|
-
workspace: Union[Unset, str] = UNSET
|
|
51
|
-
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
52
|
-
|
|
53
|
-
def to_dict(self) -> dict[str, Any]:
|
|
54
|
-
created_at = self.created_at
|
|
55
|
-
|
|
56
|
-
updated_at = self.updated_at
|
|
57
|
-
|
|
58
|
-
created_by = self.created_by
|
|
59
|
-
|
|
60
|
-
updated_by = self.updated_by
|
|
61
|
-
|
|
62
|
-
continent = self.continent
|
|
63
|
-
|
|
64
|
-
country = self.country
|
|
65
|
-
|
|
66
|
-
display_name = self.display_name
|
|
67
|
-
|
|
68
|
-
healthy = self.healthy
|
|
69
|
-
|
|
70
|
-
last_health_check_time = self.last_health_check_time
|
|
71
|
-
|
|
72
|
-
latitude = self.latitude
|
|
73
|
-
|
|
74
|
-
longitude = self.longitude
|
|
75
|
-
|
|
76
|
-
name = self.name
|
|
77
|
-
|
|
78
|
-
owned_by = self.owned_by
|
|
79
|
-
|
|
80
|
-
workspace = self.workspace
|
|
81
|
-
|
|
82
|
-
field_dict: dict[str, Any] = {}
|
|
83
|
-
field_dict.update(self.additional_properties)
|
|
84
|
-
field_dict.update({})
|
|
85
|
-
if created_at is not UNSET:
|
|
86
|
-
field_dict["createdAt"] = created_at
|
|
87
|
-
if updated_at is not UNSET:
|
|
88
|
-
field_dict["updatedAt"] = updated_at
|
|
89
|
-
if created_by is not UNSET:
|
|
90
|
-
field_dict["createdBy"] = created_by
|
|
91
|
-
if updated_by is not UNSET:
|
|
92
|
-
field_dict["updatedBy"] = updated_by
|
|
93
|
-
if continent is not UNSET:
|
|
94
|
-
field_dict["continent"] = continent
|
|
95
|
-
if country is not UNSET:
|
|
96
|
-
field_dict["country"] = country
|
|
97
|
-
if display_name is not UNSET:
|
|
98
|
-
field_dict["displayName"] = display_name
|
|
99
|
-
if healthy is not UNSET:
|
|
100
|
-
field_dict["healthy"] = healthy
|
|
101
|
-
if last_health_check_time is not UNSET:
|
|
102
|
-
field_dict["lastHealthCheckTime"] = last_health_check_time
|
|
103
|
-
if latitude is not UNSET:
|
|
104
|
-
field_dict["latitude"] = latitude
|
|
105
|
-
if longitude is not UNSET:
|
|
106
|
-
field_dict["longitude"] = longitude
|
|
107
|
-
if name is not UNSET:
|
|
108
|
-
field_dict["name"] = name
|
|
109
|
-
if owned_by is not UNSET:
|
|
110
|
-
field_dict["ownedBy"] = owned_by
|
|
111
|
-
if workspace is not UNSET:
|
|
112
|
-
field_dict["workspace"] = workspace
|
|
113
|
-
|
|
114
|
-
return field_dict
|
|
115
|
-
|
|
116
|
-
@classmethod
|
|
117
|
-
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
|
118
|
-
if not src_dict:
|
|
119
|
-
return None
|
|
120
|
-
d = src_dict.copy()
|
|
121
|
-
created_at = d.pop("createdAt", UNSET)
|
|
122
|
-
|
|
123
|
-
updated_at = d.pop("updatedAt", UNSET)
|
|
124
|
-
|
|
125
|
-
created_by = d.pop("createdBy", UNSET)
|
|
126
|
-
|
|
127
|
-
updated_by = d.pop("updatedBy", UNSET)
|
|
128
|
-
|
|
129
|
-
continent = d.pop("continent", UNSET)
|
|
130
|
-
|
|
131
|
-
country = d.pop("country", UNSET)
|
|
132
|
-
|
|
133
|
-
display_name = d.pop("displayName", UNSET)
|
|
134
|
-
|
|
135
|
-
healthy = d.pop("healthy", UNSET)
|
|
136
|
-
|
|
137
|
-
last_health_check_time = d.pop("lastHealthCheckTime", UNSET)
|
|
138
|
-
|
|
139
|
-
latitude = d.pop("latitude", UNSET)
|
|
140
|
-
|
|
141
|
-
longitude = d.pop("longitude", UNSET)
|
|
142
|
-
|
|
143
|
-
name = d.pop("name", UNSET)
|
|
144
|
-
|
|
145
|
-
owned_by = d.pop("ownedBy", UNSET)
|
|
146
|
-
|
|
147
|
-
workspace = d.pop("workspace", UNSET)
|
|
148
|
-
|
|
149
|
-
private_cluster = cls(
|
|
150
|
-
created_at=created_at,
|
|
151
|
-
updated_at=updated_at,
|
|
152
|
-
created_by=created_by,
|
|
153
|
-
updated_by=updated_by,
|
|
154
|
-
continent=continent,
|
|
155
|
-
country=country,
|
|
156
|
-
display_name=display_name,
|
|
157
|
-
healthy=healthy,
|
|
158
|
-
last_health_check_time=last_health_check_time,
|
|
159
|
-
latitude=latitude,
|
|
160
|
-
longitude=longitude,
|
|
161
|
-
name=name,
|
|
162
|
-
owned_by=owned_by,
|
|
163
|
-
workspace=workspace,
|
|
164
|
-
)
|
|
165
|
-
|
|
166
|
-
private_cluster.additional_properties = d
|
|
167
|
-
return private_cluster
|
|
168
|
-
|
|
169
|
-
@property
|
|
170
|
-
def additional_keys(self) -> list[str]:
|
|
171
|
-
return list(self.additional_properties.keys())
|
|
172
|
-
|
|
173
|
-
def __getitem__(self, key: str) -> Any:
|
|
174
|
-
return self.additional_properties[key]
|
|
175
|
-
|
|
176
|
-
def __setitem__(self, key: str, value: Any) -> None:
|
|
177
|
-
self.additional_properties[key] = value
|
|
178
|
-
|
|
179
|
-
def __delitem__(self, key: str) -> None:
|
|
180
|
-
del self.additional_properties[key]
|
|
181
|
-
|
|
182
|
-
def __contains__(self, key: str) -> bool:
|
|
183
|
-
return key in self.additional_properties
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
from http import HTTPStatus
|
|
2
|
-
from typing import Any, Union
|
|
3
|
-
|
|
4
|
-
import httpx
|
|
5
|
-
|
|
6
|
-
from ... import errors
|
|
7
|
-
from ...client import Client
|
|
8
|
-
from ...models.error_response import ErrorResponse
|
|
9
|
-
from ...models.success_response import SuccessResponse
|
|
10
|
-
from ...types import UNSET, Response, Unset
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def _get_kwargs(
|
|
14
|
-
path: str,
|
|
15
|
-
*,
|
|
16
|
-
recursive: Union[Unset, bool] = UNSET,
|
|
17
|
-
) -> dict[str, Any]:
|
|
18
|
-
params: dict[str, Any] = {}
|
|
19
|
-
|
|
20
|
-
params["recursive"] = recursive
|
|
21
|
-
|
|
22
|
-
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
23
|
-
|
|
24
|
-
_kwargs: dict[str, Any] = {
|
|
25
|
-
"method": "delete",
|
|
26
|
-
"url": f"/filesystem/tree/{path}",
|
|
27
|
-
"params": params,
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return _kwargs
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def _parse_response(*, client: Client, response: httpx.Response) -> Union[ErrorResponse, SuccessResponse] | None:
|
|
34
|
-
if response.status_code == 200:
|
|
35
|
-
response_200 = SuccessResponse.from_dict(response.json())
|
|
36
|
-
|
|
37
|
-
return response_200
|
|
38
|
-
if response.status_code == 400:
|
|
39
|
-
response_400 = ErrorResponse.from_dict(response.json())
|
|
40
|
-
|
|
41
|
-
return response_400
|
|
42
|
-
if response.status_code == 422:
|
|
43
|
-
response_422 = ErrorResponse.from_dict(response.json())
|
|
44
|
-
|
|
45
|
-
return response_422
|
|
46
|
-
if response.status_code == 500:
|
|
47
|
-
response_500 = ErrorResponse.from_dict(response.json())
|
|
48
|
-
|
|
49
|
-
return response_500
|
|
50
|
-
if client.raise_on_unexpected_status:
|
|
51
|
-
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
52
|
-
else:
|
|
53
|
-
return None
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[ErrorResponse, SuccessResponse]]:
|
|
57
|
-
return Response(
|
|
58
|
-
status_code=HTTPStatus(response.status_code),
|
|
59
|
-
content=response.content,
|
|
60
|
-
headers=response.headers,
|
|
61
|
-
parsed=_parse_response(client=client, response=response),
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
def sync_detailed(
|
|
66
|
-
path: str,
|
|
67
|
-
*,
|
|
68
|
-
client: Union[Client],
|
|
69
|
-
recursive: Union[Unset, bool] = UNSET,
|
|
70
|
-
) -> Response[Union[ErrorResponse, SuccessResponse]]:
|
|
71
|
-
"""Delete directory tree
|
|
72
|
-
|
|
73
|
-
Delete a directory tree recursively
|
|
74
|
-
|
|
75
|
-
Args:
|
|
76
|
-
path (str):
|
|
77
|
-
recursive (Union[Unset, bool]):
|
|
78
|
-
|
|
79
|
-
Raises:
|
|
80
|
-
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
81
|
-
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
82
|
-
|
|
83
|
-
Returns:
|
|
84
|
-
Response[Union[ErrorResponse, SuccessResponse]]
|
|
85
|
-
"""
|
|
86
|
-
|
|
87
|
-
kwargs = _get_kwargs(
|
|
88
|
-
path=path,
|
|
89
|
-
recursive=recursive,
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
response = client.get_httpx_client().request(
|
|
93
|
-
**kwargs,
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
return _build_response(client=client, response=response)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
def sync(
|
|
100
|
-
path: str,
|
|
101
|
-
*,
|
|
102
|
-
client: Union[Client],
|
|
103
|
-
recursive: Union[Unset, bool] = UNSET,
|
|
104
|
-
) -> Union[ErrorResponse, SuccessResponse] | None:
|
|
105
|
-
"""Delete directory tree
|
|
106
|
-
|
|
107
|
-
Delete a directory tree recursively
|
|
108
|
-
|
|
109
|
-
Args:
|
|
110
|
-
path (str):
|
|
111
|
-
recursive (Union[Unset, bool]):
|
|
112
|
-
|
|
113
|
-
Raises:
|
|
114
|
-
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
115
|
-
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
116
|
-
|
|
117
|
-
Returns:
|
|
118
|
-
Union[ErrorResponse, SuccessResponse]
|
|
119
|
-
"""
|
|
120
|
-
|
|
121
|
-
return sync_detailed(
|
|
122
|
-
path=path,
|
|
123
|
-
client=client,
|
|
124
|
-
recursive=recursive,
|
|
125
|
-
).parsed
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
async def asyncio_detailed(
|
|
129
|
-
path: str,
|
|
130
|
-
*,
|
|
131
|
-
client: Union[Client],
|
|
132
|
-
recursive: Union[Unset, bool] = UNSET,
|
|
133
|
-
) -> Response[Union[ErrorResponse, SuccessResponse]]:
|
|
134
|
-
"""Delete directory tree
|
|
135
|
-
|
|
136
|
-
Delete a directory tree recursively
|
|
137
|
-
|
|
138
|
-
Args:
|
|
139
|
-
path (str):
|
|
140
|
-
recursive (Union[Unset, bool]):
|
|
141
|
-
|
|
142
|
-
Raises:
|
|
143
|
-
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
144
|
-
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
145
|
-
|
|
146
|
-
Returns:
|
|
147
|
-
Response[Union[ErrorResponse, SuccessResponse]]
|
|
148
|
-
"""
|
|
149
|
-
|
|
150
|
-
kwargs = _get_kwargs(
|
|
151
|
-
path=path,
|
|
152
|
-
recursive=recursive,
|
|
153
|
-
)
|
|
154
|
-
|
|
155
|
-
response = await client.get_async_httpx_client().request(**kwargs)
|
|
156
|
-
|
|
157
|
-
return _build_response(client=client, response=response)
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
async def asyncio(
|
|
161
|
-
path: str,
|
|
162
|
-
*,
|
|
163
|
-
client: Union[Client],
|
|
164
|
-
recursive: Union[Unset, bool] = UNSET,
|
|
165
|
-
) -> Union[ErrorResponse, SuccessResponse] | None:
|
|
166
|
-
"""Delete directory tree
|
|
167
|
-
|
|
168
|
-
Delete a directory tree recursively
|
|
169
|
-
|
|
170
|
-
Args:
|
|
171
|
-
path (str):
|
|
172
|
-
recursive (Union[Unset, bool]):
|
|
173
|
-
|
|
174
|
-
Raises:
|
|
175
|
-
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
176
|
-
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
177
|
-
|
|
178
|
-
Returns:
|
|
179
|
-
Union[ErrorResponse, SuccessResponse]
|
|
180
|
-
"""
|
|
181
|
-
|
|
182
|
-
return (
|
|
183
|
-
await asyncio_detailed(
|
|
184
|
-
path=path,
|
|
185
|
-
client=client,
|
|
186
|
-
recursive=recursive,
|
|
187
|
-
)
|
|
188
|
-
).parsed
|
|
@@ -1,265 +0,0 @@
|
|
|
1
|
-
from http import HTTPStatus
|
|
2
|
-
from typing import Any, Union
|
|
3
|
-
|
|
4
|
-
import httpx
|
|
5
|
-
|
|
6
|
-
from ... import errors
|
|
7
|
-
from ...client import Client
|
|
8
|
-
from ...models.content_search_response import ContentSearchResponse
|
|
9
|
-
from ...models.error_response import ErrorResponse
|
|
10
|
-
from ...types import UNSET, Response, Unset
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def _get_kwargs(
|
|
14
|
-
path: str,
|
|
15
|
-
*,
|
|
16
|
-
query: str,
|
|
17
|
-
case_sensitive: Union[Unset, bool] = UNSET,
|
|
18
|
-
context_lines: Union[Unset, int] = UNSET,
|
|
19
|
-
max_results: Union[Unset, int] = UNSET,
|
|
20
|
-
file_pattern: Union[Unset, str] = UNSET,
|
|
21
|
-
exclude_dirs: Union[Unset, str] = UNSET,
|
|
22
|
-
) -> dict[str, Any]:
|
|
23
|
-
params: dict[str, Any] = {}
|
|
24
|
-
|
|
25
|
-
params["query"] = query
|
|
26
|
-
|
|
27
|
-
params["caseSensitive"] = case_sensitive
|
|
28
|
-
|
|
29
|
-
params["contextLines"] = context_lines
|
|
30
|
-
|
|
31
|
-
params["maxResults"] = max_results
|
|
32
|
-
|
|
33
|
-
params["filePattern"] = file_pattern
|
|
34
|
-
|
|
35
|
-
params["excludeDirs"] = exclude_dirs
|
|
36
|
-
|
|
37
|
-
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
38
|
-
|
|
39
|
-
_kwargs: dict[str, Any] = {
|
|
40
|
-
"method": "get",
|
|
41
|
-
"url": f"/filesystem-content-search/{path}",
|
|
42
|
-
"params": params,
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return _kwargs
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def _parse_response(*, client: Client, response: httpx.Response) -> Union[ContentSearchResponse, ErrorResponse] | None:
|
|
49
|
-
if response.status_code == 200:
|
|
50
|
-
response_200 = ContentSearchResponse.from_dict(response.json())
|
|
51
|
-
|
|
52
|
-
return response_200
|
|
53
|
-
if response.status_code == 400:
|
|
54
|
-
response_400 = ErrorResponse.from_dict(response.json())
|
|
55
|
-
|
|
56
|
-
return response_400
|
|
57
|
-
if response.status_code == 422:
|
|
58
|
-
response_422 = ErrorResponse.from_dict(response.json())
|
|
59
|
-
|
|
60
|
-
return response_422
|
|
61
|
-
if response.status_code == 500:
|
|
62
|
-
response_500 = ErrorResponse.from_dict(response.json())
|
|
63
|
-
|
|
64
|
-
return response_500
|
|
65
|
-
if client.raise_on_unexpected_status:
|
|
66
|
-
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
67
|
-
else:
|
|
68
|
-
return None
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
def _build_response(
|
|
72
|
-
*, client: Client, response: httpx.Response
|
|
73
|
-
) -> Response[Union[ContentSearchResponse, ErrorResponse]]:
|
|
74
|
-
return Response(
|
|
75
|
-
status_code=HTTPStatus(response.status_code),
|
|
76
|
-
content=response.content,
|
|
77
|
-
headers=response.headers,
|
|
78
|
-
parsed=_parse_response(client=client, response=response),
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
def sync_detailed(
|
|
83
|
-
path: str,
|
|
84
|
-
*,
|
|
85
|
-
client: Union[Client],
|
|
86
|
-
query: str,
|
|
87
|
-
case_sensitive: Union[Unset, bool] = UNSET,
|
|
88
|
-
context_lines: Union[Unset, int] = UNSET,
|
|
89
|
-
max_results: Union[Unset, int] = UNSET,
|
|
90
|
-
file_pattern: Union[Unset, str] = UNSET,
|
|
91
|
-
exclude_dirs: Union[Unset, str] = UNSET,
|
|
92
|
-
) -> Response[Union[ContentSearchResponse, ErrorResponse]]:
|
|
93
|
-
"""Search for text content in files
|
|
94
|
-
|
|
95
|
-
Searches for text content inside files using ripgrep. Returns matching lines with context.
|
|
96
|
-
|
|
97
|
-
Args:
|
|
98
|
-
path (str):
|
|
99
|
-
query (str):
|
|
100
|
-
case_sensitive (Union[Unset, bool]):
|
|
101
|
-
context_lines (Union[Unset, int]):
|
|
102
|
-
max_results (Union[Unset, int]):
|
|
103
|
-
file_pattern (Union[Unset, str]):
|
|
104
|
-
exclude_dirs (Union[Unset, str]):
|
|
105
|
-
|
|
106
|
-
Raises:
|
|
107
|
-
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
108
|
-
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
109
|
-
|
|
110
|
-
Returns:
|
|
111
|
-
Response[Union[ContentSearchResponse, ErrorResponse]]
|
|
112
|
-
"""
|
|
113
|
-
|
|
114
|
-
kwargs = _get_kwargs(
|
|
115
|
-
path=path,
|
|
116
|
-
query=query,
|
|
117
|
-
case_sensitive=case_sensitive,
|
|
118
|
-
context_lines=context_lines,
|
|
119
|
-
max_results=max_results,
|
|
120
|
-
file_pattern=file_pattern,
|
|
121
|
-
exclude_dirs=exclude_dirs,
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
response = client.get_httpx_client().request(
|
|
125
|
-
**kwargs,
|
|
126
|
-
)
|
|
127
|
-
|
|
128
|
-
return _build_response(client=client, response=response)
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
def sync(
|
|
132
|
-
path: str,
|
|
133
|
-
*,
|
|
134
|
-
client: Union[Client],
|
|
135
|
-
query: str,
|
|
136
|
-
case_sensitive: Union[Unset, bool] = UNSET,
|
|
137
|
-
context_lines: Union[Unset, int] = UNSET,
|
|
138
|
-
max_results: Union[Unset, int] = UNSET,
|
|
139
|
-
file_pattern: Union[Unset, str] = UNSET,
|
|
140
|
-
exclude_dirs: Union[Unset, str] = UNSET,
|
|
141
|
-
) -> Union[ContentSearchResponse, ErrorResponse] | None:
|
|
142
|
-
"""Search for text content in files
|
|
143
|
-
|
|
144
|
-
Searches for text content inside files using ripgrep. Returns matching lines with context.
|
|
145
|
-
|
|
146
|
-
Args:
|
|
147
|
-
path (str):
|
|
148
|
-
query (str):
|
|
149
|
-
case_sensitive (Union[Unset, bool]):
|
|
150
|
-
context_lines (Union[Unset, int]):
|
|
151
|
-
max_results (Union[Unset, int]):
|
|
152
|
-
file_pattern (Union[Unset, str]):
|
|
153
|
-
exclude_dirs (Union[Unset, str]):
|
|
154
|
-
|
|
155
|
-
Raises:
|
|
156
|
-
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
157
|
-
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
158
|
-
|
|
159
|
-
Returns:
|
|
160
|
-
Union[ContentSearchResponse, ErrorResponse]
|
|
161
|
-
"""
|
|
162
|
-
|
|
163
|
-
return sync_detailed(
|
|
164
|
-
path=path,
|
|
165
|
-
client=client,
|
|
166
|
-
query=query,
|
|
167
|
-
case_sensitive=case_sensitive,
|
|
168
|
-
context_lines=context_lines,
|
|
169
|
-
max_results=max_results,
|
|
170
|
-
file_pattern=file_pattern,
|
|
171
|
-
exclude_dirs=exclude_dirs,
|
|
172
|
-
).parsed
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
async def asyncio_detailed(
|
|
176
|
-
path: str,
|
|
177
|
-
*,
|
|
178
|
-
client: Union[Client],
|
|
179
|
-
query: str,
|
|
180
|
-
case_sensitive: Union[Unset, bool] = UNSET,
|
|
181
|
-
context_lines: Union[Unset, int] = UNSET,
|
|
182
|
-
max_results: Union[Unset, int] = UNSET,
|
|
183
|
-
file_pattern: Union[Unset, str] = UNSET,
|
|
184
|
-
exclude_dirs: Union[Unset, str] = UNSET,
|
|
185
|
-
) -> Response[Union[ContentSearchResponse, ErrorResponse]]:
|
|
186
|
-
"""Search for text content in files
|
|
187
|
-
|
|
188
|
-
Searches for text content inside files using ripgrep. Returns matching lines with context.
|
|
189
|
-
|
|
190
|
-
Args:
|
|
191
|
-
path (str):
|
|
192
|
-
query (str):
|
|
193
|
-
case_sensitive (Union[Unset, bool]):
|
|
194
|
-
context_lines (Union[Unset, int]):
|
|
195
|
-
max_results (Union[Unset, int]):
|
|
196
|
-
file_pattern (Union[Unset, str]):
|
|
197
|
-
exclude_dirs (Union[Unset, str]):
|
|
198
|
-
|
|
199
|
-
Raises:
|
|
200
|
-
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
201
|
-
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
202
|
-
|
|
203
|
-
Returns:
|
|
204
|
-
Response[Union[ContentSearchResponse, ErrorResponse]]
|
|
205
|
-
"""
|
|
206
|
-
|
|
207
|
-
kwargs = _get_kwargs(
|
|
208
|
-
path=path,
|
|
209
|
-
query=query,
|
|
210
|
-
case_sensitive=case_sensitive,
|
|
211
|
-
context_lines=context_lines,
|
|
212
|
-
max_results=max_results,
|
|
213
|
-
file_pattern=file_pattern,
|
|
214
|
-
exclude_dirs=exclude_dirs,
|
|
215
|
-
)
|
|
216
|
-
|
|
217
|
-
response = await client.get_async_httpx_client().request(**kwargs)
|
|
218
|
-
|
|
219
|
-
return _build_response(client=client, response=response)
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
async def asyncio(
|
|
223
|
-
path: str,
|
|
224
|
-
*,
|
|
225
|
-
client: Union[Client],
|
|
226
|
-
query: str,
|
|
227
|
-
case_sensitive: Union[Unset, bool] = UNSET,
|
|
228
|
-
context_lines: Union[Unset, int] = UNSET,
|
|
229
|
-
max_results: Union[Unset, int] = UNSET,
|
|
230
|
-
file_pattern: Union[Unset, str] = UNSET,
|
|
231
|
-
exclude_dirs: Union[Unset, str] = UNSET,
|
|
232
|
-
) -> Union[ContentSearchResponse, ErrorResponse] | None:
|
|
233
|
-
"""Search for text content in files
|
|
234
|
-
|
|
235
|
-
Searches for text content inside files using ripgrep. Returns matching lines with context.
|
|
236
|
-
|
|
237
|
-
Args:
|
|
238
|
-
path (str):
|
|
239
|
-
query (str):
|
|
240
|
-
case_sensitive (Union[Unset, bool]):
|
|
241
|
-
context_lines (Union[Unset, int]):
|
|
242
|
-
max_results (Union[Unset, int]):
|
|
243
|
-
file_pattern (Union[Unset, str]):
|
|
244
|
-
exclude_dirs (Union[Unset, str]):
|
|
245
|
-
|
|
246
|
-
Raises:
|
|
247
|
-
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
248
|
-
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
249
|
-
|
|
250
|
-
Returns:
|
|
251
|
-
Union[ContentSearchResponse, ErrorResponse]
|
|
252
|
-
"""
|
|
253
|
-
|
|
254
|
-
return (
|
|
255
|
-
await asyncio_detailed(
|
|
256
|
-
path=path,
|
|
257
|
-
client=client,
|
|
258
|
-
query=query,
|
|
259
|
-
case_sensitive=case_sensitive,
|
|
260
|
-
context_lines=context_lines,
|
|
261
|
-
max_results=max_results,
|
|
262
|
-
file_pattern=file_pattern,
|
|
263
|
-
exclude_dirs=exclude_dirs,
|
|
264
|
-
)
|
|
265
|
-
).parsed
|