policy_compliance_for_jobs
Creates, updates, deletes, gets or lists a policy_compliance_for_jobs resource.
Overview
| Name | policy_compliance_for_jobs |
| Type | Resource |
| Id | databricks_workspace.jobs.policy_compliance_for_jobs |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
is_compliant | boolean | |
violations | object | An object containing key-value mappings representing the first 200 policy validation errors. The keys indicate the path where the policy validation error is occurring. An identifier for the job cluster is prepended to the path. The values indicate an error message describing the policy validation error. |
| Name | Datatype | Description |
|---|---|---|
job_id | integer | |
is_compliant | boolean | Whether this job is in compliance with the latest version of its policy. |
violations | object | An object containing key-value mappings representing the first 200 policy validation errors. The keys indicate the path where the policy validation error is occurring. An identifier for the job cluster is prepended to the path. The values indicate an error message describing the policy validation error. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | job_id, deployment_name | Returns the policy compliance status of a job. Jobs could be out of compliance if a cluster policy | |
list | select | policy_id, deployment_name | page_size, page_token | Returns the policy compliance status of all jobs that use a given policy. Jobs could be out of |
enforce | insert | deployment_name, job_id | Updates a job so the job clusters that are created when running the job (specified in new_cluster) |
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.
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
job_id | integer | The ID of the job whose compliance status you are requesting. |
policy_id | string | Canonical unique identifier for the cluster policy. |
page_size | integer | Use this field to specify the maximum number of results to be returned by the server. The server may further constrain the maximum number of results returned in a single 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. |
SELECT examples
- get
- list
Returns the policy compliance status of a job. Jobs could be out of compliance if a cluster policy
SELECT
is_compliant,
violations
FROM databricks_workspace.jobs.policy_compliance_for_jobs
WHERE job_id = '{{ job_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;
Returns the policy compliance status of all jobs that use a given policy. Jobs could be out of
SELECT
job_id,
is_compliant,
violations
FROM databricks_workspace.jobs.policy_compliance_for_jobs
WHERE policy_id = '{{ policy_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;
INSERT examples
- enforce
- Manifest
Updates a job so the job clusters that are created when running the job (specified in new_cluster)
INSERT INTO databricks_workspace.jobs.policy_compliance_for_jobs (
job_id,
validate_only,
deployment_name
)
SELECT
{{ job_id }} /* required */,
{{ validate_only }},
'{{ deployment_name }}'
RETURNING
has_changes,
job_cluster_changes,
settings
;
# Description fields are for documentation purposes
- name: policy_compliance_for_jobs
props:
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the policy_compliance_for_jobs resource.
- name: job_id
value: {{ job_id }}
description: |
The ID of the job you want to enforce policy compliance on.
- name: validate_only
value: {{ validate_only }}
description: |
If set, previews changes made to the job to comply with its policy, but does not update the job.