import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
databricks_oauth: {
type: "app",
app: "databricks_oauth",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://${this.databricks_oauth.$auth.deployment_name}.${this.databricks_oauth.$auth.domain}/api/2.0/clusters/list`,
headers: {
Authorization: `Bearer ${this.databricks_oauth.$auth.oauth_access_token}`,
},
})
},
})
Databricks (OAuth - Service Principal) uses OAuth authentication. When you connect your Databricks (OAuth - Service Principal) account, Pipedream will open a popup window where you can sign into Databricks (OAuth - Service Principal) and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Databricks (OAuth - Service Principal) API.
Pipedream requests the following authorization scopes when you connect your account:
all-apissqlPOSThttps://accounts.{{custom_fields.domain}}/oidc/accounts/{{custom_fields.account_id}}/v1/tokencontent-type: application/x-www-form-urlencodedaccept: application/jsongrant_type=client_credentials&scope={{oauth.comma_separated_scopes}}POSThttps://accounts.{{custom_fields.domain}}/oidc/accounts/{{custom_fields.account_id}}/v1/tokencontent-type: application/x-www-form-urlencodedaccept: application/jsongrant_type=client_credentials&scope={{oauth.comma_separated_scopes}}