azure.mgmt.policyinsights.models module

exception azure.mgmt.policyinsights.models.ErrorResponseException(deserialize, response, *args)[source]

Bases: msrest.exceptions.HttpOperationError

Server responsed with exception of type: ‘ErrorResponse’.

Parameters
  • deserialize – A deserializer

  • response – Server response to be deserialized.

exception azure.mgmt.policyinsights.models.QueryFailureException(deserialize, response, *args)[source]

Bases: msrest.exceptions.HttpOperationError

Server responsed with exception of type: ‘QueryFailure’.

Parameters
  • deserialize – A deserializer

  • response – Server response to be deserialized.

class azure.mgmt.policyinsights.models.ComplianceDetail(*, compliance_state: str = None, count: int = None, **kwargs)[source]

Bases: msrest.serialization.Model

The compliance state rollup.

Parameters
  • compliance_state (str) – The compliance state.

  • count (int) – Summarized count value for this compliance state.

class azure.mgmt.policyinsights.models.ErrorDefinition(**kwargs)[source]

Bases: msrest.serialization.Model

Error definition.

Variables are only populated by the server, and will be ignored when sending a request.

Variables
  • code (str) – Service specific error code which serves as the substatus for the HTTP error code.

  • message (str) – Description of the error.

  • target (str) – The target of the error.

  • details (list[ErrorDefinition]) – Internal error details.

  • additional_info (list[TypedErrorInfo]) – Additional scenario specific error details.

class azure.mgmt.policyinsights.models.ErrorResponse(*, error=None, **kwargs)[source]

Bases: msrest.serialization.Model

Error response.

Parameters

error (ErrorDefinition) – The error details.

class azure.mgmt.policyinsights.models.ExpressionEvaluationDetails(*, result: str = None, expression: str = None, path: str = None, expression_value=None, target_value=None, operator: str = None, **kwargs)[source]

Bases: msrest.serialization.Model

Evaluation details of policy language expressions.

Parameters
  • result (str) – Evaluation result.

  • expression (str) – Expression evaluated.

  • path (str) – Property path if the expression is a field or an alias.

  • expression_value (object) – Value of the expression.

  • target_value (object) – Target value to be compared with the expression value.

  • operator (str) – Operator to compare the expression value and the target value.

class azure.mgmt.policyinsights.models.IfNotExistsEvaluationDetails(*, resource_id: str = None, total_resources: int = None, **kwargs)[source]

Bases: msrest.serialization.Model

Evaluation details of IfNotExists effect.

Parameters
  • resource_id (str) – ID of the last evaluated resource for IfNotExists effect.

  • total_resources (int) – Total number of resources to which the existence condition is applicable.

class azure.mgmt.policyinsights.models.Operation(*, name: str = None, display=None, **kwargs)[source]

Bases: msrest.serialization.Model

Operation definition.

Parameters
  • name (str) – Operation name.

  • display (OperationDisplay) – Display metadata associated with the operation.

class azure.mgmt.policyinsights.models.OperationDisplay(*, provider: str = None, resource: str = None, operation: str = None, description: str = None, **kwargs)[source]

Bases: msrest.serialization.Model

Display metadata associated with the operation.

Parameters
  • provider (str) – Resource provider name.

  • resource (str) – Resource name on which the operation is performed.

  • operation (str) – Operation name.

  • description (str) – Operation description.

class azure.mgmt.policyinsights.models.OperationsListResults(*, odatacount: int = None, value=None, **kwargs)[source]

Bases: msrest.serialization.Model

List of available operations.

Parameters
  • odatacount (int) – OData entity count; represents the number of operations returned.

  • value (list[Operation]) – List of available operations.

class azure.mgmt.policyinsights.models.PolicyAssignmentSummary(*, policy_assignment_id: str = None, policy_set_definition_id: str = None, results=None, policy_definitions=None, policy_groups=None, **kwargs)[source]

Bases: msrest.serialization.Model

Policy assignment summary.

Parameters
  • policy_assignment_id (str) – Policy assignment ID.

  • policy_set_definition_id (str) – Policy set definition ID, if the policy assignment is for a policy set.

  • results (SummaryResults) – Compliance summary for the policy assignment.

  • policy_definitions (list[PolicyDefinitionSummary]) – Policy definitions summary.

  • policy_groups (list[PolicyGroupSummary]) – Policy definition group summary.

