das package
Subpackages
- das.helpers package
- das.iot_client package
- Subpackages
- das.iot_client.interfaces package
- Submodules
- das.iot_client.interfaces.assets_client module
- das.iot_client.interfaces.commands_client module
- das.iot_client.interfaces.credentials_client module
- das.iot_client.interfaces.data_client module
- das.iot_client.interfaces.devices_client module
- das.iot_client.interfaces.events_client module
- das.iot_client.interfaces.models_client module
- das.iot_client.interfaces.organizations_client module
- Module contents
- das.iot_client.interfaces package
- Submodules
- das.iot_client.client module
- Module contents
- Subpackages
Submodules
das.credential module
- class das.credential.AzureDatabricksCredential
Bases:
_AzureBaseCredentialCredential for Azure Databricks REST API using Service Principal.
Methods
get_headers()get_headers method
- class das.credential.AzureFunctionCredential
Bases:
_AzureBaseCredentialCredential for invoking functions in Azure Functions using Service Principal.
Methods
get_headers()get_headers method
- class das.credential.BearerToken(token)
Bases:
_BaseTokenToken for Bearer-type Authorization header.
Returned header example: Authorization: Bearer some-token-here
Methods
Implement this method in inherited classes.
- get_headers()
Implement this method in inherited classes.
- class das.credential.FunctionToken(token)
Bases:
_BaseTokenToken to be used with (e.g.) Azure Functions application and function key.
Get token from configured function-app and paste it in initialization,
Returned header example: x-functions-key: some-token-here
Methods
Implement this method in inherited classes.
- get_headers()
Implement this method in inherited classes.
das.databricks_client module
- class das.databricks_client.DatabricksClient(host=None, token=None, config_name='config.ini')
Bases:
DatabricksAPIDatabricks API client wrapper that initializes the client with endpoint and credentials.
- Attributes
Methods
get_ad_token(config_name)Login to Databricks API using Azure client credentials.
- property api_token
Databricks API personal access token or compatible OAuth2 access token.
- get_ad_token(config_name)
Login to Databricks API using Azure client credentials.
- Parameters
- config_namestr
Optional parameter to tell the file name of the config file.
- property host
Base URL of the Databricks API.
das.functions_client module
- class das.functions_client.AzureFunctionsClient(client_id=None, client_secret=None, tenant_id=None, subscription_id=None, resource_group=None, function_app=None, config_name='config.ini')
Bases:
objectLite client for Azure Functions (function-app) API calls.
Methods
get_function(function_name[, ...])- Parameters
list_functions([resource_group, function_app])Get information of functions in a function app in Azure.
login([client_id, client_secret, scope])Authenticate to Azure.
logout()Logout from Azure.
- get_function(function_name, resource_group=None, function_app=None)
- Parameters
- function_namestr
The function name to get the information of.
- resource_groupstr
Name of the resource group to which the resource belongs. Can be given in the initialization of this class, but can be overridden with this parameter.
- function_appstr
Name of the function app that the function belongs to. Can be given in the initialization of this class, but can be overridden with this parameter.
- Returns
- dict
Function information in json form.
- Raises
- HTTPError
If request was errored. Raised by response.raise_for_status()
- list_functions(resource_group=None, function_app=None)
Get information of functions in a function app in Azure.
- Parameters
- resource_groupstr
Name of the resource group to which the resource belongs. Can be given in the initialization of this class, but can be overridden with this parameter.
- function_appstr
Name of the function app that the function belongs to. Can be given in the initialization of this class, but can be overridden with this parameter.
- Returns
- dict
Function information in json form.
- Raises
- HTTPError
If request was errored. Raised by response.raise_for_status().
- login(client_id=None, client_secret=None, scope=None)
Authenticate to Azure. This must be called if user is not in an environment where the authentication can be done automatically so that the environment variables are set.
- Parameters
- client_idstr
- client_secretstr
Azure client credentials.
- scopestr
Optional scope for the authentication. If not given, the default scope will be used.
- logout()
Logout from Azure.