Skip to main content

policy-compliance-for-jobs command group

note

This information applies to Databricks CLI versions 0.205 and above. The Databricks CLI is in Public Preview.

Databricks CLI use is subject to the Databricks License and Databricks Privacy Notice, including any Usage Data provisions.

The policy-compliance-for-jobs command group within the Databricks CLI contains commands to view and manage the policy compliance status of jobs in your workspace.

databricks policy-compliance-for-jobs enforce-compliance

Updates a job so the job clusters that are created when running the job (specified in new_cluster) are compliant with the current versions of their respective cluster policies. All-purpose clusters used in the job will not be updated.

databricks policy-compliance-for-jobs enforce-compliance JOB_ID [flags]

Arguments

JOB_ID

    The ID of the job you want to enforce policy compliance on.

Options

--json JSON

    The inline JSON string or the @path to the JSON file with the request body

--validate-only

    If set, previews changes made to the job to comply with its policy, but does not update the job.

Global flags

Examples

The following example enforces policy compliance on a job:

Bash
databricks policy-compliance-for-jobs enforce-compliance 123456

The following example previews the changes without updating the job:

Bash
databricks policy-compliance-for-jobs enforce-compliance 123456 --validate-only

The following example enforces compliance using JSON:

Bash
databricks policy-compliance-for-jobs enforce-compliance 123456 --json '{}'

databricks policy-compliance-for-jobs get-compliance

Returns the policy compliance status of a job. Jobs could be out of compliance if a cluster policy they use was updated after the job was last edited and some of its job clusters no longer comply with their updated policies.

databricks policy-compliance-for-jobs get-compliance JOB_ID [flags]

Arguments

JOB_ID

    The ID of the job whose compliance status you are requesting.

Options

Global flags

Examples

The following example gets the compliance status of a job:

Bash
databricks policy-compliance-for-jobs get-compliance 123456

databricks policy-compliance-for-jobs list-compliance

Returns the policy compliance status of all jobs that use a given policy. Jobs could be out of compliance if a cluster policy they use was updated after the job was last edited and its job clusters no longer comply with the updated policy.

important

Running this command concurrently 10 or more times could result in throttling, service degradation, or a temporary ban.

databricks policy-compliance-for-jobs list-compliance POLICY_ID [flags]

Arguments

POLICY_ID

    Canonical unique identifier for the cluster policy.

Options

--page-size int

    Maximum number of results to return per page.

--page-token string

    A page token that can be used to navigate to the next page or previous page as returned by next_page_token or prev_page_token.

Global flags

Examples

The following example lists compliance status for all jobs using a policy:

Bash
databricks policy-compliance-for-jobs list-compliance ABC123DEF456

The following example lists compliance with pagination:

Bash
databricks policy-compliance-for-jobs list-compliance ABC123DEF456 --page-size 10

Global flags

--debug

  Whether to enable debug logging.

-h or --help

    Display help for the Databricks CLI or the related command group or the related command.

--log-file string

    A string representing the file to write output logs to. If this flag is not specified then the default is to write output logs to stderr.

--log-format format

    The log format type, text or json. The default value is text.

--log-level string

    A string representing the log format level. If not specified then the log format level is disabled.

-o, --output type

    The command output type, text or json. The default value is text.

-p, --profile string

    The name of the profile in the ~/.databrickscfg file to use to run the command. If this flag is not specified then if it exists, the profile named DEFAULT is used.

--progress-format format

    The format to display progress logs: default, append, inplace, or json

-t, --target string

    If applicable, the bundle target to use