class DataSource
DataSource is an abstract base class that serves as a foundation for identifying and representing sources of content in eDiscovery operations within the Office 365 ecosystem.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/security/data_source.py
4 - 5
simple
Purpose
This abstract base class provides a common interface for different types of data sources used in eDiscovery scenarios. It inherits from Entity and is designed to be subclassed by concrete implementations that represent specific content sources (such as mailboxes, SharePoint sites, Teams channels, etc.) that need to be searched or preserved during legal discovery processes. As an abstract class, it should not be instantiated directly but rather extended by specific data source types.
Source Code
class DataSource(Entity):
"""The dataSource entity is an abstract base class used to identify sources of content for eDiscovery."""
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
Entity | - |
Parameter Details
bases: Inherits from Entity class, which provides base functionality for Office 365 entities including property management, serialization, and API interaction capabilities
Return Value
When subclassed and instantiated, returns a DataSource object that represents a specific content source for eDiscovery. The base class itself should not be instantiated directly as it is abstract. Subclass instances will have access to Entity methods for interacting with Office 365 Graph API endpoints.
Class Interface
Dependencies
office365
Required Imports
from office365.entity import Entity
from office365.ediscovery.datasource import DataSource
Usage Example
# Note: DataSource is abstract and should not be instantiated directly
# Instead, use concrete subclasses like UserSource, SiteSource, etc.
from office365.graph_client import GraphClient
from office365.ediscovery.datasource import DataSource
# Authenticate with Office 365
client = GraphClient.with_token(lambda: 'your_access_token')
# DataSource would typically be accessed through eDiscovery case operations
# Example of working with data sources in an eDiscovery case:
case = client.security.cases.ediscovery.get_by_id('case_id')
custodians = case.custodians.get().execute_query()
# Access data sources associated with custodians
for custodian in custodians:
data_sources = custodian.data_sources.get().execute_query()
for data_source in data_sources:
# data_source is a concrete implementation of DataSource
print(f"Data source ID: {data_source.id}")
print(f"Data source type: {type(data_source).__name__}")
Best Practices
- Do not instantiate DataSource directly; always use concrete subclasses that implement specific data source types
- Ensure proper authentication and authorization before accessing eDiscovery data sources
- Use within the context of an eDiscovery case to properly manage legal holds and content preservation
- Follow the Office 365 Graph API patterns for querying and manipulating data sources
- Verify that the user or application has appropriate eDiscovery permissions (typically eDiscovery Administrator or eDiscovery Manager roles)
- When extending this class, implement all required abstract methods and properties defined by the Entity base class
- Handle API rate limits and throttling when working with multiple data sources
- Always use proper error handling when accessing data sources as they may be deleted or permissions may change
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class ListDataSource 61.3% similar
-
class External 59.1% similar
-
class EdiscoveryCase 55.3% similar
-
class Entity 54.4% similar
-
class CasesRoot 53.2% similar