class azure.mgmt.policyinsights.models.PolicyDefinitionSummary(*, policy_definition_id: str = None, policy_definition_reference_id: str = None, policy_definition_group_names=None, effect: str = None, results=None, **kwargs)[source]

Bases: msrest.serialization.Model

Policy definition summary.

Parameters
  • policy_definition_id (str) – Policy definition ID.

  • policy_definition_reference_id (str) – Policy definition reference ID.

  • policy_definition_group_names (list[str]) – Policy definition group names.

  • effect (str) – Policy effect, i.e. policy definition action.

  • results (SummaryResults) – Compliance summary for the policy definition.

class azure.mgmt.policyinsights.models.PolicyDetails(**kwargs)[source]

Bases: msrest.serialization.Model

The policy details.

Variables are only populated by the server, and will be ignored when sending a request.

Variables
  • policy_definition_id (str) – The ID of the policy definition.

  • policy_assignment_id (str) – The ID of the policy assignment.

  • policy_assignment_display_name (str) – The display name of the policy assignment.

  • policy_assignment_scope (str) – The scope of the policy assignment.

  • policy_set_definition_id (str) – The ID of the policy set definition.

  • policy_definition_reference_id (str) – The policy definition reference ID within the policy set definition.

class azure.mgmt.policyinsights.models.PolicyEvaluationDetails(*, evaluated_expressions=None, if_not_exists_details=None, **kwargs)[source]

Bases: msrest.serialization.Model

Policy evaluation details.

Parameters
class azure.mgmt.policyinsights.models.PolicyEvent(*, additional_properties=None, odataid: str = None, odatacontext: str = None, timestamp=None, resource_id: str = None, policy_assignment_id: str = None, policy_definition_id: str = None, effective_parameters: str = None, is_compliant: bool = None, subscription_id: str = None, resource_type: str = None, resource_location: str = None, resource_group: str = None, resource_tags: str = None, policy_assignment_name: str = None, policy_assignment_owner: str = None, policy_assignment_parameters: str = None, policy_assignment_scope: str = None, policy_definition_name: str = None, policy_definition_action: str = None, policy_definition_category: str = None, policy_set_definition_id: str = None, policy_set_definition_name: str = None, policy_set_definition_owner: str = None, policy_set_definition_category: str = None, policy_set_definition_parameters: str = None, management_group_ids: str = None, policy_definition_reference_id: str = None, tenant_id: str = None, principal_oid: str = None, **kwargs)[source]

Bases: msrest.serialization.Model

Policy event record.

Parameters
  • additional_properties (dict[str, object]) – Unmatched properties from the message are deserialized this collection

  • odataid (str) – OData entity ID; always set to null since policy event records do not have an entity ID.

  • odatacontext (str) – OData context string; used by OData clients to resolve type information based on metadata.

  • timestamp (datetime) – Timestamp for the policy event record.

  • resource_id (str) – Resource ID.

  • policy_assignment_id (str) – Policy assignment ID.

  • policy_definition_id (str) – Policy definition ID.

  • effective_parameters (str) – Effective parameters for the policy assignment.

  • is_compliant (bool) – Flag which states whether the resource is compliant against the policy assignment it was evaluated against.

  • subscription_id (str) – Subscription ID.

  • resource_type (str) – Resource type.

  • resource_location (str) – Resource location.

  • resource_group (str) – Resource group name.

  • resource_tags (str) – List of resource tags.

  • policy_assignment_name (str) – Policy assignment name.

  • policy_assignment_owner (str) – Policy assignment owner.

  • policy_assignment_parameters (str) – Policy assignment parameters.

  • policy_assignment_scope (str) – Policy assignment scope.

  • policy_definition_name (str) – Policy definition name.

  • policy_definition_action (str) – Policy definition action, i.e. effect.

  • policy_definition_category (str) – Policy definition category.

  • policy_set_definition_id (str) – Policy set definition ID, if the policy assignment is for a policy set.

  • policy_set_definition_name (str) – Policy set definition name, if the policy assignment is for a policy set.

  • policy_set_definition_owner (str) – Policy set definition owner, if the policy assignment is for a policy set.

  • policy_set_definition_category (str) – Policy set definition category, if the policy assignment is for a policy set.

  • policy_set_definition_parameters (str) – Policy set definition parameters, if the policy assignment is for a policy set.

  • management_group_ids (str) – Comma separated list of management group IDs, which represent the hierarchy of the management groups the resource is under.

  • policy_definition_reference_id (str) – Reference ID for the policy definition inside the policy set, if the policy assignment is for a policy set.

  • tenant_id (str) – Tenant ID for the policy event record.

  • principal_oid (str) – Principal object ID for the user who initiated the resource operation that triggered the policy event.

