label-studio-sdk 2.0.1__py3-none-any.whl → 2.0.3__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.
Potentially problematic release.
This version of label-studio-sdk might be problematic. Click here for more details.
- label_studio_sdk/__init__.py +20 -0
- label_studio_sdk/actions/client.py +13 -13
- label_studio_sdk/actions/types/actions_list_response_item.py +3 -3
- label_studio_sdk/actions/types/actions_list_response_item_dialog.py +2 -2
- label_studio_sdk/annotations/client.py +441 -441
- label_studio_sdk/base_client.py +4 -0
- label_studio_sdk/comments/client.py +176 -176
- label_studio_sdk/export_storage/azure/client.py +274 -274
- label_studio_sdk/export_storage/gcs/client.py +263 -263
- label_studio_sdk/export_storage/local/client.py +206 -206
- label_studio_sdk/export_storage/redis/client.py +287 -287
- label_studio_sdk/export_storage/s3/client.py +347 -347
- label_studio_sdk/export_storage/s3s/client.py +678 -678
- label_studio_sdk/import_storage/azure/client.py +357 -357
- label_studio_sdk/import_storage/gcs/client.py +357 -357
- label_studio_sdk/import_storage/local/client.py +206 -206
- label_studio_sdk/import_storage/redis/client.py +309 -309
- label_studio_sdk/import_storage/s3/client.py +452 -452
- label_studio_sdk/import_storage/s3s/client.py +735 -735
- label_studio_sdk/jwt_settings/client.py +10 -10
- label_studio_sdk/ml/client.py +118 -118
- label_studio_sdk/ml/types/ml_list_model_versions_response.py +1 -1
- label_studio_sdk/model_providers/client.py +181 -181
- label_studio_sdk/organizations/members/client.py +8 -8
- label_studio_sdk/predictions/client.py +60 -60
- label_studio_sdk/projects/__init__.py +33 -1
- label_studio_sdk/projects/assignments/__init__.py +35 -0
- label_studio_sdk/projects/assignments/client.py +801 -0
- label_studio_sdk/projects/assignments/types/__init__.py +37 -0
- label_studio_sdk/projects/assignments/types/assignments_assign_request_type.py +5 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters.py +33 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_conjunction.py +5 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item.py +44 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_filter.py +31 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_operator.py +23 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_value.py +7 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items.py +9 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items_excluded.py +29 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items_included.py +29 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_type.py +5 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_response.py +22 -0
- label_studio_sdk/projects/assignments/types/assignments_delete_request_type.py +5 -0
- label_studio_sdk/projects/assignments/types/assignments_update_request_type.py +5 -0
- label_studio_sdk/projects/client.py +445 -425
- label_studio_sdk/projects/exports/client.py +55 -55
- label_studio_sdk/projects/exports/types/exports_convert_response.py +1 -1
- label_studio_sdk/projects/members/__init__.py +2 -0
- label_studio_sdk/projects/members/client.py +137 -0
- label_studio_sdk/projects/stats/types/stats_iaa_response.py +5 -5
- label_studio_sdk/projects/types/projects_import_tasks_response.py +12 -12
- label_studio_sdk/prompts/client.py +211 -211
- label_studio_sdk/prompts/runs/client.py +33 -33
- label_studio_sdk/prompts/versions/client.py +72 -72
- label_studio_sdk/sso/__init__.py +5 -0
- label_studio_sdk/sso/client.py +22 -0
- label_studio_sdk/sso/saml/__init__.py +2 -0
- label_studio_sdk/sso/saml/client.py +278 -0
- label_studio_sdk/sso/scim/__init__.py +2 -0
- label_studio_sdk/sso/scim/client.py +278 -0
- label_studio_sdk/tasks/client.py +174 -174
- label_studio_sdk/types/__init__.py +18 -0
- label_studio_sdk/types/all_roles_project_list.py +94 -94
- label_studio_sdk/types/annotation.py +35 -35
- label_studio_sdk/types/annotation_request.py +27 -27
- label_studio_sdk/types/azure_blob_export_storage.py +29 -29
- label_studio_sdk/types/azure_blob_import_storage.py +33 -33
- label_studio_sdk/types/batch_failed_predictions.py +1 -1
- label_studio_sdk/types/billing_checks.py +14 -14
- label_studio_sdk/types/billing_flags.py +16 -16
- label_studio_sdk/types/blueprint_list.py +7 -8
- label_studio_sdk/types/child_filter.py +11 -10
- label_studio_sdk/types/comment.py +15 -15
- label_studio_sdk/types/comment_request.py +7 -8
- label_studio_sdk/types/comment_serializer_with_expanded_user.py +17 -18
- label_studio_sdk/types/converted_format.py +1 -1
- label_studio_sdk/types/converted_format_request.py +1 -1
- label_studio_sdk/types/export.py +8 -8
- label_studio_sdk/types/file_upload.py +3 -2
- label_studio_sdk/types/filter.py +10 -9
- label_studio_sdk/types/filter_group.py +4 -3
- label_studio_sdk/types/gcs_export_storage.py +23 -23
- label_studio_sdk/types/gcs_import_storage.py +27 -27
- label_studio_sdk/types/import_api_request.py +26 -26
- label_studio_sdk/types/inference_run_cost_estimate.py +10 -10
- label_studio_sdk/types/local_files_export_storage.py +23 -23
- label_studio_sdk/types/local_files_import_storage.py +26 -26
- label_studio_sdk/types/lse_annotation_filter_options.py +10 -10
- label_studio_sdk/types/lse_annotation_filter_options_request.py +10 -10
- label_studio_sdk/types/lse_export_create.py +12 -12
- label_studio_sdk/types/lse_fields.py +14 -14
- label_studio_sdk/types/lse_organization.py +17 -17
- label_studio_sdk/types/lse_organization_member_list.py +1 -1
- label_studio_sdk/types/lse_project_create.py +72 -72
- label_studio_sdk/types/lse_project_update.py +89 -89
- label_studio_sdk/types/lse_s3export_storage.py +46 -46
- label_studio_sdk/types/lse_s3export_storage_request.py +43 -43
- label_studio_sdk/types/lse_s3import_storage.py +53 -53
- label_studio_sdk/types/lse_s3import_storage_request.py +49 -49
- label_studio_sdk/types/lse_task.py +49 -49
- label_studio_sdk/types/lse_task_drafts_item.py +1 -1
- label_studio_sdk/types/lse_task_filter_options.py +14 -14
- label_studio_sdk/types/lse_task_filter_options_request.py +14 -14
- label_studio_sdk/types/lse_task_predictions_item.py +5 -5
- label_studio_sdk/types/lse_task_serializer_for_annotators.py +12 -12
- label_studio_sdk/types/lse_task_serializer_for_annotators_drafts_item.py +1 -1
- label_studio_sdk/types/lse_task_serializer_for_annotators_predictions_item.py +5 -5
- label_studio_sdk/types/lse_task_serializer_for_reviewers.py +49 -49
- label_studio_sdk/types/lse_task_serializer_for_reviewers_drafts_item.py +1 -1
- label_studio_sdk/types/lse_task_serializer_for_reviewers_predictions_item.py +5 -5
- label_studio_sdk/types/lse_user.py +13 -13
- label_studio_sdk/types/lse_user_api.py +11 -11
- label_studio_sdk/types/lse_user_organization_member_list.py +13 -13
- label_studio_sdk/types/lseapi_token_create.py +1 -1
- label_studio_sdk/types/lseapi_token_list.py +1 -1
- label_studio_sdk/types/lsejwt_settings.py +5 -5
- label_studio_sdk/types/ml_backend.py +27 -28
- label_studio_sdk/types/model_interface.py +12 -12
- label_studio_sdk/types/model_interface_request.py +7 -8
- label_studio_sdk/types/model_interface_serializer_get.py +13 -13
- label_studio_sdk/types/model_provider_connection.py +34 -34
- label_studio_sdk/types/model_provider_connection_request.py +15 -14
- label_studio_sdk/types/model_run.py +12 -12
- label_studio_sdk/types/organization_billing.py +1 -1
- label_studio_sdk/types/organization_id.py +2 -2
- label_studio_sdk/types/organization_invite.py +1 -1
- label_studio_sdk/types/organization_member.py +8 -9
- label_studio_sdk/types/organization_membership.py +2 -1
- label_studio_sdk/types/pause.py +23 -23
- label_studio_sdk/types/prediction.py +21 -21
- label_studio_sdk/types/prediction_request.py +16 -16
- label_studio_sdk/types/project.py +72 -72
- label_studio_sdk/types/project_group.py +22 -0
- label_studio_sdk/types/project_group_request.py +22 -0
- label_studio_sdk/types/project_group_role_enum.py +5 -0
- label_studio_sdk/types/project_import.py +21 -21
- label_studio_sdk/types/redis_export_storage.py +34 -34
- label_studio_sdk/types/redis_import_storage.py +37 -37
- label_studio_sdk/types/refined_prompt_response.py +11 -11
- label_studio_sdk/types/review_settings.py +29 -30
- label_studio_sdk/types/review_settings_request.py +29 -30
- label_studio_sdk/types/s3export_storage.py +45 -45
- label_studio_sdk/types/s3import_storage.py +44 -44
- label_studio_sdk/types/saml_settings.py +21 -0
- label_studio_sdk/types/saml_settings_update.py +22 -0
- label_studio_sdk/types/scim_settings.py +21 -0
- label_studio_sdk/types/scim_settings_update.py +22 -0
- label_studio_sdk/types/selected_items_request.py +1 -1
- label_studio_sdk/types/serialization_options.py +10 -10
- label_studio_sdk/types/serialization_options_request.py +10 -10
- label_studio_sdk/types/task_assignment.py +43 -0
- label_studio_sdk/types/third_party_model_version.py +11 -11
- label_studio_sdk/types/third_party_model_version_request.py +6 -7
- label_studio_sdk/types/type_enum.py +5 -0
- label_studio_sdk/types/user_simple.py +3 -3
- label_studio_sdk/types/user_simple_request.py +1 -1
- label_studio_sdk/types/version_response.py +19 -20
- label_studio_sdk/types/view.py +8 -8
- label_studio_sdk/types/webhook.py +16 -16
- label_studio_sdk/types/webhook_serializer_for_update.py +16 -16
- label_studio_sdk/types/workspace.py +10 -11
- label_studio_sdk/users/client.py +160 -160
- label_studio_sdk/views/client.py +164 -164
- label_studio_sdk/webhooks/client.py +183 -183
- label_studio_sdk/webhooks/types/webhooks_info_response.py +32 -32
- label_studio_sdk/webhooks/types/webhooks_info_response_annotation_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_annotation_updated.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_annotations_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_annotations_deleted.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_deleted.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_updated.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_project_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_project_deleted.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_project_updated.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_review_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_review_updated.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_reviews_deleted.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_tasks_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_tasks_deleted.py +1 -1
- label_studio_sdk/workspaces/client.py +40 -40
- {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.3.dist-info}/METADATA +1 -1
- {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.3.dist-info}/RECORD +184 -150
- {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.3.dist-info}/LICENSE +0 -0
- {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.3.dist-info}/WHEEL +0 -0
|
@@ -79,15 +79,15 @@ class RedisClient:
|
|
|
79
79
|
def create(
|
|
80
80
|
self,
|
|
81
81
|
*,
|
|
82
|
-
regex_filter: typing.Optional[str] = OMIT,
|
|
83
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
84
|
-
title: typing.Optional[str] = OMIT,
|
|
85
82
|
description: typing.Optional[str] = OMIT,
|
|
86
|
-
project: typing.Optional[int] = OMIT,
|
|
87
|
-
path: typing.Optional[str] = OMIT,
|
|
88
83
|
host: typing.Optional[str] = OMIT,
|
|
89
|
-
port: typing.Optional[str] = OMIT,
|
|
90
84
|
password: typing.Optional[str] = OMIT,
|
|
85
|
+
path: typing.Optional[str] = OMIT,
|
|
86
|
+
port: typing.Optional[str] = OMIT,
|
|
87
|
+
project: typing.Optional[int] = OMIT,
|
|
88
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
89
|
+
title: typing.Optional[str] = OMIT,
|
|
90
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
91
91
|
request_options: typing.Optional[RequestOptions] = None,
|
|
92
92
|
) -> RedisImportStorage:
|
|
93
93
|
"""
|
|
@@ -95,32 +95,32 @@ class RedisClient:
|
|
|
95
95
|
|
|
96
96
|
Parameters
|
|
97
97
|
----------
|
|
98
|
-
regex_filter : typing.Optional[str]
|
|
99
|
-
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
100
|
-
|
|
101
|
-
use_blob_urls : typing.Optional[bool]
|
|
102
|
-
Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
103
|
-
|
|
104
|
-
title : typing.Optional[str]
|
|
105
|
-
Storage title
|
|
106
|
-
|
|
107
98
|
description : typing.Optional[str]
|
|
108
99
|
Storage description
|
|
109
100
|
|
|
110
|
-
|
|
111
|
-
|
|
101
|
+
host : typing.Optional[str]
|
|
102
|
+
Server Host IP (optional)
|
|
103
|
+
|
|
104
|
+
password : typing.Optional[str]
|
|
105
|
+
Server Password (optional)
|
|
112
106
|
|
|
113
107
|
path : typing.Optional[str]
|
|
114
108
|
Storage prefix (optional)
|
|
115
109
|
|
|
116
|
-
host : typing.Optional[str]
|
|
117
|
-
Server Host IP (optional)
|
|
118
|
-
|
|
119
110
|
port : typing.Optional[str]
|
|
120
111
|
Server Port (optional)
|
|
121
112
|
|
|
122
|
-
|
|
123
|
-
|
|
113
|
+
project : typing.Optional[int]
|
|
114
|
+
Project ID
|
|
115
|
+
|
|
116
|
+
regex_filter : typing.Optional[str]
|
|
117
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
118
|
+
|
|
119
|
+
title : typing.Optional[str]
|
|
120
|
+
Storage title
|
|
121
|
+
|
|
122
|
+
use_blob_urls : typing.Optional[bool]
|
|
123
|
+
Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
124
124
|
|
|
125
125
|
request_options : typing.Optional[RequestOptions]
|
|
126
126
|
Request-specific configuration.
|
|
@@ -143,15 +143,15 @@ class RedisClient:
|
|
|
143
143
|
"api/storages/redis/",
|
|
144
144
|
method="POST",
|
|
145
145
|
json={
|
|
146
|
-
"regex_filter": regex_filter,
|
|
147
|
-
"use_blob_urls": use_blob_urls,
|
|
148
|
-
"title": title,
|
|
149
146
|
"description": description,
|
|
150
|
-
"project": project,
|
|
151
|
-
"path": path,
|
|
152
147
|
"host": host,
|
|
153
|
-
"port": port,
|
|
154
148
|
"password": password,
|
|
149
|
+
"path": path,
|
|
150
|
+
"port": port,
|
|
151
|
+
"project": project,
|
|
152
|
+
"regex_filter": regex_filter,
|
|
153
|
+
"title": title,
|
|
154
|
+
"use_blob_urls": use_blob_urls,
|
|
155
155
|
},
|
|
156
156
|
headers={
|
|
157
157
|
"content-type": "application/json",
|
|
@@ -173,6 +173,101 @@ class RedisClient:
|
|
|
173
173
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
174
174
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
175
175
|
|
|
176
|
+
def validate(
|
|
177
|
+
self,
|
|
178
|
+
*,
|
|
179
|
+
description: typing.Optional[str] = OMIT,
|
|
180
|
+
host: typing.Optional[str] = OMIT,
|
|
181
|
+
id: typing.Optional[int] = OMIT,
|
|
182
|
+
password: typing.Optional[str] = OMIT,
|
|
183
|
+
path: typing.Optional[str] = OMIT,
|
|
184
|
+
port: typing.Optional[str] = OMIT,
|
|
185
|
+
project: typing.Optional[int] = OMIT,
|
|
186
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
187
|
+
title: typing.Optional[str] = OMIT,
|
|
188
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
189
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
190
|
+
) -> None:
|
|
191
|
+
"""
|
|
192
|
+
Validate a specific Redis import storage connection.
|
|
193
|
+
|
|
194
|
+
Parameters
|
|
195
|
+
----------
|
|
196
|
+
description : typing.Optional[str]
|
|
197
|
+
Storage description
|
|
198
|
+
|
|
199
|
+
host : typing.Optional[str]
|
|
200
|
+
Server Host IP (optional)
|
|
201
|
+
|
|
202
|
+
id : typing.Optional[int]
|
|
203
|
+
Storage ID. If set, storage with specified ID will be updated
|
|
204
|
+
|
|
205
|
+
password : typing.Optional[str]
|
|
206
|
+
Server Password (optional)
|
|
207
|
+
|
|
208
|
+
path : typing.Optional[str]
|
|
209
|
+
Storage prefix (optional)
|
|
210
|
+
|
|
211
|
+
port : typing.Optional[str]
|
|
212
|
+
Server Port (optional)
|
|
213
|
+
|
|
214
|
+
project : typing.Optional[int]
|
|
215
|
+
Project ID
|
|
216
|
+
|
|
217
|
+
regex_filter : typing.Optional[str]
|
|
218
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
219
|
+
|
|
220
|
+
title : typing.Optional[str]
|
|
221
|
+
Storage title
|
|
222
|
+
|
|
223
|
+
use_blob_urls : typing.Optional[bool]
|
|
224
|
+
Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
225
|
+
|
|
226
|
+
request_options : typing.Optional[RequestOptions]
|
|
227
|
+
Request-specific configuration.
|
|
228
|
+
|
|
229
|
+
Returns
|
|
230
|
+
-------
|
|
231
|
+
None
|
|
232
|
+
|
|
233
|
+
Examples
|
|
234
|
+
--------
|
|
235
|
+
from label_studio_sdk import LabelStudio
|
|
236
|
+
|
|
237
|
+
client = LabelStudio(
|
|
238
|
+
api_key="YOUR_API_KEY",
|
|
239
|
+
)
|
|
240
|
+
client.import_storage.redis.validate()
|
|
241
|
+
"""
|
|
242
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
243
|
+
"api/storages/redis/validate",
|
|
244
|
+
method="POST",
|
|
245
|
+
json={
|
|
246
|
+
"description": description,
|
|
247
|
+
"host": host,
|
|
248
|
+
"id": id,
|
|
249
|
+
"password": password,
|
|
250
|
+
"path": path,
|
|
251
|
+
"port": port,
|
|
252
|
+
"project": project,
|
|
253
|
+
"regex_filter": regex_filter,
|
|
254
|
+
"title": title,
|
|
255
|
+
"use_blob_urls": use_blob_urls,
|
|
256
|
+
},
|
|
257
|
+
headers={
|
|
258
|
+
"content-type": "application/json",
|
|
259
|
+
},
|
|
260
|
+
request_options=request_options,
|
|
261
|
+
omit=OMIT,
|
|
262
|
+
)
|
|
263
|
+
try:
|
|
264
|
+
if 200 <= _response.status_code < 300:
|
|
265
|
+
return
|
|
266
|
+
_response_json = _response.json()
|
|
267
|
+
except JSONDecodeError:
|
|
268
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
269
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
270
|
+
|
|
176
271
|
def get(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> RedisImportStorage:
|
|
177
272
|
"""
|
|
178
273
|
Get a specific Redis import storage connection.
|
|
@@ -262,15 +357,15 @@ class RedisClient:
|
|
|
262
357
|
self,
|
|
263
358
|
id: int,
|
|
264
359
|
*,
|
|
265
|
-
regex_filter: typing.Optional[str] = OMIT,
|
|
266
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
267
|
-
title: typing.Optional[str] = OMIT,
|
|
268
360
|
description: typing.Optional[str] = OMIT,
|
|
269
|
-
project: typing.Optional[int] = OMIT,
|
|
270
|
-
path: typing.Optional[str] = OMIT,
|
|
271
361
|
host: typing.Optional[str] = OMIT,
|
|
272
|
-
port: typing.Optional[str] = OMIT,
|
|
273
362
|
password: typing.Optional[str] = OMIT,
|
|
363
|
+
path: typing.Optional[str] = OMIT,
|
|
364
|
+
port: typing.Optional[str] = OMIT,
|
|
365
|
+
project: typing.Optional[int] = OMIT,
|
|
366
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
367
|
+
title: typing.Optional[str] = OMIT,
|
|
368
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
274
369
|
request_options: typing.Optional[RequestOptions] = None,
|
|
275
370
|
) -> RedisImportStorage:
|
|
276
371
|
"""
|
|
@@ -280,32 +375,32 @@ class RedisClient:
|
|
|
280
375
|
----------
|
|
281
376
|
id : int
|
|
282
377
|
|
|
283
|
-
regex_filter : typing.Optional[str]
|
|
284
|
-
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
285
|
-
|
|
286
|
-
use_blob_urls : typing.Optional[bool]
|
|
287
|
-
Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
288
|
-
|
|
289
|
-
title : typing.Optional[str]
|
|
290
|
-
Storage title
|
|
291
|
-
|
|
292
378
|
description : typing.Optional[str]
|
|
293
379
|
Storage description
|
|
294
380
|
|
|
295
|
-
|
|
296
|
-
|
|
381
|
+
host : typing.Optional[str]
|
|
382
|
+
Server Host IP (optional)
|
|
383
|
+
|
|
384
|
+
password : typing.Optional[str]
|
|
385
|
+
Server Password (optional)
|
|
297
386
|
|
|
298
387
|
path : typing.Optional[str]
|
|
299
388
|
Storage prefix (optional)
|
|
300
389
|
|
|
301
|
-
host : typing.Optional[str]
|
|
302
|
-
Server Host IP (optional)
|
|
303
|
-
|
|
304
390
|
port : typing.Optional[str]
|
|
305
391
|
Server Port (optional)
|
|
306
392
|
|
|
307
|
-
|
|
308
|
-
|
|
393
|
+
project : typing.Optional[int]
|
|
394
|
+
Project ID
|
|
395
|
+
|
|
396
|
+
regex_filter : typing.Optional[str]
|
|
397
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
398
|
+
|
|
399
|
+
title : typing.Optional[str]
|
|
400
|
+
Storage title
|
|
401
|
+
|
|
402
|
+
use_blob_urls : typing.Optional[bool]
|
|
403
|
+
Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
309
404
|
|
|
310
405
|
request_options : typing.Optional[RequestOptions]
|
|
311
406
|
Request-specific configuration.
|
|
@@ -330,15 +425,15 @@ class RedisClient:
|
|
|
330
425
|
f"api/storages/redis/{jsonable_encoder(id)}",
|
|
331
426
|
method="PATCH",
|
|
332
427
|
json={
|
|
333
|
-
"regex_filter": regex_filter,
|
|
334
|
-
"use_blob_urls": use_blob_urls,
|
|
335
|
-
"title": title,
|
|
336
428
|
"description": description,
|
|
337
|
-
"project": project,
|
|
338
|
-
"path": path,
|
|
339
429
|
"host": host,
|
|
340
|
-
"port": port,
|
|
341
430
|
"password": password,
|
|
431
|
+
"path": path,
|
|
432
|
+
"port": port,
|
|
433
|
+
"project": project,
|
|
434
|
+
"regex_filter": regex_filter,
|
|
435
|
+
"title": title,
|
|
436
|
+
"use_blob_urls": use_blob_urls,
|
|
342
437
|
},
|
|
343
438
|
headers={
|
|
344
439
|
"content-type": "application/json",
|
|
@@ -407,130 +502,129 @@ class RedisClient:
|
|
|
407
502
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
408
503
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
409
504
|
|
|
410
|
-
|
|
505
|
+
|
|
506
|
+
class AsyncRedisClient:
|
|
507
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
508
|
+
self._client_wrapper = client_wrapper
|
|
509
|
+
|
|
510
|
+
async def list(
|
|
411
511
|
self,
|
|
412
512
|
*,
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
416
|
-
title: typing.Optional[str] = OMIT,
|
|
417
|
-
description: typing.Optional[str] = OMIT,
|
|
418
|
-
project: typing.Optional[int] = OMIT,
|
|
419
|
-
path: typing.Optional[str] = OMIT,
|
|
420
|
-
host: typing.Optional[str] = OMIT,
|
|
421
|
-
port: typing.Optional[str] = OMIT,
|
|
422
|
-
password: typing.Optional[str] = OMIT,
|
|
513
|
+
ordering: typing.Optional[str] = None,
|
|
514
|
+
project: typing.Optional[int] = None,
|
|
423
515
|
request_options: typing.Optional[RequestOptions] = None,
|
|
424
|
-
) ->
|
|
516
|
+
) -> typing.List[RedisImportStorage]:
|
|
425
517
|
"""
|
|
426
|
-
|
|
518
|
+
Get a list of all Redis import storage connections.
|
|
427
519
|
|
|
428
520
|
Parameters
|
|
429
521
|
----------
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
regex_filter : typing.Optional[str]
|
|
434
|
-
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
435
|
-
|
|
436
|
-
use_blob_urls : typing.Optional[bool]
|
|
437
|
-
Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
438
|
-
|
|
439
|
-
title : typing.Optional[str]
|
|
440
|
-
Storage title
|
|
441
|
-
|
|
442
|
-
description : typing.Optional[str]
|
|
443
|
-
Storage description
|
|
522
|
+
ordering : typing.Optional[str]
|
|
523
|
+
Which field to use when ordering the results.
|
|
444
524
|
|
|
445
525
|
project : typing.Optional[int]
|
|
446
526
|
Project ID
|
|
447
527
|
|
|
448
|
-
path : typing.Optional[str]
|
|
449
|
-
Storage prefix (optional)
|
|
450
|
-
|
|
451
|
-
host : typing.Optional[str]
|
|
452
|
-
Server Host IP (optional)
|
|
453
|
-
|
|
454
|
-
port : typing.Optional[str]
|
|
455
|
-
Server Port (optional)
|
|
456
|
-
|
|
457
|
-
password : typing.Optional[str]
|
|
458
|
-
Server Password (optional)
|
|
459
|
-
|
|
460
528
|
request_options : typing.Optional[RequestOptions]
|
|
461
529
|
Request-specific configuration.
|
|
462
530
|
|
|
463
531
|
Returns
|
|
464
532
|
-------
|
|
465
|
-
|
|
533
|
+
typing.List[RedisImportStorage]
|
|
534
|
+
|
|
466
535
|
|
|
467
536
|
Examples
|
|
468
537
|
--------
|
|
469
|
-
|
|
538
|
+
import asyncio
|
|
470
539
|
|
|
471
|
-
|
|
540
|
+
from label_studio_sdk import AsyncLabelStudio
|
|
541
|
+
|
|
542
|
+
client = AsyncLabelStudio(
|
|
472
543
|
api_key="YOUR_API_KEY",
|
|
473
544
|
)
|
|
474
|
-
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
async def main() -> None:
|
|
548
|
+
await client.import_storage.redis.list()
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
asyncio.run(main())
|
|
475
552
|
"""
|
|
476
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
477
|
-
"api/storages/redis/
|
|
478
|
-
method="
|
|
479
|
-
|
|
480
|
-
"
|
|
481
|
-
"regex_filter": regex_filter,
|
|
482
|
-
"use_blob_urls": use_blob_urls,
|
|
483
|
-
"title": title,
|
|
484
|
-
"description": description,
|
|
553
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
554
|
+
"api/storages/redis/",
|
|
555
|
+
method="GET",
|
|
556
|
+
params={
|
|
557
|
+
"ordering": ordering,
|
|
485
558
|
"project": project,
|
|
486
|
-
"path": path,
|
|
487
|
-
"host": host,
|
|
488
|
-
"port": port,
|
|
489
|
-
"password": password,
|
|
490
|
-
},
|
|
491
|
-
headers={
|
|
492
|
-
"content-type": "application/json",
|
|
493
559
|
},
|
|
494
560
|
request_options=request_options,
|
|
495
|
-
omit=OMIT,
|
|
496
561
|
)
|
|
497
562
|
try:
|
|
498
563
|
if 200 <= _response.status_code < 300:
|
|
499
|
-
return
|
|
564
|
+
return typing.cast(
|
|
565
|
+
typing.List[RedisImportStorage],
|
|
566
|
+
construct_type(
|
|
567
|
+
type_=typing.List[RedisImportStorage], # type: ignore
|
|
568
|
+
object_=_response.json(),
|
|
569
|
+
),
|
|
570
|
+
)
|
|
500
571
|
_response_json = _response.json()
|
|
501
572
|
except JSONDecodeError:
|
|
502
573
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
503
574
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
504
575
|
|
|
505
|
-
|
|
506
|
-
class AsyncRedisClient:
|
|
507
|
-
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
508
|
-
self._client_wrapper = client_wrapper
|
|
509
|
-
|
|
510
|
-
async def list(
|
|
576
|
+
async def create(
|
|
511
577
|
self,
|
|
512
578
|
*,
|
|
513
|
-
|
|
514
|
-
|
|
579
|
+
description: typing.Optional[str] = OMIT,
|
|
580
|
+
host: typing.Optional[str] = OMIT,
|
|
581
|
+
password: typing.Optional[str] = OMIT,
|
|
582
|
+
path: typing.Optional[str] = OMIT,
|
|
583
|
+
port: typing.Optional[str] = OMIT,
|
|
584
|
+
project: typing.Optional[int] = OMIT,
|
|
585
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
586
|
+
title: typing.Optional[str] = OMIT,
|
|
587
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
515
588
|
request_options: typing.Optional[RequestOptions] = None,
|
|
516
|
-
) ->
|
|
589
|
+
) -> RedisImportStorage:
|
|
517
590
|
"""
|
|
518
|
-
|
|
591
|
+
Create a new Redis import storage connection.
|
|
519
592
|
|
|
520
593
|
Parameters
|
|
521
594
|
----------
|
|
522
|
-
|
|
523
|
-
|
|
595
|
+
description : typing.Optional[str]
|
|
596
|
+
Storage description
|
|
597
|
+
|
|
598
|
+
host : typing.Optional[str]
|
|
599
|
+
Server Host IP (optional)
|
|
600
|
+
|
|
601
|
+
password : typing.Optional[str]
|
|
602
|
+
Server Password (optional)
|
|
603
|
+
|
|
604
|
+
path : typing.Optional[str]
|
|
605
|
+
Storage prefix (optional)
|
|
606
|
+
|
|
607
|
+
port : typing.Optional[str]
|
|
608
|
+
Server Port (optional)
|
|
524
609
|
|
|
525
610
|
project : typing.Optional[int]
|
|
526
611
|
Project ID
|
|
527
612
|
|
|
613
|
+
regex_filter : typing.Optional[str]
|
|
614
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
615
|
+
|
|
616
|
+
title : typing.Optional[str]
|
|
617
|
+
Storage title
|
|
618
|
+
|
|
619
|
+
use_blob_urls : typing.Optional[bool]
|
|
620
|
+
Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
621
|
+
|
|
528
622
|
request_options : typing.Optional[RequestOptions]
|
|
529
623
|
Request-specific configuration.
|
|
530
624
|
|
|
531
625
|
Returns
|
|
532
626
|
-------
|
|
533
|
-
|
|
627
|
+
RedisImportStorage
|
|
534
628
|
|
|
535
629
|
|
|
536
630
|
Examples
|
|
@@ -545,26 +639,37 @@ class AsyncRedisClient:
|
|
|
545
639
|
|
|
546
640
|
|
|
547
641
|
async def main() -> None:
|
|
548
|
-
await client.import_storage.redis.
|
|
642
|
+
await client.import_storage.redis.create()
|
|
549
643
|
|
|
550
644
|
|
|
551
645
|
asyncio.run(main())
|
|
552
646
|
"""
|
|
553
647
|
_response = await self._client_wrapper.httpx_client.request(
|
|
554
648
|
"api/storages/redis/",
|
|
555
|
-
method="
|
|
556
|
-
|
|
557
|
-
"
|
|
649
|
+
method="POST",
|
|
650
|
+
json={
|
|
651
|
+
"description": description,
|
|
652
|
+
"host": host,
|
|
653
|
+
"password": password,
|
|
654
|
+
"path": path,
|
|
655
|
+
"port": port,
|
|
558
656
|
"project": project,
|
|
657
|
+
"regex_filter": regex_filter,
|
|
658
|
+
"title": title,
|
|
659
|
+
"use_blob_urls": use_blob_urls,
|
|
660
|
+
},
|
|
661
|
+
headers={
|
|
662
|
+
"content-type": "application/json",
|
|
559
663
|
},
|
|
560
664
|
request_options=request_options,
|
|
665
|
+
omit=OMIT,
|
|
561
666
|
)
|
|
562
667
|
try:
|
|
563
668
|
if 200 <= _response.status_code < 300:
|
|
564
669
|
return typing.cast(
|
|
565
|
-
|
|
670
|
+
RedisImportStorage,
|
|
566
671
|
construct_type(
|
|
567
|
-
type_=
|
|
672
|
+
type_=RedisImportStorage, # type: ignore
|
|
568
673
|
object_=_response.json(),
|
|
569
674
|
),
|
|
570
675
|
)
|
|
@@ -573,59 +678,62 @@ class AsyncRedisClient:
|
|
|
573
678
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
574
679
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
575
680
|
|
|
576
|
-
async def
|
|
681
|
+
async def validate(
|
|
577
682
|
self,
|
|
578
683
|
*,
|
|
579
|
-
regex_filter: typing.Optional[str] = OMIT,
|
|
580
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
581
|
-
title: typing.Optional[str] = OMIT,
|
|
582
684
|
description: typing.Optional[str] = OMIT,
|
|
583
|
-
project: typing.Optional[int] = OMIT,
|
|
584
|
-
path: typing.Optional[str] = OMIT,
|
|
585
685
|
host: typing.Optional[str] = OMIT,
|
|
586
|
-
|
|
686
|
+
id: typing.Optional[int] = OMIT,
|
|
587
687
|
password: typing.Optional[str] = OMIT,
|
|
688
|
+
path: typing.Optional[str] = OMIT,
|
|
689
|
+
port: typing.Optional[str] = OMIT,
|
|
690
|
+
project: typing.Optional[int] = OMIT,
|
|
691
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
692
|
+
title: typing.Optional[str] = OMIT,
|
|
693
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
588
694
|
request_options: typing.Optional[RequestOptions] = None,
|
|
589
|
-
) ->
|
|
695
|
+
) -> None:
|
|
590
696
|
"""
|
|
591
|
-
|
|
697
|
+
Validate a specific Redis import storage connection.
|
|
592
698
|
|
|
593
699
|
Parameters
|
|
594
700
|
----------
|
|
595
|
-
regex_filter : typing.Optional[str]
|
|
596
|
-
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
597
|
-
|
|
598
|
-
use_blob_urls : typing.Optional[bool]
|
|
599
|
-
Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
600
|
-
|
|
601
|
-
title : typing.Optional[str]
|
|
602
|
-
Storage title
|
|
603
|
-
|
|
604
701
|
description : typing.Optional[str]
|
|
605
702
|
Storage description
|
|
606
703
|
|
|
607
|
-
|
|
608
|
-
|
|
704
|
+
host : typing.Optional[str]
|
|
705
|
+
Server Host IP (optional)
|
|
706
|
+
|
|
707
|
+
id : typing.Optional[int]
|
|
708
|
+
Storage ID. If set, storage with specified ID will be updated
|
|
709
|
+
|
|
710
|
+
password : typing.Optional[str]
|
|
711
|
+
Server Password (optional)
|
|
609
712
|
|
|
610
713
|
path : typing.Optional[str]
|
|
611
714
|
Storage prefix (optional)
|
|
612
715
|
|
|
613
|
-
host : typing.Optional[str]
|
|
614
|
-
Server Host IP (optional)
|
|
615
|
-
|
|
616
716
|
port : typing.Optional[str]
|
|
617
717
|
Server Port (optional)
|
|
618
718
|
|
|
619
|
-
|
|
620
|
-
|
|
719
|
+
project : typing.Optional[int]
|
|
720
|
+
Project ID
|
|
721
|
+
|
|
722
|
+
regex_filter : typing.Optional[str]
|
|
723
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
724
|
+
|
|
725
|
+
title : typing.Optional[str]
|
|
726
|
+
Storage title
|
|
727
|
+
|
|
728
|
+
use_blob_urls : typing.Optional[bool]
|
|
729
|
+
Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
621
730
|
|
|
622
731
|
request_options : typing.Optional[RequestOptions]
|
|
623
732
|
Request-specific configuration.
|
|
624
733
|
|
|
625
734
|
Returns
|
|
626
735
|
-------
|
|
627
|
-
|
|
628
|
-
|
|
736
|
+
None
|
|
629
737
|
|
|
630
738
|
Examples
|
|
631
739
|
--------
|
|
@@ -639,24 +747,25 @@ class AsyncRedisClient:
|
|
|
639
747
|
|
|
640
748
|
|
|
641
749
|
async def main() -> None:
|
|
642
|
-
await client.import_storage.redis.
|
|
750
|
+
await client.import_storage.redis.validate()
|
|
643
751
|
|
|
644
752
|
|
|
645
753
|
asyncio.run(main())
|
|
646
754
|
"""
|
|
647
755
|
_response = await self._client_wrapper.httpx_client.request(
|
|
648
|
-
"api/storages/redis/",
|
|
756
|
+
"api/storages/redis/validate",
|
|
649
757
|
method="POST",
|
|
650
758
|
json={
|
|
651
|
-
"regex_filter": regex_filter,
|
|
652
|
-
"use_blob_urls": use_blob_urls,
|
|
653
|
-
"title": title,
|
|
654
759
|
"description": description,
|
|
655
|
-
"project": project,
|
|
656
|
-
"path": path,
|
|
657
760
|
"host": host,
|
|
658
|
-
"
|
|
761
|
+
"id": id,
|
|
659
762
|
"password": password,
|
|
763
|
+
"path": path,
|
|
764
|
+
"port": port,
|
|
765
|
+
"project": project,
|
|
766
|
+
"regex_filter": regex_filter,
|
|
767
|
+
"title": title,
|
|
768
|
+
"use_blob_urls": use_blob_urls,
|
|
660
769
|
},
|
|
661
770
|
headers={
|
|
662
771
|
"content-type": "application/json",
|
|
@@ -666,13 +775,7 @@ class AsyncRedisClient:
|
|
|
666
775
|
)
|
|
667
776
|
try:
|
|
668
777
|
if 200 <= _response.status_code < 300:
|
|
669
|
-
return
|
|
670
|
-
RedisImportStorage,
|
|
671
|
-
construct_type(
|
|
672
|
-
type_=RedisImportStorage, # type: ignore
|
|
673
|
-
object_=_response.json(),
|
|
674
|
-
),
|
|
675
|
-
)
|
|
778
|
+
return
|
|
676
779
|
_response_json = _response.json()
|
|
677
780
|
except JSONDecodeError:
|
|
678
781
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -783,15 +886,15 @@ class AsyncRedisClient:
|
|
|
783
886
|
self,
|
|
784
887
|
id: int,
|
|
785
888
|
*,
|
|
786
|
-
regex_filter: typing.Optional[str] = OMIT,
|
|
787
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
788
|
-
title: typing.Optional[str] = OMIT,
|
|
789
889
|
description: typing.Optional[str] = OMIT,
|
|
790
|
-
project: typing.Optional[int] = OMIT,
|
|
791
|
-
path: typing.Optional[str] = OMIT,
|
|
792
890
|
host: typing.Optional[str] = OMIT,
|
|
793
|
-
port: typing.Optional[str] = OMIT,
|
|
794
891
|
password: typing.Optional[str] = OMIT,
|
|
892
|
+
path: typing.Optional[str] = OMIT,
|
|
893
|
+
port: typing.Optional[str] = OMIT,
|
|
894
|
+
project: typing.Optional[int] = OMIT,
|
|
895
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
896
|
+
title: typing.Optional[str] = OMIT,
|
|
897
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
795
898
|
request_options: typing.Optional[RequestOptions] = None,
|
|
796
899
|
) -> RedisImportStorage:
|
|
797
900
|
"""
|
|
@@ -801,32 +904,32 @@ class AsyncRedisClient:
|
|
|
801
904
|
----------
|
|
802
905
|
id : int
|
|
803
906
|
|
|
804
|
-
regex_filter : typing.Optional[str]
|
|
805
|
-
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
806
|
-
|
|
807
|
-
use_blob_urls : typing.Optional[bool]
|
|
808
|
-
Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
809
|
-
|
|
810
|
-
title : typing.Optional[str]
|
|
811
|
-
Storage title
|
|
812
|
-
|
|
813
907
|
description : typing.Optional[str]
|
|
814
908
|
Storage description
|
|
815
909
|
|
|
816
|
-
|
|
817
|
-
|
|
910
|
+
host : typing.Optional[str]
|
|
911
|
+
Server Host IP (optional)
|
|
912
|
+
|
|
913
|
+
password : typing.Optional[str]
|
|
914
|
+
Server Password (optional)
|
|
818
915
|
|
|
819
916
|
path : typing.Optional[str]
|
|
820
917
|
Storage prefix (optional)
|
|
821
918
|
|
|
822
|
-
host : typing.Optional[str]
|
|
823
|
-
Server Host IP (optional)
|
|
824
|
-
|
|
825
919
|
port : typing.Optional[str]
|
|
826
920
|
Server Port (optional)
|
|
827
921
|
|
|
828
|
-
|
|
829
|
-
|
|
922
|
+
project : typing.Optional[int]
|
|
923
|
+
Project ID
|
|
924
|
+
|
|
925
|
+
regex_filter : typing.Optional[str]
|
|
926
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
927
|
+
|
|
928
|
+
title : typing.Optional[str]
|
|
929
|
+
Storage title
|
|
930
|
+
|
|
931
|
+
use_blob_urls : typing.Optional[bool]
|
|
932
|
+
Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
830
933
|
|
|
831
934
|
request_options : typing.Optional[RequestOptions]
|
|
832
935
|
Request-specific configuration.
|
|
@@ -859,15 +962,15 @@ class AsyncRedisClient:
|
|
|
859
962
|
f"api/storages/redis/{jsonable_encoder(id)}",
|
|
860
963
|
method="PATCH",
|
|
861
964
|
json={
|
|
862
|
-
"regex_filter": regex_filter,
|
|
863
|
-
"use_blob_urls": use_blob_urls,
|
|
864
|
-
"title": title,
|
|
865
965
|
"description": description,
|
|
866
|
-
"project": project,
|
|
867
|
-
"path": path,
|
|
868
966
|
"host": host,
|
|
869
|
-
"port": port,
|
|
870
967
|
"password": password,
|
|
968
|
+
"path": path,
|
|
969
|
+
"port": port,
|
|
970
|
+
"project": project,
|
|
971
|
+
"regex_filter": regex_filter,
|
|
972
|
+
"title": title,
|
|
973
|
+
"use_blob_urls": use_blob_urls,
|
|
871
974
|
},
|
|
872
975
|
headers={
|
|
873
976
|
"content-type": "application/json",
|
|
@@ -943,106 +1046,3 @@ class AsyncRedisClient:
|
|
|
943
1046
|
except JSONDecodeError:
|
|
944
1047
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
945
1048
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
946
|
-
|
|
947
|
-
async def validate(
|
|
948
|
-
self,
|
|
949
|
-
*,
|
|
950
|
-
id: typing.Optional[int] = OMIT,
|
|
951
|
-
regex_filter: typing.Optional[str] = OMIT,
|
|
952
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
953
|
-
title: typing.Optional[str] = OMIT,
|
|
954
|
-
description: typing.Optional[str] = OMIT,
|
|
955
|
-
project: typing.Optional[int] = OMIT,
|
|
956
|
-
path: typing.Optional[str] = OMIT,
|
|
957
|
-
host: typing.Optional[str] = OMIT,
|
|
958
|
-
port: typing.Optional[str] = OMIT,
|
|
959
|
-
password: typing.Optional[str] = OMIT,
|
|
960
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
961
|
-
) -> None:
|
|
962
|
-
"""
|
|
963
|
-
Validate a specific Redis import storage connection.
|
|
964
|
-
|
|
965
|
-
Parameters
|
|
966
|
-
----------
|
|
967
|
-
id : typing.Optional[int]
|
|
968
|
-
Storage ID. If set, storage with specified ID will be updated
|
|
969
|
-
|
|
970
|
-
regex_filter : typing.Optional[str]
|
|
971
|
-
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
972
|
-
|
|
973
|
-
use_blob_urls : typing.Optional[bool]
|
|
974
|
-
Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.
|
|
975
|
-
|
|
976
|
-
title : typing.Optional[str]
|
|
977
|
-
Storage title
|
|
978
|
-
|
|
979
|
-
description : typing.Optional[str]
|
|
980
|
-
Storage description
|
|
981
|
-
|
|
982
|
-
project : typing.Optional[int]
|
|
983
|
-
Project ID
|
|
984
|
-
|
|
985
|
-
path : typing.Optional[str]
|
|
986
|
-
Storage prefix (optional)
|
|
987
|
-
|
|
988
|
-
host : typing.Optional[str]
|
|
989
|
-
Server Host IP (optional)
|
|
990
|
-
|
|
991
|
-
port : typing.Optional[str]
|
|
992
|
-
Server Port (optional)
|
|
993
|
-
|
|
994
|
-
password : typing.Optional[str]
|
|
995
|
-
Server Password (optional)
|
|
996
|
-
|
|
997
|
-
request_options : typing.Optional[RequestOptions]
|
|
998
|
-
Request-specific configuration.
|
|
999
|
-
|
|
1000
|
-
Returns
|
|
1001
|
-
-------
|
|
1002
|
-
None
|
|
1003
|
-
|
|
1004
|
-
Examples
|
|
1005
|
-
--------
|
|
1006
|
-
import asyncio
|
|
1007
|
-
|
|
1008
|
-
from label_studio_sdk import AsyncLabelStudio
|
|
1009
|
-
|
|
1010
|
-
client = AsyncLabelStudio(
|
|
1011
|
-
api_key="YOUR_API_KEY",
|
|
1012
|
-
)
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
async def main() -> None:
|
|
1016
|
-
await client.import_storage.redis.validate()
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
asyncio.run(main())
|
|
1020
|
-
"""
|
|
1021
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
1022
|
-
"api/storages/redis/validate",
|
|
1023
|
-
method="POST",
|
|
1024
|
-
json={
|
|
1025
|
-
"id": id,
|
|
1026
|
-
"regex_filter": regex_filter,
|
|
1027
|
-
"use_blob_urls": use_blob_urls,
|
|
1028
|
-
"title": title,
|
|
1029
|
-
"description": description,
|
|
1030
|
-
"project": project,
|
|
1031
|
-
"path": path,
|
|
1032
|
-
"host": host,
|
|
1033
|
-
"port": port,
|
|
1034
|
-
"password": password,
|
|
1035
|
-
},
|
|
1036
|
-
headers={
|
|
1037
|
-
"content-type": "application/json",
|
|
1038
|
-
},
|
|
1039
|
-
request_options=request_options,
|
|
1040
|
-
omit=OMIT,
|
|
1041
|
-
)
|
|
1042
|
-
try:
|
|
1043
|
-
if 200 <= _response.status_code < 300:
|
|
1044
|
-
return
|
|
1045
|
-
_response_json = _response.json()
|
|
1046
|
-
except JSONDecodeError:
|
|
1047
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1048
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|