discovery_rules
Creates, updates, deletes, gets or lists a discovery_rules resource.
Overview
| Name | discovery_rules |
| Type | Resource |
| Id | azure.cloud_health.discovery_rules |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_health_model
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
addRecommendedSignals | string | Whether to add all recommended signals to the discovered entities. Required. Known values are: "Enabled" and "Disabled". (Enabled, Disabled) |
authenticationSetting | string | Reference to the name of the authentication setting which is used for querying Azure Resource Graph. The same authentication setting will also be assigned to any discovered entities. Required. |
discoverRelationships | string | Whether to create relationships between the discovered entities based on a set of built-in rules. These relationships cannot be manually deleted. Required. Known values are: "Enabled" and "Disabled". (Enabled, Disabled) |
displayName | string | Display name. |
entityName | string | Name of the entity which represents the discovery rule. Note: It might take a few minutes after creating the discovery rule until the entity is created. Required. |
error | object | Error details if the last discovery operation failed. |
provisioningState | string | The status of the last operation. Known values are: "Succeeded", "Failed", "Canceled", "Creating", and "Deleting". (Succeeded, Failed, Canceled, Creating, Deleting) |
specification | object | Specification of the discovery rule defining how entities are discovered. Required. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
addRecommendedSignals | string | Whether to add all recommended signals to the discovered entities. Required. Known values are: "Enabled" and "Disabled". (Enabled, Disabled) |
authenticationSetting | string | Reference to the name of the authentication setting which is used for querying Azure Resource Graph. The same authentication setting will also be assigned to any discovered entities. Required. |
discoverRelationships | string | Whether to create relationships between the discovered entities based on a set of built-in rules. These relationships cannot be manually deleted. Required. Known values are: "Enabled" and "Disabled". (Enabled, Disabled) |
displayName | string | Display name. |
entityName | string | Name of the entity which represents the discovery rule. Note: It might take a few minutes after creating the discovery rule until the entity is created. Required. |
error | object | Error details if the last discovery operation failed. |
provisioningState | string | The status of the last operation. Known values are: "Succeeded", "Failed", "Canceled", "Creating", and "Deleting". (Succeeded, Failed, Canceled, Creating, Deleting) |
specification | object | Specification of the discovery rule defining how entities are discovered. Required. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, health_model_name, discovery_rule_name, subscription_id | Get a DiscoveryRule. | |
list_by_health_model | select | resource_group_name, health_model_name, subscription_id | timestamp | List DiscoveryRule resources by HealthModel. |
create_or_update | insert | resource_group_name, health_model_name, discovery_rule_name, subscription_id | Create a DiscoveryRule. | |
create_or_update | replace | resource_group_name, health_model_name, discovery_rule_name, subscription_id | Create a DiscoveryRule. | |
delete | delete | resource_group_name, health_model_name, discovery_rule_name, subscription_id | Delete a DiscoveryRule. |
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 |
|---|---|---|
discovery_rule_name | string | Name of the discovery rule. Must be unique within a health model. Required. |
health_model_name | string | Name of health model resource. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string | |
timestamp | string (date-time) | Timestamp to use for the operation. When specified, the version of the resource at this point in time is retrieved. If not specified, the latest version is used. Default value is None. |
SELECT examples
- get
- list_by_health_model
Get a DiscoveryRule.
SELECT
id,
name,
addRecommendedSignals,
authenticationSetting,
discoverRelationships,
displayName,
entityName,
error,
provisioningState,
specification,
systemData,
type
FROM azure.cloud_health.discovery_rules
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND health_model_name = '{{ health_model_name }}' -- required
AND discovery_rule_name = '{{ discovery_rule_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
List DiscoveryRule resources by HealthModel.
SELECT
id,
name,
addRecommendedSignals,
authenticationSetting,
discoverRelationships,
displayName,
entityName,
error,
provisioningState,
specification,
systemData,
type
FROM azure.cloud_health.discovery_rules
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND health_model_name = '{{ health_model_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND timestamp = '{{ timestamp }}'
;
INSERT examples
- create_or_update
- Manifest
Create a DiscoveryRule.
INSERT INTO azure.cloud_health.discovery_rules (
properties,
resource_group_name,
health_model_name,
discovery_rule_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ health_model_name }}',
'{{ discovery_rule_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: discovery_rules
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the discovery_rules resource.
- name: health_model_name
value: "{{ health_model_name }}"
description: Required parameter for the discovery_rules resource.
- name: discovery_rule_name
value: "{{ discovery_rule_name }}"
description: Required parameter for the discovery_rules resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the discovery_rules resource.
- name: properties
description: |
The resource-specific properties for this resource.
value:
provisioningState: "{{ provisioningState }}"
displayName: "{{ displayName }}"
authenticationSetting: "{{ authenticationSetting }}"
discoverRelationships: "{{ discoverRelationships }}"
addRecommendedSignals: "{{ addRecommendedSignals }}"
specification:
kind: "{{ kind }}"
error:
message: "{{ message }}"
context:
- "{{ context }}"
entityName: "{{ entityName }}"
REPLACE examples
- create_or_update
Create a DiscoveryRule.
REPLACE azure.cloud_health.discovery_rules
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND health_model_name = '{{ health_model_name }}' --required
AND discovery_rule_name = '{{ discovery_rule_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
DELETE examples
- delete
Delete a DiscoveryRule.
DELETE FROM azure.cloud_health.discovery_rules
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND health_model_name = '{{ health_model_name }}' --required
AND discovery_rule_name = '{{ discovery_rule_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;