class azure.mgmt.policyinsights.models.PolicyEventsQueryResults(*, odatacontext: str = None, odatacount: int = None, value=None, **kwargs)[source]

Bases: msrest.serialization.Model

Query results.

Parameters
  • odatacontext (str) – OData context string; used by OData clients to resolve type information based on metadata.

  • odatacount (int) – OData entity count; represents the number of policy event records returned.

  • value (list[PolicyEvent]) – Query results.

class azure.mgmt.policyinsights.models.PolicyGroupSummary(*, policy_group_name: str = None, results=None, **kwargs)[source]

Bases: msrest.serialization.Model

Policy definition group summary.

Parameters
  • policy_group_name (str) – Policy group name.

  • results (SummaryResults) – Compliance summary for the policy definition group.

class azure.mgmt.policyinsights.models.PolicyMetadata(**kwargs)[source]

Bases: msrest.serialization.Model

Policy metadata resource definition.

Variables are only populated by the server, and will be ignored when sending a request.

Variables
  • metadata_id (str) – The policy metadata identifier.

  • category (str) – The category of the policy metadata.

  • title (str) – The title of the policy metadata.

  • owner (str) – The owner of the policy metadata.

  • additional_content_url (str) – Url for getting additional content about the resource metadata.

  • metadata (object) – Additional metadata.

  • description (str) – The description of the policy metadata.

  • requirements (str) – The requirements of the policy metadata.

  • id (str) – The ID of the policy metadata.

  • type (str) – The type of the policy metadata.

  • name (str) – The name of the policy metadata.

class azure.mgmt.policyinsights.models.PolicyState(*, additional_properties=None, odataid: str = None, odatacontext: str = None, timestamp=None, resource_id: str = None, policy_assignment_id: str = None, policy_definition_id: str = None, effective_parameters: str = None, is_compliant: bool = None, subscription_id: str = None, resource_type: str = None, resource_location: str = None, resource_group: str = None, resource_tags: str = None, policy_assignment_name: str = None, policy_assignment_owner: str = None, policy_assignment_parameters: str = None, policy_assignment_scope: str = None, policy_definition_name: str = None, policy_definition_action: str = None, policy_definition_category: str = None, policy_set_definition_id: str = None, policy_set_definition_name: str = None, policy_set_definition_owner: str = None, policy_set_definition_category: str = None, policy_set_definition_parameters: str = None, management_group_ids: str = None, policy_definition_reference_id: str = None, compliance_state: str = None, policy_evaluation_details=None, policy_definition_group_names=None, **kwargs)[source]

Bases: msrest.serialization.Model

Policy state record.

Variables are only populated by the server, and will be ignored when sending a request.

