@Generated public class PolicyComplianceForClustersAPI extends Object
A cluster is compliant with its policy if its configuration satisfies all its policy rules. Clusters could be out of compliance if their policy was updated after the cluster was last edited.
The get and list compliance APIs allow you to view the policy compliance status of a cluster. The enforce compliance API allows you to update a cluster to be compliant with the current version of its policy.
| Constructor and Description |
|---|
PolicyComplianceForClustersAPI(ApiClient apiClient)
Regular-use constructor
|
PolicyComplianceForClustersAPI(PolicyComplianceForClustersService mock)
Constructor for mocks
|
| Modifier and Type | Method and Description |
|---|---|
EnforceClusterComplianceResponse |
enforceCompliance(EnforceClusterComplianceRequest request)
Enforce cluster policy compliance.
|
EnforceClusterComplianceResponse |
enforceCompliance(String clusterId) |
GetClusterComplianceResponse |
getCompliance(GetClusterComplianceRequest request)
Get cluster policy compliance.
|
GetClusterComplianceResponse |
getCompliance(String clusterId) |
PolicyComplianceForClustersService |
impl() |
Iterable<ClusterCompliance> |
listCompliance(ListClusterCompliancesRequest request)
List cluster policy compliance.
|
Iterable<ClusterCompliance> |
listCompliance(String policyId) |
public PolicyComplianceForClustersAPI(ApiClient apiClient)
public PolicyComplianceForClustersAPI(PolicyComplianceForClustersService mock)
public EnforceClusterComplianceResponse enforceCompliance(String clusterId)
public EnforceClusterComplianceResponse enforceCompliance(EnforceClusterComplianceRequest request)
Updates a cluster to be compliant with the current version of its policy. A cluster can be updated if it is in a `RUNNING` or `TERMINATED` state.
If a cluster is updated while in a `RUNNING` state, it will be restarted so that the new attributes can take effect.
If a cluster is updated while in a `TERMINATED` state, it will remain `TERMINATED`. The next time the cluster is started, the new attributes will take effect.
Clusters created by the Databricks Jobs, DLT, or Models services cannot be enforced by this API. Instead, use the "Enforce job policy compliance" API to enforce policy compliance on jobs.
public GetClusterComplianceResponse getCompliance(String clusterId)
public GetClusterComplianceResponse getCompliance(GetClusterComplianceRequest request)
Returns the policy compliance status of a cluster. Clusters could be out of compliance if their policy was updated after the cluster was last edited.
public Iterable<ClusterCompliance> listCompliance(String policyId)
public Iterable<ClusterCompliance> listCompliance(ListClusterCompliancesRequest request)
Returns the policy compliance status of all clusters that use a given policy. Clusters could be out of compliance if their policy was updated after the cluster was last edited.
public PolicyComplianceForClustersService impl()
Copyright © 2025. All rights reserved.