How to use the azure-storage-common.azure.storage.common._connection._ServiceParameters function in azure-storage-common

To help you get started, we’ve selected a few azure-storage-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-storage-python / azure-storage-common / azure / storage / common / _connection.py View on Github external
def get_service_parameters(service, account_name=None, account_key=None, sas_token=None, token_credential= None,
                               is_emulated=None, protocol=None, endpoint_suffix=None, custom_domain=None,
                               request_session=None, connection_string=None, socket_timeout=None):
        if connection_string:
            params = _ServiceParameters._from_connection_string(connection_string, service)
        elif is_emulated:
            params = _ServiceParameters(service, is_emulated=True, custom_domain=custom_domain)
        elif account_name:
            if protocol.lower() != 'https' and token_credential is not None:
                raise ValueError("Token credential is only supported with HTTPS.")
            params = _ServiceParameters(service,
                                        account_name=account_name,
                                        account_key=account_key,
                                        sas_token=sas_token,
                                        token_credential=token_credential,
                                        is_emulated=is_emulated,
                                        protocol=protocol,
                                        endpoint_suffix=endpoint_suffix,
                                        custom_domain=custom_domain)
        else:
            raise ValueError(_ERROR_STORAGE_MISSING_INFO)

        params.request_session = request_session
        params.socket_timeout = socket_timeout
        return params
github Azure / azure-storage-python / azure-storage-common / azure / storage / common / _connection.py View on Github external
account_name = config.get('AccountName')
        account_key = config.get('AccountKey')
        sas_token = config.get('SharedAccessSignature')

        # Emulator
        is_emulated = config.get('UseDevelopmentStorage')

        # Basic URL Configuration
        protocol = config.get('DefaultEndpointsProtocol')
        endpoint_suffix = config.get('EndpointSuffix')

        # Custom URLs
        endpoint = config.get(_CONNECTION_ENDPOINTS[service])
        endpoint_secondary = config.get(_CONNECTION_ENDPOINTS_SECONDARY[service])

        return _ServiceParameters(service,
                                  account_name=account_name,
                                  account_key=account_key,
                                  sas_token=sas_token,
                                  is_emulated=is_emulated,
                                  protocol=protocol,
                                  endpoint_suffix=endpoint_suffix,
                                  custom_domain=endpoint,
                                  custom_domain_secondary=endpoint_secondary)
github Azure / azure-storage-python / azure-storage-common / azure / storage / common / _connection.py View on Github external
def get_service_parameters(service, account_name=None, account_key=None, sas_token=None, token_credential= None,
                               is_emulated=None, protocol=None, endpoint_suffix=None, custom_domain=None,
                               request_session=None, connection_string=None, socket_timeout=None):
        if connection_string:
            params = _ServiceParameters._from_connection_string(connection_string, service)
        elif is_emulated:
            params = _ServiceParameters(service, is_emulated=True, custom_domain=custom_domain)
        elif account_name:
            if protocol.lower() != 'https' and token_credential is not None:
                raise ValueError("Token credential is only supported with HTTPS.")
            params = _ServiceParameters(service,
                                        account_name=account_name,
                                        account_key=account_key,
                                        sas_token=sas_token,
                                        token_credential=token_credential,
                                        is_emulated=is_emulated,
                                        protocol=protocol,
                                        endpoint_suffix=endpoint_suffix,
                                        custom_domain=custom_domain)
        else:
            raise ValueError(_ERROR_STORAGE_MISSING_INFO)
github Azure / azure-storage-python / azure-storage-common / azure / storage / common / _connection.py View on Github external
def get_service_parameters(service, account_name=None, account_key=None, sas_token=None, token_credential= None,
                               is_emulated=None, protocol=None, endpoint_suffix=None, custom_domain=None,
                               request_session=None, connection_string=None, socket_timeout=None):
        if connection_string:
            params = _ServiceParameters._from_connection_string(connection_string, service)
        elif is_emulated:
            params = _ServiceParameters(service, is_emulated=True, custom_domain=custom_domain)
        elif account_name:
            if protocol.lower() != 'https' and token_credential is not None:
                raise ValueError("Token credential is only supported with HTTPS.")
            params = _ServiceParameters(service,
                                        account_name=account_name,
                                        account_key=account_key,
                                        sas_token=sas_token,
                                        token_credential=token_credential,
                                        is_emulated=is_emulated,
                                        protocol=protocol,
                                        endpoint_suffix=endpoint_suffix,
                                        custom_domain=custom_domain)
        else:
            raise ValueError(_ERROR_STORAGE_MISSING_INFO)

        params.request_session = request_session

azure-storage-common

Microsoft Azure Storage Common Client Library for Python

MIT
Latest version published 5 years ago

Package Health Score

76 / 100
Full package analysis

Similar packages