class SiteMeTAInfoProvider
A SharePoint client class that provides access to site metadata information through Azure container SAS token retrieval.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/administration/site_me_ta_info_provider.py
6 - 19
moderate
Purpose
SiteMeTAInfoProvider is a SharePoint entity class that facilitates access to site metadata information by providing methods to retrieve Azure container Shared Access Signature (SAS) tokens. This class is part of the SharePoint Search Administration API and is used to securely access Azure storage containers associated with SharePoint sites. It inherits from the Entity base class and integrates with the SharePoint client context to execute service operations.
Source Code
class SiteMeTAInfoProvider(Entity):
""""""
def get_azure_container_sas_token(self):
return_type = ClientResult(self.context, str())
qry = ServiceOperationQuery(
self, "GetAzureContainerSASToken", None, None, None, return_type
)
self.context.add_query(qry)
return return_type
@property
def entity_type_name(self):
return "Microsoft.SharePoint.Client.Search.Administration.SiteMeTAInfoProvider"
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
Entity | - |
Parameter Details
context: The SharePoint client context object that manages the connection and communication with the SharePoint server. This is inherited from the Entity base class and is required for executing queries and operations.
entity_data: Optional entity data dictionary used to initialize the entity's properties. This is a standard parameter for Entity-based classes in the office365 library.
Return Value
Instantiation returns a SiteMeTAInfoProvider object that can be used to interact with SharePoint site metadata services. The get_azure_container_sas_token() method returns a ClientResult object containing a string value representing the Azure container SAS token, which can be used to access Azure storage resources associated with the SharePoint site.
Class Interface
Methods
get_azure_container_sas_token(self) -> ClientResult
Purpose: Retrieves an Azure container Shared Access Signature (SAS) token for accessing Azure storage resources associated with the SharePoint site
Returns: A ClientResult object that will contain a string value representing the SAS token after the query is executed via context.execute_query()
@property entity_type_name(self) -> str
property
Purpose: Returns the fully qualified entity type name used by SharePoint's client object model to identify this entity type
Returns: The string 'Microsoft.SharePoint.Client.Search.Administration.SiteMeTAInfoProvider' which is the SharePoint entity type identifier
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
context |
ClientContext | The SharePoint client context object inherited from Entity base class, used to manage communication with SharePoint server and execute queries | instance |
Dependencies
office365
Required Imports
from office365.runtime.client_result import ClientResult
from office365.runtime.queries.service_operation import ServiceOperationQuery
from office365.sharepoint.entity import Entity
from office365.sharepoint.client_context import ClientContext
Usage Example
from office365.sharepoint.client_context import ClientContext
from office365.sharepoint.search.administration.site_meta_info_provider import SiteMeTAInfoProvider
# Authenticate with SharePoint
site_url = 'https://yourtenant.sharepoint.com/sites/yoursite'
username = 'user@yourtenant.onmicrosoft.com'
password = 'your_password'
ctx = ClientContext(site_url).with_credentials(username, password)
# Create an instance of SiteMeTAInfoProvider
provider = SiteMeTAInfoProvider(ctx)
# Get Azure container SAS token
token_result = provider.get_azure_container_sas_token()
ctx.execute_query()
# Access the token value
sas_token = token_result.value
print(f'SAS Token: {sas_token}')
Best Practices
- Always call ctx.execute_query() after invoking get_azure_container_sas_token() to execute the pending query and retrieve the actual token value
- The SAS token should be handled securely and not exposed in logs or client-side code
- Ensure proper authentication is established with the SharePoint context before creating the provider instance
- The returned ClientResult object contains the token in its 'value' property, which is only populated after execute_query() is called
- This class requires appropriate SharePoint permissions to access Search Administration APIs
- SAS tokens have expiration times, so cache them appropriately but be prepared to refresh when needed
- The provider instance is tied to a specific SharePoint context and should not be reused across different contexts
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class SiteContentProcessingInfoProvider 66.1% similar
-
class SitePageMetadataCollection 61.1% similar
-
class TeamSiteData 60.3% similar
-
class SiteScriptMetadata 60.2% similar
-
class TenantAdminSettingsService 58.3% similar