Import StorageGcs

Create import storage

POST

Create a new source storage connection to a Google Cloud Storage bucket.

For information about the required fields and prerequisites, see Google Cloud Storage in the Label Studio documentation.

Ensure you configure CORS before adding cloud storage. This ensures you will be able to see the content of the data rather than just a link.
After you add the storage, you should validate the connection before attempting to sync your data. Your data will not be imported until you sync your connection.

Request

This endpoint expects an object.
regex_filter
stringOptional
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
use_blob_urls
booleanOptional
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.
presign
booleanOptional
Presign URLs for direct download
presign_ttl
integerOptionalDefaults to 1
Presign TTL in minutes
title
stringOptional
Storage title
description
stringOptional
Storage description
project
integerOptional
Project ID
bucket
stringOptional
GCS bucket name
prefix
stringOptional
GCS bucket prefix
google_application_credentials
stringOptional

The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.

google_project_id
stringOptional
Google project ID

Response

This endpoint returns an object
regex_filter
stringOptional
Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.
use_blob_urls
booleanOptional
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.
presign
booleanOptional
Presign URLs for direct download
presign_ttl
integerOptionalDefaults to 1
Presign TTL in minutes
title
stringOptional
Storage title
description
stringOptional
Storage description
project
integerOptional
Project ID
bucket
stringOptional
GCS bucket name
prefix
stringOptional
GCS bucket prefix
google_application_credentials
stringOptional

The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.

google_project_id
stringOptional
Google project ID
POST
1curl -X POST http://localhost:8080/api/storages/gcs/ \
2 -H "Authorization: Token <api_key>" \
3 -H "Content-Type: application/json" \
4 -d '{}'
200Successful
1{
2 "regex_filter": "regex_filter",
3 "use_blob_urls": true,
4 "presign": true,
5 "presign_ttl": 1,
6 "title": "title",
7 "description": "description",
8 "project": 1,
9 "bucket": "bucket",
10 "prefix": "prefix",
11 "google_application_credentials": "google_application_credentials",
12 "google_project_id": "google_project_id"
13}