Parameters
  • additional_properties (dict[str, object]) – Unmatched properties from the message are deserialized this collection

  • odataid (str) – OData entity ID; always set to null since policy state records do not have an entity ID.

  • odatacontext (str) – OData context string; used by OData clients to resolve type information based on metadata.

  • timestamp (datetime) – Timestamp for the policy state record.

  • resource_id (str) – Resource ID.

  • policy_assignment_id (str) – Policy assignment ID.

  • policy_definition_id (str) – Policy definition ID.

  • effective_parameters (str) – Effective parameters for the policy assignment.

  • is_compliant (bool) – Flag which states whether the resource is compliant against the policy assignment it was evaluated against. This property is deprecated; please use ComplianceState instead.

  • subscription_id (str) – Subscription ID.

  • resource_type (str) – Resource type.

  • resource_location (str) – Resource location.

  • resource_group (str) – Resource group name.

  • resource_tags (str) – List of resource tags.

  • policy_assignment_name (str) – Policy assignment name.

  • policy_assignment_owner (str) – Policy assignment owner.

  • policy_assignment_parameters (str) – Policy assignment parameters.

  • policy_assignment_scope (str) – Policy assignment scope.

  • policy_definition_name (str) – Policy definition name.

  • policy_definition_action (str) – Policy definition action, i.e. effect.

  • policy_definition_category (str) – Policy definition category.

  • policy_set_definition_id (str) – Policy set definition ID, if the policy assignment is for a policy set.

  • policy_set_definition_name (str) – Policy set definition name, if the policy assignment is for a policy set.

  • policy_set_definition_owner (str) – Policy set definition owner, if the policy assignment is for a policy set.

  • policy_set_definition_category (str) – Policy set definition category, if the policy assignment is for a policy set.

  • policy_set_definition_parameters (str) – Policy set definition parameters, if the policy assignment is for a policy set.

  • management_group_ids (str) – Comma separated list of management group IDs, which represent the hierarchy of the management groups the resource is under.

  • policy_definition_reference_id (str) – Reference ID for the policy definition inside the policy set, if the policy assignment is for a policy set.

  • compliance_state (str) – Compliance state of the resource.

  • policy_evaluation_details (PolicyEvaluationDetails) – Policy evaluation details.

  • policy_definition_group_names (list[str]) – Policy definition group names.

Variables
  • policy_definition_version (str) – Evaluated policy definition version.

  • policy_set_definition_version (str) – Evaluated policy set definition version.

  • policy_assignment_version (str) – Evaluated policy assignment version.

class azure.mgmt.policyinsights.models.PolicyStatesQueryResults(*, odatacontext: str = None, odatacount: int = None, value=None, **kwargs)[source]

Bases: msrest.serialization.Model

Query results.

Parameters
  • odatacontext (str) – OData context string; used by OData clients to resolve type information based on metadata.

  • odatacount (int) – OData entity count; represents the number of policy state records returned.

  • value (list[PolicyState]) – Query results.

class azure.mgmt.policyinsights.models.PolicyTrackedResource(**kwargs)[source]

Bases: msrest.serialization.Model

Policy tracked resource record.

Variables are only populated by the server, and will be ignored when sending a request.

Variables
  • tracked_resource_id (str) – The ID of the policy tracked resource.

  • policy_details (PolicyDetails) – The details of the policy that require the tracked resource.

  • created_by (TrackedResourceModificationDetails) – The details of the policy triggered deployment that created the tracked resource.

  • last_modified_by (TrackedResourceModificationDetails) – The details of the policy triggered deployment that modified the tracked resource.

  • last_update_utc (datetime) – Timestamp of the last update to the tracked resource.

class azure.mgmt.policyinsights.models.QueryFailure(*, error=None, **kwargs)[source]

Bases: msrest.serialization.Model

Error response.

Parameters

error (QueryFailureError) – Error definition.

class azure.mgmt.policyinsights.models.QueryFailureError(**kwargs)[source]

Bases: msrest.serialization.Model

Error definition.

Variables are only populated by the server, and will be ignored when sending a request.

Variables
  • code (str) – Service specific error code which serves as the substatus for the HTTP error code.

  • message (str) – Description of the error.

class azure.mgmt.policyinsights.models.QueryOptions(*, top: int = None, filter: str = None, order_by: str = None, select: str = None, from_property=None, to=None, apply: str = None, expand: str = None, **kwargs)[source]

Bases: msrest.serialization.Model

Additional parameters for a set of operations.

Parameters
  • top (int) – Maximum number of records to return.

  • filter (str) – OData filter expression.

  • order_by (str) – Ordering expression using OData notation. One or more comma-separated column names with an optional “desc” (the default) or “asc”, e.g. “$orderby=PolicyAssignmentId, ResourceId asc”.

  • select (str) – Select expression using OData notation. Limits the columns on each record to just those requested, e.g. “$select=PolicyAssignmentId, ResourceId”.

  • from_property (datetime) – ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, the service uses ($to - 1-day).

  • to (datetime) – ISO 8601 formatted timestamp specifying the end time of the interval to query. When not specified, the service uses request time.

  • apply (str) – OData apply expression for aggregations.

  • expand (str) – The $expand query parameter. For example, to expand policyEvaluationDetails, use $expand=policyEvaluationDetails

