watchers
Creates, updates, deletes, gets or lists a watchers
resource.
Overview
Name | watchers |
Type | Resource |
Id | azure.db_watcher.watchers |
Fields
- vw_watchers
- watchers
Name | Datatype | Description |
---|---|---|
datastore | text | field from the properties object |
default_alert_rule_identity_resource_id | text | field from the properties object |
identity | text | Managed service identity (system assigned and/or user assigned identities) |
location | text | The geo-location where the resource lives |
provisioning_state | text | field from the properties object |
resourceGroupName | text | field from the properties object |
status | text | field from the properties object |
subscriptionId | text | field from the properties object |
tags | text | Resource tags. |
watcherName | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
identity | object | Managed service identity (system assigned and/or user assigned identities) |
location | string | The geo-location where the resource lives |
properties | object | The RP specific properties of the resource. |
tags | object | Resource tags. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | resourceGroupName, subscriptionId, watcherName | Get a Watcher |
list_by_resource_group | SELECT | resourceGroupName, subscriptionId | List Watcher resources by resource group |
list_by_subscription | SELECT | subscriptionId | List Watcher resources by subscription ID |
create_or_update | INSERT | resourceGroupName, subscriptionId, watcherName | Create a Watcher |
delete | DELETE | resourceGroupName, subscriptionId, watcherName | Delete a Watcher |
update | UPDATE | resourceGroupName, subscriptionId, watcherName | Update a Watcher |
start | EXEC | resourceGroupName, subscriptionId, watcherName | The action to start monitoring all targets configured for a database watcher. |
stop | EXEC | resourceGroupName, subscriptionId, watcherName | The action to stop monitoring all targets configured for a database watcher. |
SELECT
examples
List Watcher resources by subscription ID
- vw_watchers
- watchers
SELECT
datastore,
default_alert_rule_identity_resource_id,
identity,
location,
provisioning_state,
resourceGroupName,
status,
subscriptionId,
tags,
watcherName
FROM azure.db_watcher.vw_watchers
WHERE subscriptionId = '{{ subscriptionId }}';
SELECT
identity,
location,
properties,
tags
FROM azure.db_watcher.watchers
WHERE subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new watchers
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.db_watcher.watchers (
resourceGroupName,
subscriptionId,
watcherName,
properties,
identity,
tags,
location
)
SELECT
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ watcherName }}',
'{{ properties }}',
'{{ identity }}',
'{{ tags }}',
'{{ location }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: datastore
value:
- name: adxClusterResourceId
value: string
- name: kustoClusterDisplayName
value: string
- name: kustoClusterUri
value: string
- name: kustoDataIngestionUri
value: string
- name: kustoDatabaseName
value: string
- name: kustoManagementUrl
value: string
- name: kustoOfferingType
value: []
- name: status
value: []
- name: provisioningState
value: []
- name: defaultAlertRuleIdentityResourceId
value: string
- name: identity
value:
- name: principalId
value: string
- name: tenantId
value: string
- name: type
value: []
- name: userAssignedIdentities
value: []
- name: tags
value: object
- name: location
value: string
UPDATE
example
Updates a watchers
resource.
/*+ update */
UPDATE azure.db_watcher.watchers
SET
identity = '{{ identity }}',
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND watcherName = '{{ watcherName }}';
DELETE
example
Deletes the specified watchers
resource.
/*+ delete */
DELETE FROM azure.db_watcher.watchers
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND watcherName = '{{ watcherName }}';