Skip to main content

consumer_installations

Creates, updates, deletes, gets or lists a consumer_installations resource.

Overview​

Nameconsumer_installations
TypeResource
Iddatabricks_workspace.marketplace.consumer_installations

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring
listing_idstring
catalog_namestring
listing_namestring
repo_namestring
share_namestring
error_messagestring
installed_oninteger
recipient_typestringCreate a collection of name/value pairs.<br /><br />Example enumeration:<br /><br />&gt;&gt;&gt; class Color(Enum):<br />... RED = 1<br />... BLUE = 2<br />... GREEN = 3<br /><br />Access them by:<br /><br />- attribute access:<br /><br /> &gt;&gt;&gt; Color.RED<br /> &lt;Color.RED: 1&gt;<br /><br />- value lookup:<br /><br /> &gt;&gt;&gt; Color(1)<br /> &lt;Color.RED: 1&gt;<br /><br />- name lookup:<br /><br /> &gt;&gt;&gt; Color['RED']<br /> &lt;Color.RED: 1&gt;<br /><br />Enumerations can be iterated over, and know how many members they have:<br /><br />&gt;&gt;&gt; len(Color)<br />3<br /><br />&gt;&gt;&gt; list(Color)<br />[&lt;Color.RED: 1&gt;, &lt;Color.BLUE: 2&gt;, &lt;Color.GREEN: 3&gt;]<br /><br />Methods can be added to enumerations, and members can have their own<br />attributes -- see the documentation for details. (DELTA_SHARING_RECIPIENT_TYPE_DATABRICKS, DELTA_SHARING_RECIPIENT_TYPE_OPEN)
repo_pathstring
statusstringCreate a collection of name/value pairs.<br /><br />Example enumeration:<br /><br />&gt;&gt;&gt; class Color(Enum):<br />... RED = 1<br />... BLUE = 2<br />... GREEN = 3<br /><br />Access them by:<br /><br />- attribute access:<br /><br /> &gt;&gt;&gt; Color.RED<br /> &lt;Color.RED: 1&gt;<br /><br />- value lookup:<br /><br /> &gt;&gt;&gt; Color(1)<br /> &lt;Color.RED: 1&gt;<br /><br />- name lookup:<br /><br /> &gt;&gt;&gt; Color['RED']<br /> &lt;Color.RED: 1&gt;<br /><br />Enumerations can be iterated over, and know how many members they have:<br /><br />&gt;&gt;&gt; len(Color)<br />3<br /><br />&gt;&gt;&gt; list(Color)<br />[&lt;Color.RED: 1&gt;, &lt;Color.BLUE: 2&gt;, &lt;Color.GREEN: 3&gt;]<br /><br />Methods can be added to enumerations, and members can have their own<br />attributes -- see the documentation for details. (FAILED, INSTALLED)
â–¶token_detailobject
â–¶tokensarray

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_for_listingselectlisting_id, deployment_name, workspace_domainpage_size, page_tokenList all installations for a particular listing.
listselectdeployment_name, workspace_domainpage_size, page_tokenList all installations across all listings.
createinsertlisting_id, deployment_name, workspace_domainInstall payload associated with a Databricks Marketplace listing.
updatereplacelisting_id, installation_id, deployment_name, workspace_domain, installationThis is a update API that will update the part of the fields defined in the installation table as well
deletedeletelisting_id, installation_id, deployment_name, workspace_domainUninstall an installation associated with a Databricks Marketplace listing.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
deployment_namestringThe Databricks workspace deployment name: the host prefix of the workspace URL (dbc-abcd0123-a1bc on AWS, adb-1234567890123456.7 on Azure, 1234567890123456.7 on GCP). Set DATABRICKS_DEPLOYMENT_NAME to default it for the session. (default: dbc-abcd0123-a1bc, x-stackQL-envVar: DATABRICKS_DEPLOYMENT_NAME)
installation_idstring
listing_idstring
workspace_domainstringThe Databricks workspace domain suffix for the cloud. Selected by DATABRICKS_CLOUD (aws, azure or gcp; default aws). (default: cloud.databricks.com, x-stackQL-envVarSelector: {"envVar":"DATABRICKS_CLOUD","default":"aws","values":{"aws":"cloud.databricks.com","azure":"azuredatabricks.net","gcp":"gcp.databricks.com"}})
page_sizeinteger
page_tokenstring

SELECT examples​

List all installations for a particular listing.

SELECT
id,
listing_id,
catalog_name,
listing_name,
repo_name,
share_name,
error_message,
installed_on,
recipient_type,
repo_path,
status,
token_detail,
tokens
FROM databricks_workspace.marketplace.consumer_installations
WHERE listing_id = '{{ listing_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND workspace_domain = '{{ workspace_domain }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;

INSERT examples​

Install payload associated with a Databricks Marketplace listing.

INSERT INTO databricks_workspace.marketplace.consumer_installations (
accepted_consumer_terms,
catalog_name,
recipient_type,
repo_detail,
share_name,
listing_id,
deployment_name,
workspace_domain
)
SELECT
'{{ accepted_consumer_terms }}',
'{{ catalog_name }}',
'{{ recipient_type }}',
'{{ repo_detail }}',
'{{ share_name }}',
'{{ listing_id }}',
'{{ deployment_name }}',
'{{ workspace_domain }}'
RETURNING
installation
;

REPLACE examples​

This is a update API that will update the part of the fields defined in the installation table as well

REPLACE databricks_workspace.marketplace.consumer_installations
SET
installation = '{{ installation }}',
rotate_token = {{ rotate_token }}
WHERE
listing_id = '{{ listing_id }}' --required
AND installation_id = '{{ installation_id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND workspace_domain = '{{ workspace_domain }}' --required
AND installation = '{{ installation }}' --required
RETURNING
installation;

DELETE examples​

Uninstall an installation associated with a Databricks Marketplace listing.

DELETE FROM databricks_workspace.marketplace.consumer_installations
WHERE listing_id = '{{ listing_id }}' --required
AND installation_id = '{{ installation_id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND workspace_domain = '{{ workspace_domain }}' --required
;