alerts
Creates, updates, deletes, gets or lists an alerts resource.
Overview
| Name | alerts |
| Type | Resource |
| Id | azure.cost_management.alerts |
Fields
The following fields are returned by SELECT queries:
- get
- list_external
- list
| 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. |
closeTime | string | dateTime in which alert was closed. |
costEntityId | string | related budget. |
creationTime | string | dateTime in which alert was created. |
definition | object | defines the type of alert. |
description | string | Alert description. |
details | object | Alert details. |
eTag | string | eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. |
modificationTime | string | dateTime in which alert was last modified. |
source | string | Source of alert. Known values are: "Preset" and "User". (Preset, User) |
status | string | alert status. Known values are: "None", "Active", "Overridden", "Resolved", and "Dismissed". (None, Active, Overridden, Resolved, Dismissed) |
statusModificationTime | string | dateTime in which the alert status was last modified. |
statusModificationUserName | string | User who last modified the alert. |
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 |
|---|---|---|
nextLink | string | URL to get the next set of alerts results if there are any. |
value | array | List of alerts. |
| Name | Datatype | Description |
|---|---|---|
nextLink | string | URL to get the next set of alerts results if there are any. |
value | array | List of alerts. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | scope, alert_id | Gets the alert for the scope by alert ID. | |
list_external | select | external_cloud_provider_type, external_cloud_provider_id | Lists the Alerts for external cloud provider type defined. | |
list | select | scope | Lists the alerts for scope defined. | |
dismiss | exec | scope, alert_id | Dismisses the specified alert. |
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 |
|---|---|---|
alert_id | string | Alert ID. Required. |
external_cloud_provider_id | string | This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. Required. |
external_cloud_provider_type | string | The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. Known values are: "externalSubscriptions" and "externalBillingAccounts". Required. |
scope | string | The fully qualified Azure Resource manager identifier of the resource. Required. |
SELECT examples
- get
- list_external
- list
Gets the alert for the scope by alert ID.
SELECT
id,
name,
closeTime,
costEntityId,
creationTime,
definition,
description,
details,
eTag,
modificationTime,
source,
status,
statusModificationTime,
statusModificationUserName,
systemData,
type
FROM azure.cost_management.alerts
WHERE scope = '{{ scope }}' -- required
AND alert_id = '{{ alert_id }}' -- required
;
Lists the Alerts for external cloud provider type defined.
SELECT
nextLink,
value
FROM azure.cost_management.alerts
WHERE external_cloud_provider_type = '{{ external_cloud_provider_type }}' -- required
AND external_cloud_provider_id = '{{ external_cloud_provider_id }}' -- required
;
Lists the alerts for scope defined.
SELECT
nextLink,
value
FROM azure.cost_management.alerts
WHERE scope = '{{ scope }}' -- required
;
Lifecycle Methods
- dismiss
Dismisses the specified alert.
EXEC azure.cost_management.alerts.dismiss
@scope='{{ scope }}' --required,
@alert_id='{{ alert_id }}' --required
@@json=
'{
"properties": "{{ properties }}"
}'
;