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,22 +79,22 @@ class S3Client:
|
|
|
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
|
-
presign: typing.Optional[bool] = OMIT,
|
|
85
|
-
presign_ttl: typing.Optional[int] = OMIT,
|
|
86
|
-
recursive_scan: typing.Optional[bool] = OMIT,
|
|
87
|
-
title: typing.Optional[str] = OMIT,
|
|
88
|
-
description: typing.Optional[str] = OMIT,
|
|
89
|
-
project: typing.Optional[int] = OMIT,
|
|
90
|
-
bucket: typing.Optional[str] = OMIT,
|
|
91
|
-
prefix: typing.Optional[str] = OMIT,
|
|
92
82
|
aws_access_key_id: typing.Optional[str] = OMIT,
|
|
93
83
|
aws_secret_access_key: typing.Optional[str] = OMIT,
|
|
94
84
|
aws_session_token: typing.Optional[str] = OMIT,
|
|
95
85
|
aws_sse_kms_key_id: typing.Optional[str] = OMIT,
|
|
86
|
+
bucket: typing.Optional[str] = OMIT,
|
|
87
|
+
description: typing.Optional[str] = OMIT,
|
|
88
|
+
prefix: typing.Optional[str] = OMIT,
|
|
89
|
+
presign: typing.Optional[bool] = OMIT,
|
|
90
|
+
presign_ttl: typing.Optional[int] = OMIT,
|
|
91
|
+
project: typing.Optional[int] = OMIT,
|
|
92
|
+
recursive_scan: typing.Optional[bool] = OMIT,
|
|
93
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
96
94
|
region_name: typing.Optional[str] = OMIT,
|
|
97
95
|
s3endpoint: typing.Optional[str] = OMIT,
|
|
96
|
+
title: typing.Optional[str] = OMIT,
|
|
97
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
98
98
|
request_options: typing.Optional[RequestOptions] = None,
|
|
99
99
|
) -> S3ImportStorage:
|
|
100
100
|
"""
|
|
@@ -102,11 +102,26 @@ class S3Client:
|
|
|
102
102
|
|
|
103
103
|
Parameters
|
|
104
104
|
----------
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
aws_access_key_id : typing.Optional[str]
|
|
106
|
+
AWS_ACCESS_KEY_ID
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
aws_secret_access_key : typing.Optional[str]
|
|
109
|
+
AWS_SECRET_ACCESS_KEY
|
|
110
|
+
|
|
111
|
+
aws_session_token : typing.Optional[str]
|
|
112
|
+
AWS_SESSION_TOKEN
|
|
113
|
+
|
|
114
|
+
aws_sse_kms_key_id : typing.Optional[str]
|
|
115
|
+
AWS SSE KMS Key ID
|
|
116
|
+
|
|
117
|
+
bucket : typing.Optional[str]
|
|
118
|
+
S3 bucket name
|
|
119
|
+
|
|
120
|
+
description : typing.Optional[str]
|
|
121
|
+
Storage description
|
|
122
|
+
|
|
123
|
+
prefix : typing.Optional[str]
|
|
124
|
+
S3 bucket prefix
|
|
110
125
|
|
|
111
126
|
presign : typing.Optional[bool]
|
|
112
127
|
Presign URLs for download
|
|
@@ -114,24 +129,112 @@ class S3Client:
|
|
|
114
129
|
presign_ttl : typing.Optional[int]
|
|
115
130
|
Presign TTL in minutes
|
|
116
131
|
|
|
132
|
+
project : typing.Optional[int]
|
|
133
|
+
Project ID
|
|
134
|
+
|
|
117
135
|
recursive_scan : typing.Optional[bool]
|
|
118
136
|
Scan recursively
|
|
119
137
|
|
|
138
|
+
regex_filter : typing.Optional[str]
|
|
139
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
140
|
+
|
|
141
|
+
region_name : typing.Optional[str]
|
|
142
|
+
AWS Region
|
|
143
|
+
|
|
144
|
+
s3endpoint : typing.Optional[str]
|
|
145
|
+
S3 Endpoint
|
|
146
|
+
|
|
120
147
|
title : typing.Optional[str]
|
|
121
148
|
Storage title
|
|
122
149
|
|
|
123
|
-
|
|
124
|
-
|
|
150
|
+
use_blob_urls : typing.Optional[bool]
|
|
151
|
+
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.
|
|
125
152
|
|
|
126
|
-
|
|
127
|
-
|
|
153
|
+
request_options : typing.Optional[RequestOptions]
|
|
154
|
+
Request-specific configuration.
|
|
128
155
|
|
|
129
|
-
|
|
130
|
-
|
|
156
|
+
Returns
|
|
157
|
+
-------
|
|
158
|
+
S3ImportStorage
|
|
131
159
|
|
|
132
|
-
prefix : typing.Optional[str]
|
|
133
|
-
S3 bucket prefix
|
|
134
160
|
|
|
161
|
+
Examples
|
|
162
|
+
--------
|
|
163
|
+
from label_studio_sdk import LabelStudio
|
|
164
|
+
|
|
165
|
+
client = LabelStudio(
|
|
166
|
+
api_key="YOUR_API_KEY",
|
|
167
|
+
)
|
|
168
|
+
client.import_storage.s3.create()
|
|
169
|
+
"""
|
|
170
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
171
|
+
"api/storages/s3/",
|
|
172
|
+
method="POST",
|
|
173
|
+
json={
|
|
174
|
+
"aws_access_key_id": aws_access_key_id,
|
|
175
|
+
"aws_secret_access_key": aws_secret_access_key,
|
|
176
|
+
"aws_session_token": aws_session_token,
|
|
177
|
+
"aws_sse_kms_key_id": aws_sse_kms_key_id,
|
|
178
|
+
"bucket": bucket,
|
|
179
|
+
"description": description,
|
|
180
|
+
"prefix": prefix,
|
|
181
|
+
"presign": presign,
|
|
182
|
+
"presign_ttl": presign_ttl,
|
|
183
|
+
"project": project,
|
|
184
|
+
"recursive_scan": recursive_scan,
|
|
185
|
+
"regex_filter": regex_filter,
|
|
186
|
+
"region_name": region_name,
|
|
187
|
+
"s3_endpoint": s3endpoint,
|
|
188
|
+
"title": title,
|
|
189
|
+
"use_blob_urls": use_blob_urls,
|
|
190
|
+
},
|
|
191
|
+
headers={
|
|
192
|
+
"content-type": "application/json",
|
|
193
|
+
},
|
|
194
|
+
request_options=request_options,
|
|
195
|
+
omit=OMIT,
|
|
196
|
+
)
|
|
197
|
+
try:
|
|
198
|
+
if 200 <= _response.status_code < 300:
|
|
199
|
+
return typing.cast(
|
|
200
|
+
S3ImportStorage,
|
|
201
|
+
construct_type(
|
|
202
|
+
type_=S3ImportStorage, # type: ignore
|
|
203
|
+
object_=_response.json(),
|
|
204
|
+
),
|
|
205
|
+
)
|
|
206
|
+
_response_json = _response.json()
|
|
207
|
+
except JSONDecodeError:
|
|
208
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
209
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
210
|
+
|
|
211
|
+
def validate(
|
|
212
|
+
self,
|
|
213
|
+
*,
|
|
214
|
+
aws_access_key_id: typing.Optional[str] = OMIT,
|
|
215
|
+
aws_secret_access_key: typing.Optional[str] = OMIT,
|
|
216
|
+
aws_session_token: typing.Optional[str] = OMIT,
|
|
217
|
+
aws_sse_kms_key_id: typing.Optional[str] = OMIT,
|
|
218
|
+
bucket: typing.Optional[str] = OMIT,
|
|
219
|
+
description: typing.Optional[str] = OMIT,
|
|
220
|
+
id: typing.Optional[int] = OMIT,
|
|
221
|
+
prefix: typing.Optional[str] = OMIT,
|
|
222
|
+
presign: typing.Optional[bool] = OMIT,
|
|
223
|
+
presign_ttl: typing.Optional[int] = OMIT,
|
|
224
|
+
project: typing.Optional[int] = OMIT,
|
|
225
|
+
recursive_scan: typing.Optional[bool] = OMIT,
|
|
226
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
227
|
+
region_name: typing.Optional[str] = OMIT,
|
|
228
|
+
s3endpoint: typing.Optional[str] = OMIT,
|
|
229
|
+
title: typing.Optional[str] = OMIT,
|
|
230
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
231
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
232
|
+
) -> None:
|
|
233
|
+
"""
|
|
234
|
+
Validate a specific S3 import storage connection.
|
|
235
|
+
|
|
236
|
+
Parameters
|
|
237
|
+
----------
|
|
135
238
|
aws_access_key_id : typing.Optional[str]
|
|
136
239
|
AWS_ACCESS_KEY_ID
|
|
137
240
|
|
|
@@ -144,19 +247,51 @@ class S3Client:
|
|
|
144
247
|
aws_sse_kms_key_id : typing.Optional[str]
|
|
145
248
|
AWS SSE KMS Key ID
|
|
146
249
|
|
|
250
|
+
bucket : typing.Optional[str]
|
|
251
|
+
S3 bucket name
|
|
252
|
+
|
|
253
|
+
description : typing.Optional[str]
|
|
254
|
+
Storage description
|
|
255
|
+
|
|
256
|
+
id : typing.Optional[int]
|
|
257
|
+
Storage ID. If set, storage with specified ID will be updated
|
|
258
|
+
|
|
259
|
+
prefix : typing.Optional[str]
|
|
260
|
+
S3 bucket prefix
|
|
261
|
+
|
|
262
|
+
presign : typing.Optional[bool]
|
|
263
|
+
Presign URLs for download
|
|
264
|
+
|
|
265
|
+
presign_ttl : typing.Optional[int]
|
|
266
|
+
Presign TTL in minutes
|
|
267
|
+
|
|
268
|
+
project : typing.Optional[int]
|
|
269
|
+
Project ID
|
|
270
|
+
|
|
271
|
+
recursive_scan : typing.Optional[bool]
|
|
272
|
+
Scan recursively
|
|
273
|
+
|
|
274
|
+
regex_filter : typing.Optional[str]
|
|
275
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
276
|
+
|
|
147
277
|
region_name : typing.Optional[str]
|
|
148
278
|
AWS Region
|
|
149
279
|
|
|
150
280
|
s3endpoint : typing.Optional[str]
|
|
151
281
|
S3 Endpoint
|
|
152
282
|
|
|
283
|
+
title : typing.Optional[str]
|
|
284
|
+
Storage title
|
|
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
|
+
|
|
153
289
|
request_options : typing.Optional[RequestOptions]
|
|
154
290
|
Request-specific configuration.
|
|
155
291
|
|
|
156
292
|
Returns
|
|
157
293
|
-------
|
|
158
|
-
|
|
159
|
-
|
|
294
|
+
None
|
|
160
295
|
|
|
161
296
|
Examples
|
|
162
297
|
--------
|
|
@@ -165,28 +300,29 @@ class S3Client:
|
|
|
165
300
|
client = LabelStudio(
|
|
166
301
|
api_key="YOUR_API_KEY",
|
|
167
302
|
)
|
|
168
|
-
client.import_storage.s3.
|
|
303
|
+
client.import_storage.s3.validate()
|
|
169
304
|
"""
|
|
170
305
|
_response = self._client_wrapper.httpx_client.request(
|
|
171
|
-
"api/storages/s3/",
|
|
306
|
+
"api/storages/s3/validate",
|
|
172
307
|
method="POST",
|
|
173
308
|
json={
|
|
174
|
-
"regex_filter": regex_filter,
|
|
175
|
-
"use_blob_urls": use_blob_urls,
|
|
176
|
-
"presign": presign,
|
|
177
|
-
"presign_ttl": presign_ttl,
|
|
178
|
-
"recursive_scan": recursive_scan,
|
|
179
|
-
"title": title,
|
|
180
|
-
"description": description,
|
|
181
|
-
"project": project,
|
|
182
|
-
"bucket": bucket,
|
|
183
|
-
"prefix": prefix,
|
|
184
309
|
"aws_access_key_id": aws_access_key_id,
|
|
185
310
|
"aws_secret_access_key": aws_secret_access_key,
|
|
186
311
|
"aws_session_token": aws_session_token,
|
|
187
312
|
"aws_sse_kms_key_id": aws_sse_kms_key_id,
|
|
313
|
+
"bucket": bucket,
|
|
314
|
+
"description": description,
|
|
315
|
+
"id": id,
|
|
316
|
+
"prefix": prefix,
|
|
317
|
+
"presign": presign,
|
|
318
|
+
"presign_ttl": presign_ttl,
|
|
319
|
+
"project": project,
|
|
320
|
+
"recursive_scan": recursive_scan,
|
|
321
|
+
"regex_filter": regex_filter,
|
|
188
322
|
"region_name": region_name,
|
|
189
323
|
"s3_endpoint": s3endpoint,
|
|
324
|
+
"title": title,
|
|
325
|
+
"use_blob_urls": use_blob_urls,
|
|
190
326
|
},
|
|
191
327
|
headers={
|
|
192
328
|
"content-type": "application/json",
|
|
@@ -196,13 +332,7 @@ class S3Client:
|
|
|
196
332
|
)
|
|
197
333
|
try:
|
|
198
334
|
if 200 <= _response.status_code < 300:
|
|
199
|
-
return
|
|
200
|
-
S3ImportStorage,
|
|
201
|
-
construct_type(
|
|
202
|
-
type_=S3ImportStorage, # type: ignore
|
|
203
|
-
object_=_response.json(),
|
|
204
|
-
),
|
|
205
|
-
)
|
|
335
|
+
return
|
|
206
336
|
_response_json = _response.json()
|
|
207
337
|
except JSONDecodeError:
|
|
208
338
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -297,22 +427,22 @@ class S3Client:
|
|
|
297
427
|
self,
|
|
298
428
|
id: int,
|
|
299
429
|
*,
|
|
300
|
-
regex_filter: typing.Optional[str] = OMIT,
|
|
301
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
302
|
-
presign: typing.Optional[bool] = OMIT,
|
|
303
|
-
presign_ttl: typing.Optional[int] = OMIT,
|
|
304
|
-
recursive_scan: typing.Optional[bool] = OMIT,
|
|
305
|
-
title: typing.Optional[str] = OMIT,
|
|
306
|
-
description: typing.Optional[str] = OMIT,
|
|
307
|
-
project: typing.Optional[int] = OMIT,
|
|
308
|
-
bucket: typing.Optional[str] = OMIT,
|
|
309
|
-
prefix: typing.Optional[str] = OMIT,
|
|
310
430
|
aws_access_key_id: typing.Optional[str] = OMIT,
|
|
311
431
|
aws_secret_access_key: typing.Optional[str] = OMIT,
|
|
312
432
|
aws_session_token: typing.Optional[str] = OMIT,
|
|
313
433
|
aws_sse_kms_key_id: typing.Optional[str] = OMIT,
|
|
434
|
+
bucket: typing.Optional[str] = OMIT,
|
|
435
|
+
description: typing.Optional[str] = OMIT,
|
|
436
|
+
prefix: typing.Optional[str] = OMIT,
|
|
437
|
+
presign: typing.Optional[bool] = OMIT,
|
|
438
|
+
presign_ttl: typing.Optional[int] = OMIT,
|
|
439
|
+
project: typing.Optional[int] = OMIT,
|
|
440
|
+
recursive_scan: typing.Optional[bool] = OMIT,
|
|
441
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
314
442
|
region_name: typing.Optional[str] = OMIT,
|
|
315
443
|
s3endpoint: typing.Optional[str] = OMIT,
|
|
444
|
+
title: typing.Optional[str] = OMIT,
|
|
445
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
316
446
|
request_options: typing.Optional[RequestOptions] = None,
|
|
317
447
|
) -> S3ImportStorage:
|
|
318
448
|
"""
|
|
@@ -322,47 +452,41 @@ class S3Client:
|
|
|
322
452
|
----------
|
|
323
453
|
id : int
|
|
324
454
|
|
|
325
|
-
|
|
326
|
-
|
|
455
|
+
aws_access_key_id : typing.Optional[str]
|
|
456
|
+
AWS_ACCESS_KEY_ID
|
|
327
457
|
|
|
328
|
-
|
|
329
|
-
|
|
458
|
+
aws_secret_access_key : typing.Optional[str]
|
|
459
|
+
AWS_SECRET_ACCESS_KEY
|
|
330
460
|
|
|
331
|
-
|
|
332
|
-
|
|
461
|
+
aws_session_token : typing.Optional[str]
|
|
462
|
+
AWS_SESSION_TOKEN
|
|
333
463
|
|
|
334
|
-
|
|
335
|
-
|
|
464
|
+
aws_sse_kms_key_id : typing.Optional[str]
|
|
465
|
+
AWS SSE KMS Key ID
|
|
336
466
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
title : typing.Optional[str]
|
|
341
|
-
Storage title
|
|
467
|
+
bucket : typing.Optional[str]
|
|
468
|
+
S3 bucket name
|
|
342
469
|
|
|
343
470
|
description : typing.Optional[str]
|
|
344
471
|
Storage description
|
|
345
472
|
|
|
346
|
-
project : typing.Optional[int]
|
|
347
|
-
Project ID
|
|
348
|
-
|
|
349
|
-
bucket : typing.Optional[str]
|
|
350
|
-
S3 bucket name
|
|
351
|
-
|
|
352
473
|
prefix : typing.Optional[str]
|
|
353
474
|
S3 bucket prefix
|
|
354
475
|
|
|
355
|
-
|
|
356
|
-
|
|
476
|
+
presign : typing.Optional[bool]
|
|
477
|
+
Presign URLs for download
|
|
357
478
|
|
|
358
|
-
|
|
359
|
-
|
|
479
|
+
presign_ttl : typing.Optional[int]
|
|
480
|
+
Presign TTL in minutes
|
|
360
481
|
|
|
361
|
-
|
|
362
|
-
|
|
482
|
+
project : typing.Optional[int]
|
|
483
|
+
Project ID
|
|
363
484
|
|
|
364
|
-
|
|
365
|
-
|
|
485
|
+
recursive_scan : typing.Optional[bool]
|
|
486
|
+
Scan recursively
|
|
487
|
+
|
|
488
|
+
regex_filter : typing.Optional[str]
|
|
489
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
366
490
|
|
|
367
491
|
region_name : typing.Optional[str]
|
|
368
492
|
AWS Region
|
|
@@ -370,6 +494,12 @@ class S3Client:
|
|
|
370
494
|
s3endpoint : typing.Optional[str]
|
|
371
495
|
S3 Endpoint
|
|
372
496
|
|
|
497
|
+
title : typing.Optional[str]
|
|
498
|
+
Storage title
|
|
499
|
+
|
|
500
|
+
use_blob_urls : typing.Optional[bool]
|
|
501
|
+
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.
|
|
502
|
+
|
|
373
503
|
request_options : typing.Optional[RequestOptions]
|
|
374
504
|
Request-specific configuration.
|
|
375
505
|
|
|
@@ -393,22 +523,22 @@ class S3Client:
|
|
|
393
523
|
f"api/storages/s3/{jsonable_encoder(id)}",
|
|
394
524
|
method="PATCH",
|
|
395
525
|
json={
|
|
396
|
-
"regex_filter": regex_filter,
|
|
397
|
-
"use_blob_urls": use_blob_urls,
|
|
398
|
-
"presign": presign,
|
|
399
|
-
"presign_ttl": presign_ttl,
|
|
400
|
-
"recursive_scan": recursive_scan,
|
|
401
|
-
"title": title,
|
|
402
|
-
"description": description,
|
|
403
|
-
"project": project,
|
|
404
|
-
"bucket": bucket,
|
|
405
|
-
"prefix": prefix,
|
|
406
526
|
"aws_access_key_id": aws_access_key_id,
|
|
407
527
|
"aws_secret_access_key": aws_secret_access_key,
|
|
408
528
|
"aws_session_token": aws_session_token,
|
|
409
529
|
"aws_sse_kms_key_id": aws_sse_kms_key_id,
|
|
530
|
+
"bucket": bucket,
|
|
531
|
+
"description": description,
|
|
532
|
+
"prefix": prefix,
|
|
533
|
+
"presign": presign,
|
|
534
|
+
"presign_ttl": presign_ttl,
|
|
535
|
+
"project": project,
|
|
536
|
+
"recursive_scan": recursive_scan,
|
|
537
|
+
"regex_filter": regex_filter,
|
|
410
538
|
"region_name": region_name,
|
|
411
539
|
"s3_endpoint": s3endpoint,
|
|
540
|
+
"title": title,
|
|
541
|
+
"use_blob_urls": use_blob_urls,
|
|
412
542
|
},
|
|
413
543
|
headers={
|
|
414
544
|
"content-type": "application/json",
|
|
@@ -477,136 +607,6 @@ class S3Client:
|
|
|
477
607
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
478
608
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
479
609
|
|
|
480
|
-
def validate(
|
|
481
|
-
self,
|
|
482
|
-
*,
|
|
483
|
-
id: typing.Optional[int] = OMIT,
|
|
484
|
-
regex_filter: typing.Optional[str] = OMIT,
|
|
485
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
486
|
-
presign: typing.Optional[bool] = OMIT,
|
|
487
|
-
presign_ttl: typing.Optional[int] = OMIT,
|
|
488
|
-
recursive_scan: typing.Optional[bool] = OMIT,
|
|
489
|
-
title: typing.Optional[str] = OMIT,
|
|
490
|
-
description: typing.Optional[str] = OMIT,
|
|
491
|
-
project: typing.Optional[int] = OMIT,
|
|
492
|
-
bucket: typing.Optional[str] = OMIT,
|
|
493
|
-
prefix: typing.Optional[str] = OMIT,
|
|
494
|
-
aws_access_key_id: typing.Optional[str] = OMIT,
|
|
495
|
-
aws_secret_access_key: typing.Optional[str] = OMIT,
|
|
496
|
-
aws_session_token: typing.Optional[str] = OMIT,
|
|
497
|
-
aws_sse_kms_key_id: typing.Optional[str] = OMIT,
|
|
498
|
-
region_name: typing.Optional[str] = OMIT,
|
|
499
|
-
s3endpoint: typing.Optional[str] = OMIT,
|
|
500
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
501
|
-
) -> None:
|
|
502
|
-
"""
|
|
503
|
-
Validate a specific S3 import storage connection.
|
|
504
|
-
|
|
505
|
-
Parameters
|
|
506
|
-
----------
|
|
507
|
-
id : typing.Optional[int]
|
|
508
|
-
Storage ID. If set, storage with specified ID will be updated
|
|
509
|
-
|
|
510
|
-
regex_filter : typing.Optional[str]
|
|
511
|
-
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
512
|
-
|
|
513
|
-
use_blob_urls : typing.Optional[bool]
|
|
514
|
-
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.
|
|
515
|
-
|
|
516
|
-
presign : typing.Optional[bool]
|
|
517
|
-
Presign URLs for download
|
|
518
|
-
|
|
519
|
-
presign_ttl : typing.Optional[int]
|
|
520
|
-
Presign TTL in minutes
|
|
521
|
-
|
|
522
|
-
recursive_scan : typing.Optional[bool]
|
|
523
|
-
Scan recursively
|
|
524
|
-
|
|
525
|
-
title : typing.Optional[str]
|
|
526
|
-
Storage title
|
|
527
|
-
|
|
528
|
-
description : typing.Optional[str]
|
|
529
|
-
Storage description
|
|
530
|
-
|
|
531
|
-
project : typing.Optional[int]
|
|
532
|
-
Project ID
|
|
533
|
-
|
|
534
|
-
bucket : typing.Optional[str]
|
|
535
|
-
S3 bucket name
|
|
536
|
-
|
|
537
|
-
prefix : typing.Optional[str]
|
|
538
|
-
S3 bucket prefix
|
|
539
|
-
|
|
540
|
-
aws_access_key_id : typing.Optional[str]
|
|
541
|
-
AWS_ACCESS_KEY_ID
|
|
542
|
-
|
|
543
|
-
aws_secret_access_key : typing.Optional[str]
|
|
544
|
-
AWS_SECRET_ACCESS_KEY
|
|
545
|
-
|
|
546
|
-
aws_session_token : typing.Optional[str]
|
|
547
|
-
AWS_SESSION_TOKEN
|
|
548
|
-
|
|
549
|
-
aws_sse_kms_key_id : typing.Optional[str]
|
|
550
|
-
AWS SSE KMS Key ID
|
|
551
|
-
|
|
552
|
-
region_name : typing.Optional[str]
|
|
553
|
-
AWS Region
|
|
554
|
-
|
|
555
|
-
s3endpoint : typing.Optional[str]
|
|
556
|
-
S3 Endpoint
|
|
557
|
-
|
|
558
|
-
request_options : typing.Optional[RequestOptions]
|
|
559
|
-
Request-specific configuration.
|
|
560
|
-
|
|
561
|
-
Returns
|
|
562
|
-
-------
|
|
563
|
-
None
|
|
564
|
-
|
|
565
|
-
Examples
|
|
566
|
-
--------
|
|
567
|
-
from label_studio_sdk import LabelStudio
|
|
568
|
-
|
|
569
|
-
client = LabelStudio(
|
|
570
|
-
api_key="YOUR_API_KEY",
|
|
571
|
-
)
|
|
572
|
-
client.import_storage.s3.validate()
|
|
573
|
-
"""
|
|
574
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
575
|
-
"api/storages/s3/validate",
|
|
576
|
-
method="POST",
|
|
577
|
-
json={
|
|
578
|
-
"id": id,
|
|
579
|
-
"regex_filter": regex_filter,
|
|
580
|
-
"use_blob_urls": use_blob_urls,
|
|
581
|
-
"presign": presign,
|
|
582
|
-
"presign_ttl": presign_ttl,
|
|
583
|
-
"recursive_scan": recursive_scan,
|
|
584
|
-
"title": title,
|
|
585
|
-
"description": description,
|
|
586
|
-
"project": project,
|
|
587
|
-
"bucket": bucket,
|
|
588
|
-
"prefix": prefix,
|
|
589
|
-
"aws_access_key_id": aws_access_key_id,
|
|
590
|
-
"aws_secret_access_key": aws_secret_access_key,
|
|
591
|
-
"aws_session_token": aws_session_token,
|
|
592
|
-
"aws_sse_kms_key_id": aws_sse_kms_key_id,
|
|
593
|
-
"region_name": region_name,
|
|
594
|
-
"s3_endpoint": s3endpoint,
|
|
595
|
-
},
|
|
596
|
-
headers={
|
|
597
|
-
"content-type": "application/json",
|
|
598
|
-
},
|
|
599
|
-
request_options=request_options,
|
|
600
|
-
omit=OMIT,
|
|
601
|
-
)
|
|
602
|
-
try:
|
|
603
|
-
if 200 <= _response.status_code < 300:
|
|
604
|
-
return
|
|
605
|
-
_response_json = _response.json()
|
|
606
|
-
except JSONDecodeError:
|
|
607
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
608
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
609
|
-
|
|
610
610
|
|
|
611
611
|
class AsyncS3Client:
|
|
612
612
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -681,22 +681,22 @@ class AsyncS3Client:
|
|
|
681
681
|
async def create(
|
|
682
682
|
self,
|
|
683
683
|
*,
|
|
684
|
-
regex_filter: typing.Optional[str] = OMIT,
|
|
685
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
686
|
-
presign: typing.Optional[bool] = OMIT,
|
|
687
|
-
presign_ttl: typing.Optional[int] = OMIT,
|
|
688
|
-
recursive_scan: typing.Optional[bool] = OMIT,
|
|
689
|
-
title: typing.Optional[str] = OMIT,
|
|
690
|
-
description: typing.Optional[str] = OMIT,
|
|
691
|
-
project: typing.Optional[int] = OMIT,
|
|
692
|
-
bucket: typing.Optional[str] = OMIT,
|
|
693
|
-
prefix: typing.Optional[str] = OMIT,
|
|
694
684
|
aws_access_key_id: typing.Optional[str] = OMIT,
|
|
695
685
|
aws_secret_access_key: typing.Optional[str] = OMIT,
|
|
696
686
|
aws_session_token: typing.Optional[str] = OMIT,
|
|
697
687
|
aws_sse_kms_key_id: typing.Optional[str] = OMIT,
|
|
688
|
+
bucket: typing.Optional[str] = OMIT,
|
|
689
|
+
description: typing.Optional[str] = OMIT,
|
|
690
|
+
prefix: typing.Optional[str] = OMIT,
|
|
691
|
+
presign: typing.Optional[bool] = OMIT,
|
|
692
|
+
presign_ttl: typing.Optional[int] = OMIT,
|
|
693
|
+
project: typing.Optional[int] = OMIT,
|
|
694
|
+
recursive_scan: typing.Optional[bool] = OMIT,
|
|
695
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
698
696
|
region_name: typing.Optional[str] = OMIT,
|
|
699
697
|
s3endpoint: typing.Optional[str] = OMIT,
|
|
698
|
+
title: typing.Optional[str] = OMIT,
|
|
699
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
700
700
|
request_options: typing.Optional[RequestOptions] = None,
|
|
701
701
|
) -> S3ImportStorage:
|
|
702
702
|
"""
|
|
@@ -704,11 +704,26 @@ class AsyncS3Client:
|
|
|
704
704
|
|
|
705
705
|
Parameters
|
|
706
706
|
----------
|
|
707
|
-
|
|
708
|
-
|
|
707
|
+
aws_access_key_id : typing.Optional[str]
|
|
708
|
+
AWS_ACCESS_KEY_ID
|
|
709
709
|
|
|
710
|
-
|
|
711
|
-
|
|
710
|
+
aws_secret_access_key : typing.Optional[str]
|
|
711
|
+
AWS_SECRET_ACCESS_KEY
|
|
712
|
+
|
|
713
|
+
aws_session_token : typing.Optional[str]
|
|
714
|
+
AWS_SESSION_TOKEN
|
|
715
|
+
|
|
716
|
+
aws_sse_kms_key_id : typing.Optional[str]
|
|
717
|
+
AWS SSE KMS Key ID
|
|
718
|
+
|
|
719
|
+
bucket : typing.Optional[str]
|
|
720
|
+
S3 bucket name
|
|
721
|
+
|
|
722
|
+
description : typing.Optional[str]
|
|
723
|
+
Storage description
|
|
724
|
+
|
|
725
|
+
prefix : typing.Optional[str]
|
|
726
|
+
S3 bucket prefix
|
|
712
727
|
|
|
713
728
|
presign : typing.Optional[bool]
|
|
714
729
|
Presign URLs for download
|
|
@@ -716,24 +731,120 @@ class AsyncS3Client:
|
|
|
716
731
|
presign_ttl : typing.Optional[int]
|
|
717
732
|
Presign TTL in minutes
|
|
718
733
|
|
|
734
|
+
project : typing.Optional[int]
|
|
735
|
+
Project ID
|
|
736
|
+
|
|
719
737
|
recursive_scan : typing.Optional[bool]
|
|
720
738
|
Scan recursively
|
|
721
739
|
|
|
740
|
+
regex_filter : typing.Optional[str]
|
|
741
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
742
|
+
|
|
743
|
+
region_name : typing.Optional[str]
|
|
744
|
+
AWS Region
|
|
745
|
+
|
|
746
|
+
s3endpoint : typing.Optional[str]
|
|
747
|
+
S3 Endpoint
|
|
748
|
+
|
|
722
749
|
title : typing.Optional[str]
|
|
723
750
|
Storage title
|
|
724
751
|
|
|
725
|
-
|
|
726
|
-
|
|
752
|
+
use_blob_urls : typing.Optional[bool]
|
|
753
|
+
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.
|
|
727
754
|
|
|
728
|
-
|
|
729
|
-
|
|
755
|
+
request_options : typing.Optional[RequestOptions]
|
|
756
|
+
Request-specific configuration.
|
|
730
757
|
|
|
731
|
-
|
|
732
|
-
|
|
758
|
+
Returns
|
|
759
|
+
-------
|
|
760
|
+
S3ImportStorage
|
|
733
761
|
|
|
734
|
-
prefix : typing.Optional[str]
|
|
735
|
-
S3 bucket prefix
|
|
736
762
|
|
|
763
|
+
Examples
|
|
764
|
+
--------
|
|
765
|
+
import asyncio
|
|
766
|
+
|
|
767
|
+
from label_studio_sdk import AsyncLabelStudio
|
|
768
|
+
|
|
769
|
+
client = AsyncLabelStudio(
|
|
770
|
+
api_key="YOUR_API_KEY",
|
|
771
|
+
)
|
|
772
|
+
|
|
773
|
+
|
|
774
|
+
async def main() -> None:
|
|
775
|
+
await client.import_storage.s3.create()
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
asyncio.run(main())
|
|
779
|
+
"""
|
|
780
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
781
|
+
"api/storages/s3/",
|
|
782
|
+
method="POST",
|
|
783
|
+
json={
|
|
784
|
+
"aws_access_key_id": aws_access_key_id,
|
|
785
|
+
"aws_secret_access_key": aws_secret_access_key,
|
|
786
|
+
"aws_session_token": aws_session_token,
|
|
787
|
+
"aws_sse_kms_key_id": aws_sse_kms_key_id,
|
|
788
|
+
"bucket": bucket,
|
|
789
|
+
"description": description,
|
|
790
|
+
"prefix": prefix,
|
|
791
|
+
"presign": presign,
|
|
792
|
+
"presign_ttl": presign_ttl,
|
|
793
|
+
"project": project,
|
|
794
|
+
"recursive_scan": recursive_scan,
|
|
795
|
+
"regex_filter": regex_filter,
|
|
796
|
+
"region_name": region_name,
|
|
797
|
+
"s3_endpoint": s3endpoint,
|
|
798
|
+
"title": title,
|
|
799
|
+
"use_blob_urls": use_blob_urls,
|
|
800
|
+
},
|
|
801
|
+
headers={
|
|
802
|
+
"content-type": "application/json",
|
|
803
|
+
},
|
|
804
|
+
request_options=request_options,
|
|
805
|
+
omit=OMIT,
|
|
806
|
+
)
|
|
807
|
+
try:
|
|
808
|
+
if 200 <= _response.status_code < 300:
|
|
809
|
+
return typing.cast(
|
|
810
|
+
S3ImportStorage,
|
|
811
|
+
construct_type(
|
|
812
|
+
type_=S3ImportStorage, # type: ignore
|
|
813
|
+
object_=_response.json(),
|
|
814
|
+
),
|
|
815
|
+
)
|
|
816
|
+
_response_json = _response.json()
|
|
817
|
+
except JSONDecodeError:
|
|
818
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
819
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
820
|
+
|
|
821
|
+
async def validate(
|
|
822
|
+
self,
|
|
823
|
+
*,
|
|
824
|
+
aws_access_key_id: typing.Optional[str] = OMIT,
|
|
825
|
+
aws_secret_access_key: typing.Optional[str] = OMIT,
|
|
826
|
+
aws_session_token: typing.Optional[str] = OMIT,
|
|
827
|
+
aws_sse_kms_key_id: typing.Optional[str] = OMIT,
|
|
828
|
+
bucket: typing.Optional[str] = OMIT,
|
|
829
|
+
description: typing.Optional[str] = OMIT,
|
|
830
|
+
id: typing.Optional[int] = OMIT,
|
|
831
|
+
prefix: typing.Optional[str] = OMIT,
|
|
832
|
+
presign: typing.Optional[bool] = OMIT,
|
|
833
|
+
presign_ttl: typing.Optional[int] = OMIT,
|
|
834
|
+
project: typing.Optional[int] = OMIT,
|
|
835
|
+
recursive_scan: typing.Optional[bool] = OMIT,
|
|
836
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
837
|
+
region_name: typing.Optional[str] = OMIT,
|
|
838
|
+
s3endpoint: typing.Optional[str] = OMIT,
|
|
839
|
+
title: typing.Optional[str] = OMIT,
|
|
840
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
841
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
842
|
+
) -> None:
|
|
843
|
+
"""
|
|
844
|
+
Validate a specific S3 import storage connection.
|
|
845
|
+
|
|
846
|
+
Parameters
|
|
847
|
+
----------
|
|
737
848
|
aws_access_key_id : typing.Optional[str]
|
|
738
849
|
AWS_ACCESS_KEY_ID
|
|
739
850
|
|
|
@@ -746,19 +857,51 @@ class AsyncS3Client:
|
|
|
746
857
|
aws_sse_kms_key_id : typing.Optional[str]
|
|
747
858
|
AWS SSE KMS Key ID
|
|
748
859
|
|
|
860
|
+
bucket : typing.Optional[str]
|
|
861
|
+
S3 bucket name
|
|
862
|
+
|
|
863
|
+
description : typing.Optional[str]
|
|
864
|
+
Storage description
|
|
865
|
+
|
|
866
|
+
id : typing.Optional[int]
|
|
867
|
+
Storage ID. If set, storage with specified ID will be updated
|
|
868
|
+
|
|
869
|
+
prefix : typing.Optional[str]
|
|
870
|
+
S3 bucket prefix
|
|
871
|
+
|
|
872
|
+
presign : typing.Optional[bool]
|
|
873
|
+
Presign URLs for download
|
|
874
|
+
|
|
875
|
+
presign_ttl : typing.Optional[int]
|
|
876
|
+
Presign TTL in minutes
|
|
877
|
+
|
|
878
|
+
project : typing.Optional[int]
|
|
879
|
+
Project ID
|
|
880
|
+
|
|
881
|
+
recursive_scan : typing.Optional[bool]
|
|
882
|
+
Scan recursively
|
|
883
|
+
|
|
884
|
+
regex_filter : typing.Optional[str]
|
|
885
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
886
|
+
|
|
749
887
|
region_name : typing.Optional[str]
|
|
750
888
|
AWS Region
|
|
751
889
|
|
|
752
890
|
s3endpoint : typing.Optional[str]
|
|
753
891
|
S3 Endpoint
|
|
754
892
|
|
|
893
|
+
title : typing.Optional[str]
|
|
894
|
+
Storage title
|
|
895
|
+
|
|
896
|
+
use_blob_urls : typing.Optional[bool]
|
|
897
|
+
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.
|
|
898
|
+
|
|
755
899
|
request_options : typing.Optional[RequestOptions]
|
|
756
900
|
Request-specific configuration.
|
|
757
901
|
|
|
758
902
|
Returns
|
|
759
903
|
-------
|
|
760
|
-
|
|
761
|
-
|
|
904
|
+
None
|
|
762
905
|
|
|
763
906
|
Examples
|
|
764
907
|
--------
|
|
@@ -772,31 +915,32 @@ class AsyncS3Client:
|
|
|
772
915
|
|
|
773
916
|
|
|
774
917
|
async def main() -> None:
|
|
775
|
-
await client.import_storage.s3.
|
|
918
|
+
await client.import_storage.s3.validate()
|
|
776
919
|
|
|
777
920
|
|
|
778
921
|
asyncio.run(main())
|
|
779
|
-
"""
|
|
780
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
781
|
-
"api/storages/s3/",
|
|
782
|
-
method="POST",
|
|
783
|
-
json={
|
|
784
|
-
"regex_filter": regex_filter,
|
|
785
|
-
"use_blob_urls": use_blob_urls,
|
|
786
|
-
"presign": presign,
|
|
787
|
-
"presign_ttl": presign_ttl,
|
|
788
|
-
"recursive_scan": recursive_scan,
|
|
789
|
-
"title": title,
|
|
790
|
-
"description": description,
|
|
791
|
-
"project": project,
|
|
792
|
-
"bucket": bucket,
|
|
793
|
-
"prefix": prefix,
|
|
922
|
+
"""
|
|
923
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
924
|
+
"api/storages/s3/validate",
|
|
925
|
+
method="POST",
|
|
926
|
+
json={
|
|
794
927
|
"aws_access_key_id": aws_access_key_id,
|
|
795
928
|
"aws_secret_access_key": aws_secret_access_key,
|
|
796
929
|
"aws_session_token": aws_session_token,
|
|
797
930
|
"aws_sse_kms_key_id": aws_sse_kms_key_id,
|
|
931
|
+
"bucket": bucket,
|
|
932
|
+
"description": description,
|
|
933
|
+
"id": id,
|
|
934
|
+
"prefix": prefix,
|
|
935
|
+
"presign": presign,
|
|
936
|
+
"presign_ttl": presign_ttl,
|
|
937
|
+
"project": project,
|
|
938
|
+
"recursive_scan": recursive_scan,
|
|
939
|
+
"regex_filter": regex_filter,
|
|
798
940
|
"region_name": region_name,
|
|
799
941
|
"s3_endpoint": s3endpoint,
|
|
942
|
+
"title": title,
|
|
943
|
+
"use_blob_urls": use_blob_urls,
|
|
800
944
|
},
|
|
801
945
|
headers={
|
|
802
946
|
"content-type": "application/json",
|
|
@@ -806,13 +950,7 @@ class AsyncS3Client:
|
|
|
806
950
|
)
|
|
807
951
|
try:
|
|
808
952
|
if 200 <= _response.status_code < 300:
|
|
809
|
-
return
|
|
810
|
-
S3ImportStorage,
|
|
811
|
-
construct_type(
|
|
812
|
-
type_=S3ImportStorage, # type: ignore
|
|
813
|
-
object_=_response.json(),
|
|
814
|
-
),
|
|
815
|
-
)
|
|
953
|
+
return
|
|
816
954
|
_response_json = _response.json()
|
|
817
955
|
except JSONDecodeError:
|
|
818
956
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -923,22 +1061,22 @@ class AsyncS3Client:
|
|
|
923
1061
|
self,
|
|
924
1062
|
id: int,
|
|
925
1063
|
*,
|
|
926
|
-
regex_filter: typing.Optional[str] = OMIT,
|
|
927
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
928
|
-
presign: typing.Optional[bool] = OMIT,
|
|
929
|
-
presign_ttl: typing.Optional[int] = OMIT,
|
|
930
|
-
recursive_scan: typing.Optional[bool] = OMIT,
|
|
931
|
-
title: typing.Optional[str] = OMIT,
|
|
932
|
-
description: typing.Optional[str] = OMIT,
|
|
933
|
-
project: typing.Optional[int] = OMIT,
|
|
934
|
-
bucket: typing.Optional[str] = OMIT,
|
|
935
|
-
prefix: typing.Optional[str] = OMIT,
|
|
936
1064
|
aws_access_key_id: typing.Optional[str] = OMIT,
|
|
937
1065
|
aws_secret_access_key: typing.Optional[str] = OMIT,
|
|
938
1066
|
aws_session_token: typing.Optional[str] = OMIT,
|
|
939
1067
|
aws_sse_kms_key_id: typing.Optional[str] = OMIT,
|
|
1068
|
+
bucket: typing.Optional[str] = OMIT,
|
|
1069
|
+
description: typing.Optional[str] = OMIT,
|
|
1070
|
+
prefix: typing.Optional[str] = OMIT,
|
|
1071
|
+
presign: typing.Optional[bool] = OMIT,
|
|
1072
|
+
presign_ttl: typing.Optional[int] = OMIT,
|
|
1073
|
+
project: typing.Optional[int] = OMIT,
|
|
1074
|
+
recursive_scan: typing.Optional[bool] = OMIT,
|
|
1075
|
+
regex_filter: typing.Optional[str] = OMIT,
|
|
940
1076
|
region_name: typing.Optional[str] = OMIT,
|
|
941
1077
|
s3endpoint: typing.Optional[str] = OMIT,
|
|
1078
|
+
title: typing.Optional[str] = OMIT,
|
|
1079
|
+
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
942
1080
|
request_options: typing.Optional[RequestOptions] = None,
|
|
943
1081
|
) -> S3ImportStorage:
|
|
944
1082
|
"""
|
|
@@ -948,47 +1086,41 @@ class AsyncS3Client:
|
|
|
948
1086
|
----------
|
|
949
1087
|
id : int
|
|
950
1088
|
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
use_blob_urls : typing.Optional[bool]
|
|
955
|
-
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.
|
|
1089
|
+
aws_access_key_id : typing.Optional[str]
|
|
1090
|
+
AWS_ACCESS_KEY_ID
|
|
956
1091
|
|
|
957
|
-
|
|
958
|
-
|
|
1092
|
+
aws_secret_access_key : typing.Optional[str]
|
|
1093
|
+
AWS_SECRET_ACCESS_KEY
|
|
959
1094
|
|
|
960
|
-
|
|
961
|
-
|
|
1095
|
+
aws_session_token : typing.Optional[str]
|
|
1096
|
+
AWS_SESSION_TOKEN
|
|
962
1097
|
|
|
963
|
-
|
|
964
|
-
|
|
1098
|
+
aws_sse_kms_key_id : typing.Optional[str]
|
|
1099
|
+
AWS SSE KMS Key ID
|
|
965
1100
|
|
|
966
|
-
|
|
967
|
-
|
|
1101
|
+
bucket : typing.Optional[str]
|
|
1102
|
+
S3 bucket name
|
|
968
1103
|
|
|
969
1104
|
description : typing.Optional[str]
|
|
970
1105
|
Storage description
|
|
971
1106
|
|
|
972
|
-
project : typing.Optional[int]
|
|
973
|
-
Project ID
|
|
974
|
-
|
|
975
|
-
bucket : typing.Optional[str]
|
|
976
|
-
S3 bucket name
|
|
977
|
-
|
|
978
1107
|
prefix : typing.Optional[str]
|
|
979
1108
|
S3 bucket prefix
|
|
980
1109
|
|
|
981
|
-
|
|
982
|
-
|
|
1110
|
+
presign : typing.Optional[bool]
|
|
1111
|
+
Presign URLs for download
|
|
983
1112
|
|
|
984
|
-
|
|
985
|
-
|
|
1113
|
+
presign_ttl : typing.Optional[int]
|
|
1114
|
+
Presign TTL in minutes
|
|
986
1115
|
|
|
987
|
-
|
|
988
|
-
|
|
1116
|
+
project : typing.Optional[int]
|
|
1117
|
+
Project ID
|
|
989
1118
|
|
|
990
|
-
|
|
991
|
-
|
|
1119
|
+
recursive_scan : typing.Optional[bool]
|
|
1120
|
+
Scan recursively
|
|
1121
|
+
|
|
1122
|
+
regex_filter : typing.Optional[str]
|
|
1123
|
+
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
992
1124
|
|
|
993
1125
|
region_name : typing.Optional[str]
|
|
994
1126
|
AWS Region
|
|
@@ -996,6 +1128,12 @@ class AsyncS3Client:
|
|
|
996
1128
|
s3endpoint : typing.Optional[str]
|
|
997
1129
|
S3 Endpoint
|
|
998
1130
|
|
|
1131
|
+
title : typing.Optional[str]
|
|
1132
|
+
Storage title
|
|
1133
|
+
|
|
1134
|
+
use_blob_urls : typing.Optional[bool]
|
|
1135
|
+
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.
|
|
1136
|
+
|
|
999
1137
|
request_options : typing.Optional[RequestOptions]
|
|
1000
1138
|
Request-specific configuration.
|
|
1001
1139
|
|
|
@@ -1027,22 +1165,22 @@ class AsyncS3Client:
|
|
|
1027
1165
|
f"api/storages/s3/{jsonable_encoder(id)}",
|
|
1028
1166
|
method="PATCH",
|
|
1029
1167
|
json={
|
|
1030
|
-
"regex_filter": regex_filter,
|
|
1031
|
-
"use_blob_urls": use_blob_urls,
|
|
1032
|
-
"presign": presign,
|
|
1033
|
-
"presign_ttl": presign_ttl,
|
|
1034
|
-
"recursive_scan": recursive_scan,
|
|
1035
|
-
"title": title,
|
|
1036
|
-
"description": description,
|
|
1037
|
-
"project": project,
|
|
1038
|
-
"bucket": bucket,
|
|
1039
|
-
"prefix": prefix,
|
|
1040
1168
|
"aws_access_key_id": aws_access_key_id,
|
|
1041
1169
|
"aws_secret_access_key": aws_secret_access_key,
|
|
1042
1170
|
"aws_session_token": aws_session_token,
|
|
1043
1171
|
"aws_sse_kms_key_id": aws_sse_kms_key_id,
|
|
1172
|
+
"bucket": bucket,
|
|
1173
|
+
"description": description,
|
|
1174
|
+
"prefix": prefix,
|
|
1175
|
+
"presign": presign,
|
|
1176
|
+
"presign_ttl": presign_ttl,
|
|
1177
|
+
"project": project,
|
|
1178
|
+
"recursive_scan": recursive_scan,
|
|
1179
|
+
"regex_filter": regex_filter,
|
|
1044
1180
|
"region_name": region_name,
|
|
1045
1181
|
"s3_endpoint": s3endpoint,
|
|
1182
|
+
"title": title,
|
|
1183
|
+
"use_blob_urls": use_blob_urls,
|
|
1046
1184
|
},
|
|
1047
1185
|
headers={
|
|
1048
1186
|
"content-type": "application/json",
|
|
@@ -1118,141 +1256,3 @@ class AsyncS3Client:
|
|
|
1118
1256
|
except JSONDecodeError:
|
|
1119
1257
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1120
1258
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1121
|
-
|
|
1122
|
-
async def validate(
|
|
1123
|
-
self,
|
|
1124
|
-
*,
|
|
1125
|
-
id: typing.Optional[int] = OMIT,
|
|
1126
|
-
regex_filter: typing.Optional[str] = OMIT,
|
|
1127
|
-
use_blob_urls: typing.Optional[bool] = OMIT,
|
|
1128
|
-
presign: typing.Optional[bool] = OMIT,
|
|
1129
|
-
presign_ttl: typing.Optional[int] = OMIT,
|
|
1130
|
-
recursive_scan: typing.Optional[bool] = OMIT,
|
|
1131
|
-
title: typing.Optional[str] = OMIT,
|
|
1132
|
-
description: typing.Optional[str] = OMIT,
|
|
1133
|
-
project: typing.Optional[int] = OMIT,
|
|
1134
|
-
bucket: typing.Optional[str] = OMIT,
|
|
1135
|
-
prefix: typing.Optional[str] = OMIT,
|
|
1136
|
-
aws_access_key_id: typing.Optional[str] = OMIT,
|
|
1137
|
-
aws_secret_access_key: typing.Optional[str] = OMIT,
|
|
1138
|
-
aws_session_token: typing.Optional[str] = OMIT,
|
|
1139
|
-
aws_sse_kms_key_id: typing.Optional[str] = OMIT,
|
|
1140
|
-
region_name: typing.Optional[str] = OMIT,
|
|
1141
|
-
s3endpoint: typing.Optional[str] = OMIT,
|
|
1142
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
1143
|
-
) -> None:
|
|
1144
|
-
"""
|
|
1145
|
-
Validate a specific S3 import storage connection.
|
|
1146
|
-
|
|
1147
|
-
Parameters
|
|
1148
|
-
----------
|
|
1149
|
-
id : typing.Optional[int]
|
|
1150
|
-
Storage ID. If set, storage with specified ID will be updated
|
|
1151
|
-
|
|
1152
|
-
regex_filter : typing.Optional[str]
|
|
1153
|
-
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
|
|
1154
|
-
|
|
1155
|
-
use_blob_urls : typing.Optional[bool]
|
|
1156
|
-
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.
|
|
1157
|
-
|
|
1158
|
-
presign : typing.Optional[bool]
|
|
1159
|
-
Presign URLs for download
|
|
1160
|
-
|
|
1161
|
-
presign_ttl : typing.Optional[int]
|
|
1162
|
-
Presign TTL in minutes
|
|
1163
|
-
|
|
1164
|
-
recursive_scan : typing.Optional[bool]
|
|
1165
|
-
Scan recursively
|
|
1166
|
-
|
|
1167
|
-
title : typing.Optional[str]
|
|
1168
|
-
Storage title
|
|
1169
|
-
|
|
1170
|
-
description : typing.Optional[str]
|
|
1171
|
-
Storage description
|
|
1172
|
-
|
|
1173
|
-
project : typing.Optional[int]
|
|
1174
|
-
Project ID
|
|
1175
|
-
|
|
1176
|
-
bucket : typing.Optional[str]
|
|
1177
|
-
S3 bucket name
|
|
1178
|
-
|
|
1179
|
-
prefix : typing.Optional[str]
|
|
1180
|
-
S3 bucket prefix
|
|
1181
|
-
|
|
1182
|
-
aws_access_key_id : typing.Optional[str]
|
|
1183
|
-
AWS_ACCESS_KEY_ID
|
|
1184
|
-
|
|
1185
|
-
aws_secret_access_key : typing.Optional[str]
|
|
1186
|
-
AWS_SECRET_ACCESS_KEY
|
|
1187
|
-
|
|
1188
|
-
aws_session_token : typing.Optional[str]
|
|
1189
|
-
AWS_SESSION_TOKEN
|
|
1190
|
-
|
|
1191
|
-
aws_sse_kms_key_id : typing.Optional[str]
|
|
1192
|
-
AWS SSE KMS Key ID
|
|
1193
|
-
|
|
1194
|
-
region_name : typing.Optional[str]
|
|
1195
|
-
AWS Region
|
|
1196
|
-
|
|
1197
|
-
s3endpoint : typing.Optional[str]
|
|
1198
|
-
S3 Endpoint
|
|
1199
|
-
|
|
1200
|
-
request_options : typing.Optional[RequestOptions]
|
|
1201
|
-
Request-specific configuration.
|
|
1202
|
-
|
|
1203
|
-
Returns
|
|
1204
|
-
-------
|
|
1205
|
-
None
|
|
1206
|
-
|
|
1207
|
-
Examples
|
|
1208
|
-
--------
|
|
1209
|
-
import asyncio
|
|
1210
|
-
|
|
1211
|
-
from label_studio_sdk import AsyncLabelStudio
|
|
1212
|
-
|
|
1213
|
-
client = AsyncLabelStudio(
|
|
1214
|
-
api_key="YOUR_API_KEY",
|
|
1215
|
-
)
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
async def main() -> None:
|
|
1219
|
-
await client.import_storage.s3.validate()
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
asyncio.run(main())
|
|
1223
|
-
"""
|
|
1224
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
1225
|
-
"api/storages/s3/validate",
|
|
1226
|
-
method="POST",
|
|
1227
|
-
json={
|
|
1228
|
-
"id": id,
|
|
1229
|
-
"regex_filter": regex_filter,
|
|
1230
|
-
"use_blob_urls": use_blob_urls,
|
|
1231
|
-
"presign": presign,
|
|
1232
|
-
"presign_ttl": presign_ttl,
|
|
1233
|
-
"recursive_scan": recursive_scan,
|
|
1234
|
-
"title": title,
|
|
1235
|
-
"description": description,
|
|
1236
|
-
"project": project,
|
|
1237
|
-
"bucket": bucket,
|
|
1238
|
-
"prefix": prefix,
|
|
1239
|
-
"aws_access_key_id": aws_access_key_id,
|
|
1240
|
-
"aws_secret_access_key": aws_secret_access_key,
|
|
1241
|
-
"aws_session_token": aws_session_token,
|
|
1242
|
-
"aws_sse_kms_key_id": aws_sse_kms_key_id,
|
|
1243
|
-
"region_name": region_name,
|
|
1244
|
-
"s3_endpoint": s3endpoint,
|
|
1245
|
-
},
|
|
1246
|
-
headers={
|
|
1247
|
-
"content-type": "application/json",
|
|
1248
|
-
},
|
|
1249
|
-
request_options=request_options,
|
|
1250
|
-
omit=OMIT,
|
|
1251
|
-
)
|
|
1252
|
-
try:
|
|
1253
|
-
if 200 <= _response.status_code < 300:
|
|
1254
|
-
return
|
|
1255
|
-
_response_json = _response.json()
|
|
1256
|
-
except JSONDecodeError:
|
|
1257
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1258
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|