smart_groups
Creates, updates, deletes, gets or lists a smart_groups
resource.
Overview
Name | smart_groups |
Type | Resource |
Id | azure.alerts_management.smart_groups |
Fields
The following fields are returned by SELECT
queries:
- get_by_id
- get_all
OK. Returns the group with the specified smart group Id.
Name | Datatype | Description |
---|---|---|
id | string | Azure resource Id |
name | string | Azure resource name |
properties | object | Properties of smart group. |
type | string | Azure resource type |
OK. Returns list of all smartGroups.
Name | Datatype | Description |
---|---|---|
id | string | Azure resource Id |
name | string | Azure resource name |
properties | object | Properties of smart group. |
type | string | Azure resource type |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get_by_id | select | subscriptionId , smartGroupId | api-version | Get information related to a specific Smart Group. |
get_all | select | subscriptionId | targetResource , targetResourceGroup , targetResourceType , monitorService , monitorCondition , severity , smartGroupState , timeRange , pageCount , sortBy , sortOrder , api-version | List all the Smart Groups within a specified subscription. |
change_state | exec | subscriptionId , smartGroupId , newState | api-version | Change 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.
Name | Datatype | Description |
---|---|---|
newState | string | New state of the alert. |
smartGroupId | string | Smart group unique id. |
subscriptionId | string | The ID of the target subscription. |
api-version | string | client API version |
monitorCondition | string | Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all. |
monitorService | string | Filter by monitor service which generates the alert instance. Default value is select all. |
pageCount | integer (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. |
severity | string | Filter by severity. Default value is select all. |
smartGroupState | string | Filter by state of the smart group. Default value is to select all. |
sortBy | string | Sort the query results by input field. Default value is sort by 'lastModifiedDateTime'. |
sortOrder | string | Sort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others. |
targetResource | string | Filter by target resource( which is full ARM ID) Default value is select all. |
targetResourceGroup | string | Filter by target resource group name. Default value is select all. |
targetResourceType | string | Filter by target resource type. Default value is select all. |
timeRange | string | Filter by time range by below listed values. Default value is 1 day. |
SELECT
examples
- get_by_id
- get_all
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 }}'
;
List all the Smart Groups within a specified subscription.
SELECT
id,
name,
properties,
type
FROM azure.alerts_management.smart_groups
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND targetResource = '{{ targetResource }}'
AND targetResourceGroup = '{{ targetResourceGroup }}'
AND targetResourceType = '{{ targetResourceType }}'
AND monitorService = '{{ monitorService }}'
AND monitorCondition = '{{ monitorCondition }}'
AND severity = '{{ severity }}'
AND smartGroupState = '{{ smartGroupState }}'
AND timeRange = '{{ timeRange }}'
AND pageCount = '{{ pageCount }}'
AND sortBy = '{{ sortBy }}'
AND sortOrder = '{{ sortOrder }}'
AND api-version = '{{ api-version }}'
;
Lifecycle Methods
- change_state
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 }}'
;