watchers
Creates, updates, deletes, gets or lists a watchers
resource.
Overview
Name | watchers |
Type | Resource |
Id | azure.automation.watchers |
Fields
- vw_watchers
- watchers
Name | Datatype | Description |
---|---|---|
id | text | Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" |
name | text | The name of the resource |
description | text | field from the properties object |
automationAccountName | text | field from the properties object |
creation_time | text | field from the properties object |
etag | text | Gets or sets the etag of the resource. |
execution_frequency_in_seconds | text | field from the properties object |
last_modified_by | text | field from the properties object |
last_modified_time | text | field from the properties object |
location | text | The geo-location where the resource lives |
resourceGroupName | text | field from the properties object |
script_name | text | field from the properties object |
script_parameters | text | field from the properties object |
script_run_on | text | field from the properties object |
status | text | field from the properties object |
subscriptionId | text | field from the properties object |
system_data | text | field from the properties object |
tags | text | Resource tags. |
type | text | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
watcherName | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
id | string | Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" |
name | string | The name of the resource |
etag | string | Gets or sets the etag of the resource. |
location | string | The geo-location where the resource lives |
properties | object | Definition of the watcher properties |
systemData | object | Metadata pertaining to creation and last modification of the resource. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | automationAccountName, resourceGroupName, subscriptionId, watcherName | Retrieve the watcher identified by watcher name. |
list_by_automation_account | SELECT | automationAccountName, resourceGroupName, subscriptionId | Retrieve a list of watchers. |
create_or_update | INSERT | automationAccountName, resourceGroupName, subscriptionId, watcherName | Create the watcher identified by watcher name. |
delete | DELETE | automationAccountName, resourceGroupName, subscriptionId, watcherName | Delete the watcher by name. |
update | UPDATE | automationAccountName, resourceGroupName, subscriptionId, watcherName | Update the watcher identified by watcher name. |
start | EXEC | automationAccountName, resourceGroupName, subscriptionId, watcherName | Resume the watcher identified by watcher name. |
stop | EXEC | automationAccountName, resourceGroupName, subscriptionId, watcherName | Resume the watcher identified by watcher name. |
SELECT
examples
Retrieve a list of watchers.
- vw_watchers
- watchers
SELECT
id,
name,
description,
automationAccountName,
creation_time,
etag,
execution_frequency_in_seconds,
last_modified_by,
last_modified_time,
location,
resourceGroupName,
script_name,
script_parameters,
script_run_on,
status,
subscriptionId,
system_data,
tags,
type,
watcherName
FROM azure.automation.vw_watchers
WHERE automationAccountName = '{{ automationAccountName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
id,
name,
etag,
location,
properties,
systemData,
tags,
type
FROM azure.automation.watchers
WHERE automationAccountName = '{{ automationAccountName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND 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.automation.watchers (
automationAccountName,
resourceGroupName,
subscriptionId,
watcherName,
properties,
etag,
tags,
location
)
SELECT
'{{ automationAccountName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ watcherName }}',
'{{ properties }}',
'{{ etag }}',
'{{ tags }}',
'{{ location }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: executionFrequencyInSeconds
value: integer
- name: scriptName
value: string
- name: scriptParameters
value: object
- name: scriptRunOn
value: string
- name: status
value: string
- name: creationTime
value: string
- name: lastModifiedTime
value: string
- name: lastModifiedBy
value: string
- name: description
value: string
- name: etag
value: string
- name: tags
value: object
- name: location
value: string
- name: id
value: string
- name: name
value: string
- name: type
value: string
- name: systemData
value:
- name: createdBy
value: string
- name: createdByType
value: string
- name: createdAt
value: string
- name: lastModifiedBy
value: string
- name: lastModifiedByType
value: string
- name: lastModifiedAt
value: string
UPDATE
example
Updates a watchers
resource.
/*+ update */
UPDATE azure.automation.watchers
SET
properties = '{{ properties }}',
name = '{{ name }}'
WHERE
automationAccountName = '{{ automationAccountName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND watcherName = '{{ watcherName }}';
DELETE
example
Deletes the specified watchers
resource.
/*+ delete */
DELETE FROM azure.automation.watchers
WHERE automationAccountName = '{{ automationAccountName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND watcherName = '{{ watcherName }}';