View source: R/create_execution_context.R
create_execution_context | R Documentation |
This function provides the context for executing remote commands on an existing
Databricks cluster via REST API. The output is intended to be passed to
databricks_execute
.
create_execution_context( workspace, cluster_id, language = "r", token = NULL, verbose = F )
workspace |
A string representing the web workspace of your Databricks instance. E.g., "https://eastus2.azuredatabricks.net" or "https://demo.cloud.databricks.com". |
cluster_id |
A string containing the ID of an active Databricks cluster. |
language |
The language to execute commands in. The default is 'r', but can also be set to 'python', 'scala' and 'sql'. |
token |
A valid authentication token generated via User Settings in Databricks or via the Databricks REST API 2.0. If none is provided, netrc will be used. |
verbose |
If true, will pretty print the success or failure of the request. Defaults to FALSE. |
The API endpoint for creating the execution context is is '1.2/contexts/create'. For all details on API calls please see the official documentation at https://docs.databricks.com/dev-tools/api/latest/.
A list with five elements:
language - The language to execute commands in.
cluster_id - ID of the active Databricks cluster.
context_id - ID of the execution context on the cluster.
workspace - The URL of the Databricks workspace.
token - The token used to authenticate.
# Using netrc context <- create_execution_context(workspace = "https://eastus2.azuredatabricks.net", language = "r", cluster_id = "1017-337483-jars232") ## Use the context to execute a command on Databricks command <- "iris[1, ]" databricks_execute(command, context)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.