class azure.mgmt.policyinsights.models.Remediation(*, policy_assignment_id: str = None, policy_definition_reference_id: str = None, resource_discovery_mode=None, filters=None, **kwargs)[source]

Bases: msrest.serialization.Model

The remediation definition.

Variables are only populated by the server, and will be ignored when sending a request.

Parameters
  • policy_assignment_id (str) – The resource ID of the policy assignment that should be remediated.

  • policy_definition_reference_id (str) – The policy definition reference ID of the individual definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.

  • resource_discovery_mode (str or ResourceDiscoveryMode) – The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified. Possible values include: ‘ExistingNonCompliant’, ‘ReEvaluateCompliance’

  • filters (RemediationFilters) – The filters that will be applied to determine which resources to remediate.

Variables
  • provisioning_state (str) – The status of the remediation.

  • created_on (datetime) – The time at which the remediation was created.

  • last_updated_on (datetime) – The time at which the remediation was last updated.

  • deployment_status (RemediationDeploymentSummary) – The deployment status summary for all deployments created by the remediation.

  • id (str) – The ID of the remediation.

  • type (str) – The type of the remediation.

  • name (str) – The name of the remediation.

class azure.mgmt.policyinsights.models.RemediationDeployment(**kwargs)[source]

Bases: msrest.serialization.Model

Details of a single deployment created by the remediation.

Variables are only populated by the server, and will be ignored when sending a request.

Variables
  • remediated_resource_id (str) – Resource ID of the resource that is being remediated by the deployment.

  • deployment_id (str) – Resource ID of the template deployment that will remediate the resource.

  • status (str) – Status of the remediation deployment.

  • resource_location (str) – Location of the resource that is being remediated.

  • error (ErrorDefinition) – Error encountered while remediated the resource.

  • created_on (datetime) – The time at which the remediation was created.

  • last_updated_on (datetime) – The time at which the remediation deployment was last updated.

class azure.mgmt.policyinsights.models.RemediationDeploymentSummary(**kwargs)[source]

Bases: msrest.serialization.Model

The deployment status summary for all deployments created by the remediation.

Variables are only populated by the server, and will be ignored when sending a request.

Variables
  • total_deployments (int) – The number of deployments required by the remediation.

  • successful_deployments (int) – The number of deployments required by the remediation that have succeeded.

  • failed_deployments (int) – The number of deployments required by the remediation that have failed.

class azure.mgmt.policyinsights.models.RemediationFilters(*, locations=None, **kwargs)[source]

Bases: msrest.serialization.Model

The filters that will be applied to determine which resources to remediate.

Parameters

locations (list[str]) – The resource locations that will be remediated.

class azure.mgmt.policyinsights.models.SlimPolicyMetadata(**kwargs)[source]

Bases: msrest.serialization.Model

Slim version of policy metadata resource definition, excluding properties with large strings.

Variables are only populated by the server, and will be ignored when sending a request.

Variables
  • metadata_id (str) – The policy metadata identifier.

  • category (str) – The category of the policy metadata.

  • title (str) – The title of the policy metadata.

  • owner (str) – The owner of the policy metadata.

  • additional_content_url (str) – Url for getting additional content about the resource metadata.

  • metadata (object) – Additional metadata.

  • id (str) – The ID of the policy metadata.

  • type (str) – The type of the policy metadata.

  • name (str) – The name of the policy metadata.

class azure.mgmt.policyinsights.models.SummarizeResults(*, odatacontext: str = None, odatacount: int = None, value=None, **kwargs)[source]

Bases: msrest.serialization.Model

Summarize action results.

Parameters
  • odatacontext (str) – OData context string; used by OData clients to resolve type information based on metadata.

  • odatacount (int) – OData entity count; represents the number of summaries returned; always set to 1.

  • value (list[Summary]) – Summarize action results.

