Skip to main content

smart_groups

Creates, updates, deletes, gets or lists a smart_groups resource.

Overview

Namesmart_groups
TypeResource
Idazure.alerts_management.smart_groups

Fields

The following fields are returned by SELECT queries:

OK. Returns the group with the specified smart group Id.

NameDatatypeDescription
idstringAzure resource Id
namestringAzure resource name
propertiesobjectProperties of smart group.
typestringAzure resource type

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_by_idselectsubscriptionId, smartGroupIdapi-versionGet information related to a specific Smart Group.
get_allselectsubscriptionIdtargetResource, targetResourceGroup, targetResourceType, monitorService, monitorCondition, severity, smartGroupState, timeRange, pageCount, sortBy, sortOrder, api-versionList all the Smart Groups within a specified subscription.
change_stateexecsubscriptionId, smartGroupId, newStateapi-versionChange the state of a Smart Group.

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.

NameDatatypeDescription
newStatestringNew state of the alert.
smartGroupIdstringSmart group unique id.
subscriptionIdstringThe ID of the target subscription.
api-versionstringclient API version
monitorConditionstringFilter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all.
monitorServicestringFilter by monitor service which generates the alert instance. Default value is select all.
pageCountinteger (int64)Determines number of alerts returned per page in response. Permissible value is between 1 to 250. When the "includeContent" filter is selected, maximum value allowed is 25. Default value is 25.
severitystringFilter by severity. Default value is select all.
smartGroupStatestringFilter by state of the smart group. Default value is to select all.
sortBystringSort the query results by input field. Default value is sort by 'lastModifiedDateTime'.
sortOrderstringSort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others.
targetResourcestringFilter by target resource( which is full ARM ID) Default value is select all.
targetResourceGroupstringFilter by target resource group name. Default value is select all.
targetResourceTypestringFilter by target resource type. Default value is select all.
timeRangestringFilter by time range by below listed values. Default value is 1 day.

SELECT examples

Get information related to a specific Smart Group.

SELECT
id,
name,
properties,
type
FROM azure.alerts_management.smart_groups
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND smartGroupId = '{{ smartGroupId }}' -- required
AND api-version = '{{ api-version }}'
;

Lifecycle Methods

Change the state of a Smart Group.

EXEC azure.alerts_management.smart_groups.change_state 
@subscriptionId='{{ subscriptionId }}' --required,
@smartGroupId='{{ smartGroupId }}' --required,
@newState='{{ newState }}' --required,
@api-version='{{ api-version }}'
;