> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/roboflow/roboflow-hi/datasets/adding-data/datasources.md).

# Datasources

Datasources आपको cloud storage से images और metadata को लगातार आपके Roboflow asset library में mirror करने देती हैं। एक बार mirror हो जाने पर, images को semantics, custom metadata, tags, या image similarity के आधार पर खोजा जा सकता है, और उन्हें labeling और training के लिए किसी भी Project में जोड़ा जा सकता है।

वर्तमान में, AWS S3 और S3-compatible storage bucket mirroring समर्थित है। Azure Blob Storage और Google Cloud Storage support जल्द ही आने वाला है।

## Bucket Mirror कैसे काम करता है

जब आप एक Datasource configure करते हैं, तो Roboflow आपके S3 bucket को crawls करता है और सभी matching image files को आपके Workspace के [Asset Library](/roboflow/roboflow-hi/workspaces/asset-library.md).

* समर्थित image formats: JPEG, PNG, BMP, WebP, AVIF
* आपके workspace में पहले से मौजूद files (उनके S3 location और hash से matched) दोबारा import नहीं की जातीं, जिससे egress costs कम होती हैं
* यदि एक `.json` sidecar file समान base name वाली image के साथ मौजूद है, तो उसका metadata import किया जाता है; nested keys को dot notation का उपयोग करके flatten किया जाता है (उदाहरण के लिए, `capture.temperature`) — देखें [Metadata Sidecars](#metadata-sidecars)
* जो files bucket से गायब हो जाती हैं, उन्हें वैकल्पिक रूप से आपके workspace से हटाया जा सकता है (देखें [Removing Orphaned Files](#removing-orphaned-files))

## अपने Bucket को Roboflow में Mirror करें

### पूर्व-आवश्यकताएँ

1. आपके image data वाला एक S3 bucket
2. Roboflow को आपके bucket को read करने की access — इनमें से एक चुनें:

   **Option A: IAM credentials (Access Key + Secret)**

   AWS managed policy के साथ एक IAM user बनाएं `AmazonS3FilesReadOnlyAccess` संलग्न, या एक custom policy जो अनुमति देती हो `s3:ListBucket`, `s3:GetObject`, और `s3:HeadObject` bucket और उसके objects पर। Access Key ID और Secret Access Key Roboflow को दें।

   **Option B: Bucket policy (Roboflow की AWS role को अनुमति दें)**

   कोई IAM credentials आवश्यक नहीं हैं। इसके बजाय, एक bucket policy जोड़ें जो Roboflow की AWS role को सीधे read access देती हो।

### Bucket Mirroring के लिए एक Datasource configure करें

[एक नया Datasource बनाएं](https://app.roboflow.com/settings/datasources) अपने workspace settings से।

### Glob Patterns के साथ Filtering

डिफ़ॉल्ट रूप से, bucket में मौजूद सभी समर्थित image files import की जाती हैं। आप glob patterns का उपयोग करके यह सीमित कर सकते हैं कि कौन-सी files import हों, चाहे सीधे निर्दिष्ट करके या किसी `.txt` file के माध्यम से जो bucket में संग्रहीत हो।

आप glob patterns के बजाय file paths की एक स्पष्ट whitelist भी प्रदान कर सकते हैं।

### Pattern semantics

* `*` को छोड़कर किसी भी character से मेल खाता है `/` (एकल directory level)
* `**` को शामिल करते हुए किसी भी character से मेल खाता है `/` (कई directory levels)

### उदाहरण

**prefix के आधार पर match करें:**

```
harvest**
```

मेल खाता है: `harvest`, `harvest2024`, `harvest/sun/file.jpg`, `harvest-data.png`\
मेल नहीं खाता: `Harvest`, `my-harvest`

**एक folder के अंदर सब कुछ match करें:**

```
/harvest/sun/**
```

मेल खाता है: `/harvest/sun/file.txt`, `/harvest/sun/subfolder/image.jpg`, `/harvest/sun/deep/nested/path/data.png`\
मेल नहीं खाता: `/harvest/moon/file.txt`, `/other/sun/file.txt`

**एक subtree के भीतर suffix के आधार पर match करें:**

```
/planting/**/*crops.png
```

मेल खाता है: `/planting/wheat-crops.png`, `/planting/subfolder/rice-crops.png`\
मेल नहीं खाता: `/planting/wheat.png`, `/other/wheat-crops.png`

**एक name pattern के साथ किसी विशिष्ट directory level पर match करें:**

```
/*/a/**/*weed*2025-10-27.png
```

मेल खाता है: `/farm/a/field/weed-2025-10-27.png`, `/garden/a/plot/seaweed-data-2025-10-27.png`\
मेल नहीं खाता: `/farm/b/field/weed-2025-10-27.png`

**सटीक path:**

```
/exact/path/to/file.jpg
```

केवल उसी विशिष्ट file से मेल खाता है।

**filenames में literal wildcards:**\
pattern को quotes में रखें ताकि `*` को एक literal character के रूप में माना जाए:

```
"/path/to/file*.jpg"
```

### Removing Orphaned Files

जब `removeOrphanedSourcesFromWorkspace` सक्षम है, तो जो files अब आपके S3 bucket में मौजूद नहीं हैं (या अब आपके glob patterns से मेल नहीं खातीं) उन्हें आपके Roboflow workspace से हटा दिया जाता है, बशर्ते कि वे किसी भी Project या किसी अन्य Datasource configuration द्वारा referenced न हों।

यह तब भी लागू होता है जब आप किसी Datasource को delete करते हैं। यदि orphan removal सक्षम है और bucket को कम-से-कम एक बार mirror किया जा चुका है, तो उस bucket से उत्पन्न images जो किसी अन्य Project में उपयोग नहीं हो रही हैं, उन्हें cleanup worker द्वारा हटाया जा सकता है। delete confirmation dialog आपको इसके बारे में चेतावनी देगा और आगे बढ़ने से पहले स्पष्ट acknowledgement की आवश्यकता होगी। इससे बचने के लिए, इसे delete करने से पहले Datasource की mirror configs पर orphan removal disable करें।

### File Naming

The `namingStrategy` setting यह नियंत्रित करता है कि imported files को Roboflow में कैसे नाम दिया जाए और कैसे प्रदर्शित किया जाए:

| रणनीति     | विवरण                                                                                                               |
| ---------- | ------------------------------------------------------------------------------------------------------------------- |
| `fullPath` | पूरा S3 key path filename के रूप में उपयोग करता है (default)                                                        |
| `fileName` | S3 key का केवल filename भाग उपयोग करता है                                                                           |
| `eTag`     | S3 object ETag उपयोग करता है                                                                                        |
| `metadata` | image के metadata से एक value उपयोग करता है, जिसे द्वारा निर्दिष्ट किया गया है `namingStrategyMetadataKey` (आवश्यक) |

### Image Updates

जब S3 में किसी image को modify किया जाता है, तो Roboflow आपके workspace में उसकी copy अपडेट कर सकता है:

* `updateImageWhenNewer` (default: `true`) — जब S3 object संग्रहीत version से नया हो, तब image को दोबारा import करता है
* `updateImageStrategy` — यह नियंत्रित करता है कि update कैसे लागू किया जाता है; वर्तमान में `overwrite` (मौजूदा image को बदल देता है) समर्थित है

### Metadata Sidecars

प्रत्येक image के साथ bucket में एक `.json` sidecar file रखकर images में metadata जोड़ें, उसी base name का उपयोग करते हुए:

```
my-bucket/
  images/
    photo_001.jpg
    photo_001.json      # photo_001.jpg के लिए metadata
    photo_002.jpg
    photo_002.json      # photo_002.jpg के लिए metadata
```

sidecar file में key-value pairs होते हैं:

```json
{
    "camera_id": "cam001",
    "location": "warehouse-3",
    "capture": { "temperature": 72.5, "humidity": 45 }
}
```

Nested objects को dot notation का उपयोग करके flatten किया जाता है। ऊपर दिया गया उदाहरण यह उत्पन्न करता है:

| Key                   | Value           |
| --------------------- | --------------- |
| `camera_id`           | `"cam001"`      |
| `location`            | `"warehouse-3"` |
| `capture.temperature` | `72.5`          |
| `capture.humidity`    | `45`            |

Sidecar file constraints:

* Maximum file size: 256 KB
* मान्य JSON होना चाहिए
* `null` और `undefined` values फ़िल्टर कर दिए जाते हैं

### Metadata Sync Strategies

जब किसी image का metadata sidecar `.json` file S3 में अपडेट किया जाता है, तो दो settings यह नियंत्रित करती हैं कि update कैसे लागू किया जाए:

* `updateMetadataWhenNewer` (default: `true`) — जब sidecar file संग्रहीत version से नया हो, तब metadata को दोबारा sync करता है
* `updateMetadataStrategy` — यह नियंत्रित करता है कि synced metadata, UI या API के माध्यम से आपने manually set किए गए metadata के साथ कैसे interact करता है:

| रणनीति                      | व्यवहार                                                                                           |
| --------------------------- | ------------------------------------------------------------------------------------------------- |
| `mergeBucketWins` (default) | दोनों sources को merge करता है; key conflicts में bucket value जीतती है                           |
| `mergeUserWins`             | दोनों sources को merge करता है; key conflicts में user-set value जीतती है                         |
| `overwrite`                 | Bucket metadata सभी मौजूदा metadata को पूरी तरह replace कर देता है                                |
| `untilFirstChange`          | bucket से sync करता है जब तक user manually किसी metadata field को edit नहीं करता, फिर रुक जाता है |
| `append`                    | केवल bucket से नए keys जोड़ता है; मौजूदा keys को कभी overwrite नहीं करता                          |

## एक Mirroring को Trigger करना

Datasources एक recurring schedule पर mirror करती हैं। आप किसी भी समय [Datasources list](https://app.roboflow.com/settings/datasources) से Datasource के बगल में play button पर क्लिक करके manual रूप से भी mirror trigger कर सकते हैं।

एक manual trigger दो guards के अधीन होता है:

* **In-progress**: यदि कोई sync पहले से चल रहा है, तो उसके समाप्त होने तक आप दूसरा शुरू नहीं कर सकते।
* **Cooldown**: सफल sync के बाद, manual re-triggers एक घंटे के लिए ब्लॉक हो जाते हैं। button tooltip दिखाता है कि कितने मिनट शेष हैं। यदि पिछले sync ने import करने के लिए कुछ भी नया नहीं पाया (zero files enqueued, या सभी files failed), तो cooldown छोड़ दिया जाता है ताकि आप तुरंत पुनः प्रयास कर सकें।

Scheduled (cron) syncs पर manual cooldown का प्रभाव नहीं पड़ता।

## Synced Assets देखना

में प्रत्येक Datasource row के [Datasources list](https://app.roboflow.com/settings/datasources) में एक eye icon होता है जो [Asset Library](/roboflow/roboflow-hi/workspaces/asset-library.md) को खोलता है, जो उस विशिष्ट Datasource की images पर filter किया गया होता है। जब तक Datasource कम-से-कम एक sync पूरा नहीं कर लेता, icon disabled रहता है।

किसी भी Datasource से synced सभी images देखने के लिए, Datasources list के नीचे "View Datasource Assets" पर क्लिक करें। यह link तब दिखाई देता है जब कम-से-कम एक Datasource चल चुका हो।

दोनों links आपको Asset Library पर एक pre-filled tag filter के साथ ले जाते हैं ताकि आप केवल अपने Workspace images के bucket-synced subset को browse, search, और manage कर सकें।

## S3-Compatible Storage का उपयोग करना

Datasources उन S3-compatible storage providers के साथ काम करती हैं जो आवश्यक S3 API operations लागू करते हैं, जैसे Wasabi, Backblaze, Cloudflare R2, DigitalOcean Spaces, और अन्य। वही glob pattern filtering और metadata sidecar व्यवहार लागू होता है। आपको provider का `endpoint` URL Datasource configuration में प्रदान करना होगा और region को `auto` या उस provider के उपयुक्त मान पर सेट करना होगा।


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.roboflow.com/roboflow/roboflow-hi/datasets/adding-data/datasources.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
