🔍 Code Extractor

class SiteMeTAInfoProvider

Maturity: 36

A SharePoint client class that provides access to site metadata information through Azure container SAS token retrieval.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/administration/site_me_ta_info_provider.py
Lines:
6 - 19
Complexity:
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

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class SiteContentProcessingInfoProvider 66.1% similar

    A SharePoint entity class that provides information about site content processing in the SharePoint Search Administration context.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/administration/site_content_processing_info_provider.py
  • class SitePageMetadataCollection 61.1% similar

    A collection class for managing and retrieving SharePoint site page metadata objects, providing methods to access individual site pages by their identifiers.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/publishing/pages/metadata_collection.py
  • class TeamSiteData 60.3% similar

    TeamSiteData is a SharePoint entity class that represents data associated with a team site in Office 365/SharePoint Online.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sites/team_site_data.py
  • class SiteScriptMetadata 60.2% similar

    A data class representing metadata for a SharePoint site script, including its identifier, content, and description.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sitescripts/metadata.py
  • class TenantAdminSettingsService 58.3% similar

    A service class for managing SharePoint Online tenant administration settings, providing access to tenant-level configuration and sharing status.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/tenant/administration/settings_service.py
← Back to Browse