Skip to content

Commit

Permalink
Adding API for notification rules in loadtesting (#31078)
Browse files Browse the repository at this point in the history
* Adding API for notification rules in loadtesting

* Update description

* Moving to new API version 2024-11-01-preview

* Updates

* Remove wrong files

* Update example to dict

* Update as per review

* Update key in example

* Add new trigger scope

* Add test run started/ended to trigger scope

* Change event name to trigger completed

* Update name

* Remove triggers scope

* Update spec

* Move notifications to 2024-12-01-preview

* Update api version in examples

* Update doc
  • Loading branch information
radhikajain99 authored Dec 30, 2024
1 parent 3890d97 commit 45374f4
Show file tree
Hide file tree
Showing 11 changed files with 1,351 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{
"operationId": "NotificationRuleAdministration_CreateOrUpdateNotificationRule",
"title": "Create or update a notification rule for tests.",
"parameters": {
"api-version": "2024-12-01-preview",
"notificationRuleId": "12345678-1234-1234-1234-123456789012",
"body": {
"displayName": "Sample_Notification_Rule",
"actionGroupIds": [
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/sampleRG/providers/microsoft.insights/actionGroups/sampleActionGroup"
],
"scope": "Tests",
"testIds": [
"12345678-1234-1234-1234-123456789012"
],
"eventFilters": {
"eventfilter1": {
"kind": "TestRunEnded",
"condition": {
"testRunStatuses": [
"FAILED",
"DONE"
],
"testRunResults": [
"PASSED",
"FAILED"
]
}
},
"eventfilter2": {
"kind": "TestRunStarted"
},
"eventfilter3": {
"kind": "TriggerCompleted"
},
"eventfilter4": {
"kind": "TriggerDisabled"
}
}
}
},
"responses": {
"200": {
"body": {
"notificationRuleId": "12345678-1234-1234-1234-123456789012",
"displayName": "Sample_Notification_Rule",
"actionGroupIds": [
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/sampleRG/providers/microsoft.insights/actionGroups/sampleActionGroup"
],
"scope": "Tests",
"testIds": [
"12345678-1234-1234-1234-123456789012"
],
"eventFilters": {
"eventfilter1": {
"kind": "TestRunEnded",
"condition": {
"testRunStatuses": [
"FAILED",
"DONE"
],
"testRunResults": [
"PASSED",
"FAILED"
]
}
},
"eventfilter2": {
"kind": "TestRunStarted"
},
"eventfilter3": {
"kind": "TriggerCompleted"
},
"eventfilter4": {
"kind": "TriggerDisabled"
}
},
"createdDateTime": "2024-05-01T16:43:46.072Z",
"createdBy": "[email protected]",
"lastModifiedDateTime": "2024-05-01T16:43:46.072Z",
"lastModifiedBy": "[email protected]"
}
},
"201": {
"body": {
"notificationRuleId": "12345678-1234-1234-1234-123456789012",
"displayName": "Sample_Notification_Rule",
"actionGroupIds": [
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/sampleRG/providers/microsoft.insights/actionGroups/sampleActionGroup"
],
"scope": "Tests",
"testIds": [
"12345678-1234-1234-1234-123456789012"
],
"eventFilters": {
"eventfilter1": {
"kind": "TestRunEnded",
"condition": {
"testRunStatuses": [
"FAILED",
"DONE"
],
"testRunResults": [
"PASSED",
"FAILED"
]
}
},
"eventfilter2": {
"kind": "TestRunStarted"
},
"eventfilter3": {
"kind": "TriggerCompleted"
},
"eventfilter4": {
"kind": "TriggerDisabled"
}
},
"createdDateTime": "2024-05-01T16:43:46.072Z",
"createdBy": "[email protected]",
"lastModifiedDateTime": "2024-05-01T16:43:46.072Z",
"lastModifiedBy": "[email protected]"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"operationId": "NotificationRuleAdministration_DeleteNotificationRule",
"title": "Delete a notification rule",
"parameters": {
"api-version": "2024-12-01-preview",
"notificationRuleId": "12345678-1234-1234-1234-123456789012"
},
"responses": {
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"operationId": "NotificationRuleAdministration_GetNotificationRule",
"title": "Get a notification rule.",
"parameters": {
"api-version": "2024-12-01-preview",
"notificationRuleId": "12345678-1234-1234-1234-123456789012"
},
"responses": {
"200": {
"body": {
"notificationRuleId": "12345678-1234-1234-1234-123456789012",
"displayName": "Sample_Notification_Rule",
"actionGroupIds": [
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/sampleRG/providers/microsoft.insights/actionGroups/sampleActionGroup"
],
"scope": "Tests",
"testIds": [
"12345678-1234-1234-1234-123456789012"
],
"eventFilters": {
"eventfilter1": {
"kind": "TestRunEnded",
"condition": {
"testRunStatuses": [
"FAILED",
"DONE"
],
"testRunResults": [
"PASSED",
"FAILED"
]
}
},
"eventfilter2": {
"kind": "TestRunStarted"
},
"eventfilter3": {
"kind": "TriggerCompleted"
},
"eventfilter4": {
"kind": "TriggerDisabled"
}
},
"createdDateTime": "2024-05-01T16:43:46.072Z",
"createdBy": "[email protected]",
"lastModifiedDateTime": "2024-05-01T16:43:46.072Z",
"lastModifiedBy": "[email protected]"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"operationId": "NotificationRuleAdministration_ListNotificationRule",
"title": "Get all notification rules for the specified filters.",
"parameters": {
"maxPageSize": 30,
"lastModifiedStartTime": "2024-05-01T16:00:46.072Z",
"lastModifiedEndTime": "2024-05-01T16:50:46.072Z",
"api-version": "2024-12-01-preview"
},
"responses": {
"200": {
"body": {
"value": [
{
"notificationRuleId": "12345678-1234-1234-1234-123456789012",
"displayName": "Sample_Notification_Rule1",
"actionGroupIds": [
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/sampleRG/providers/microsoft.insights/actionGroups/sampleActionGroup1",
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/sampleRG/providers/microsoft.insights/actionGroups/sampleActionGroup2"
],
"scope": "Tests",
"testIds": [
"12345678-1234-1234-1234-123456789012",
"12345678-1234-1234-1234-123456789013"
],
"eventFilters": {
"eventfilter1": {
"kind": "TestRunEnded",
"condition": {
"testRunStatuses": [
"FAILED",
"DONE"
],
"testRunResults": [
"PASSED",
"FAILED"
]
}
},
"eventfilter2": {
"kind": "TestRunStarted"
},
"eventfilter3": {
"kind": "TriggerCompleted"
},
"eventfilter4": {
"kind": "TriggerDisabled"
}
},
"createdDateTime": "2024-05-01T16:43:46.072Z",
"createdBy": "[email protected]",
"lastModifiedDateTime": "2024-05-01T16:43:46.072Z",
"lastModifiedBy": "[email protected]"
},
{
"notificationRuleId": "12345678-1234-1234-1234-123456789013",
"displayName": "Sample_Notification_Rule2",
"actionGroupIds": [
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/sampleRG/providers/microsoft.insights/actionGroups/sampleActionGroup2"
],
"scope": "Tests",
"testIds": [
"12345678-1234-1234-1234-123456789012"
],
"eventFilters": {
"eventfilter1": {
"kind": "TestRunEnded",
"condition": {
"testRunStatuses": [
"FAILED"
],
"testRunResults": [
"FAILED"
]
}
}
},
"createdDateTime": "2024-05-01T16:43:46.072Z",
"createdBy": "[email protected]",
"lastModifiedDateTime": "2024-05-01T16:43:46.072Z",
"lastModifiedBy": "[email protected]"
}
]
}
}
}
}
Loading

0 comments on commit 45374f4

Please sign in to comment.