class azure.mgmt.policyinsights.models.Summary(*, odataid: str = None, odatacontext: str = None, results=None, policy_assignments=None, **kwargs)[source]

Bases: msrest.serialization.Model

Summary results.

Parameters
  • odataid (str) – OData entity ID; always set to null since summaries do not have an entity ID.

  • odatacontext (str) – OData context string; used by OData clients to resolve type information based on metadata.

  • results (SummaryResults) – Compliance summary for all policy assignments.

  • policy_assignments (list[PolicyAssignmentSummary]) – Policy assignments summary.

class azure.mgmt.policyinsights.models.SummaryResults(*, query_results_uri: str = None, non_compliant_resources: int = None, non_compliant_policies: int = None, resource_details=None, policy_details=None, policy_group_details=None, **kwargs)[source]

Bases: msrest.serialization.Model

Compliance summary on a particular summary level.

Parameters
  • query_results_uri (str) – HTTP POST URI for queryResults action on Microsoft.PolicyInsights to retrieve raw results for the compliance summary. This property will not be available by default in future API versions, but could be queried explicitly.

  • non_compliant_resources (int) – Number of non-compliant resources.

  • non_compliant_policies (int) – Number of non-compliant policies.

  • resource_details (list[ComplianceDetail]) – The resources summary at this level.

  • policy_details (list[ComplianceDetail]) – The policy artifact summary at this level. For query scope level, it represents policy assignment summary. For policy assignment level, it represents policy definitions summary.

  • policy_group_details (list[ComplianceDetail]) – The policy definition group summary at this level.

class azure.mgmt.policyinsights.models.TrackedResourceModificationDetails(**kwargs)[source]

Bases: msrest.serialization.Model

The details of the policy triggered deployment that created or modified the tracked resource.

Variables are only populated by the server, and will be ignored when sending a request.

Variables
  • policy_details (PolicyDetails) – The details of the policy that created or modified the tracked resource.

  • deployment_id (str) – The ID of the deployment that created or modified the tracked resource.

  • deployment_time (datetime) – Timestamp of the deployment that created or modified the tracked resource.

class azure.mgmt.policyinsights.models.TypedErrorInfo(**kwargs)[source]

Bases: msrest.serialization.Model

Scenario specific error details.

Variables are only populated by the server, and will be ignored when sending a request.

Variables
  • type (str) – The type of included error details.

  • info (object) – The scenario specific error details.

class azure.mgmt.policyinsights.models.PolicyTrackedResourcePaged(*args, **kwargs)[source]

Bases: msrest.paging.Paged

A paging container for iterating over a list of PolicyTrackedResource object

Bring async to Paging.

“async_command” is mandatory keyword argument for this mixin to work.

class azure.mgmt.policyinsights.models.RemediationDeploymentPaged(*args, **kwargs)[source]

Bases: msrest.paging.Paged

A paging container for iterating over a list of RemediationDeployment object

Bring async to Paging.

“async_command” is mandatory keyword argument for this mixin to work.

class azure.mgmt.policyinsights.models.RemediationPaged(*args, **kwargs)[source]

Bases: msrest.paging.Paged

A paging container for iterating over a list of Remediation object

Bring async to Paging.

“async_command” is mandatory keyword argument for this mixin to work.

class azure.mgmt.policyinsights.models.SlimPolicyMetadataPaged(*args, **kwargs)[source]

Bases: msrest.paging.Paged

A paging container for iterating over a list of SlimPolicyMetadata object

Bring async to Paging.

“async_command” is mandatory keyword argument for this mixin to work.

class azure.mgmt.policyinsights.models.ResourceDiscoveryMode[source]

Bases: str, enum.Enum

An enumeration.

existing_non_compliant = 'ExistingNonCompliant'

Remediate resources that are already known to be non-compliant.

re_evaluate_compliance = 'ReEvaluateCompliance'

Re-evaluate the compliance state of resources and then remediate the resources found to be non-compliant.

class azure.mgmt.policyinsights.models.PolicyStatesResource[source]

Bases: str, enum.Enum

An enumeration.

default = 'default'
latest = 'latest'