Skip to content

Commit

Permalink
Add new test notification APIs for Tenant Action Groups (#23714)
Browse files Browse the repository at this point in the history
* Initial changes/baseline

* New changes for 2023-05-01-preview

* Make the new api default

* Fix build

* Add regex name validation

* name validation

* Regex

* Change type.

* Fix typo

* Change to v2

---------

Co-authored-by: Thomas Pham <[email protected]>
  • Loading branch information
thomasp98296 and Thomas Pham authored May 15, 2023
1 parent 18b397a commit 9f1fc4e
Show file tree
Hide file tree
Showing 9 changed files with 1,530 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
{
"parameters": {
"managementGroupId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
"tenantActionGroupName": "testTenantActionGroup",
"api-version": "2023-05-01-preview",
"x-ms-client-tenant-id": "72f988bf-86f1-41af-91ab-2d7cd011db47",
"actionGroup": {
"location": "Global",
"tags": {},
"properties": {
"groupShortName": "sample",
"enabled": true,
"emailReceivers": [
{
"name": "John Doe's email",
"emailAddress": "[email protected]",
"useCommonAlertSchema": false
},
{
"name": "Jane Smith's email",
"emailAddress": "[email protected]",
"useCommonAlertSchema": true
}
],
"smsReceivers": [
{
"name": "John Doe's mobile",
"countryCode": "1",
"phoneNumber": "2062022299"
},
{
"name": "Jane Smith's mobile",
"countryCode": "1",
"phoneNumber": "0987654321"
}
],
"webhookReceivers": [
{
"name": "Sample webhook 1",
"serviceUri": "http://www.example.com/webhook1",
"useCommonAlertSchema": true
},
{
"name": "Sample webhook 2",
"serviceUri": "http://www.example.com/webhook2",
"useCommonAlertSchema": true,
"useAadAuth": true,
"objectId": "d3bb868c-fe44-452c-aa26-769a6538c808",
"identifierUri": "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a",
"tenantId": "68a4459a-ccb8-493c-b9da-dd30457d1b84"
}
],
"azureAppPushReceivers": [
{
"name": "Sample azureAppPush",
"emailAddress": "[email protected]"
}
],
"voiceReceivers": [
{
"name": "Sample voice",
"countryCode": "1",
"phoneNumber": "2062022299"
}
]
}
}
},
"responses": {
"200": {
"headers": {},
"body": {
"id": "/providers/Microsoft.Management/managementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.Insights/tenantActionGroups/testTenantActionGroup",
"type": "Microsoft.Insights/TenantActionGroups",
"name": "testTenantActionGroup",
"location": "Global",
"tags": {},
"properties": {
"groupShortName": "sample",
"enabled": true,
"emailReceivers": [
{
"name": "John Doe's email",
"emailAddress": "[email protected]",
"status": "Enabled",
"useCommonAlertSchema": false
},
{
"name": "Jane Smith's email",
"emailAddress": "[email protected]",
"status": "Enabled",
"useCommonAlertSchema": true
}
],
"smsReceivers": [
{
"name": "John Doe's mobile",
"countryCode": "1",
"phoneNumber": "2062022299",
"status": "Enabled"
},
{
"name": "Jane Smith's mobile",
"countryCode": "1",
"phoneNumber": "0987654321",
"status": "Enabled"
}
],
"webhookReceivers": [
{
"name": "Sample webhook 1",
"serviceUri": "http://www.example.com/webhook1",
"useCommonAlertSchema": true
},
{
"name": "Sample webhook 2",
"serviceUri": "http://www.example.com/webhook2",
"useCommonAlertSchema": true,
"useAadAuth": true,
"objectId": "d3bb868c-fe44-452c-aa26-769a6538c808",
"identifierUri": "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a",
"tenantId": "68a4459a-ccb8-493c-b9da-dd30457d1b84"
}
],
"voiceReceivers": [
{
"name": "Sample voice",
"countryCode": "1",
"phoneNumber": "2062022299"
}
]
}
}
},
"201": {
"headers": {},
"body": {
"id": "/providers/Microsoft.Management/managementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.Insights/tenantActionGroups/testTenantActionGroup",
"type": "Microsoft.Insights/TenantActionGroups",
"name": "testTenantActionGroup",
"location": "Global",
"tags": {},
"properties": {
"groupShortName": "sample",
"enabled": true,
"emailReceivers": [
{
"name": "John Doe's email",
"emailAddress": "[email protected]",
"status": "Enabled",
"useCommonAlertSchema": false
},
{
"name": "Jane Smith's email",
"emailAddress": "[email protected]",
"status": "Enabled",
"useCommonAlertSchema": true
}
],
"smsReceivers": [
{
"name": "John Doe's mobile",
"countryCode": "1",
"phoneNumber": "2062022299",
"status": "Enabled"
},
{
"name": "Jane Smith's mobile",
"countryCode": "1",
"phoneNumber": "0987654321",
"status": "Enabled"
}
],
"webhookReceivers": [
{
"name": "Sample webhook 1",
"serviceUri": "http://www.example.com/webhook1",
"useCommonAlertSchema": true
},
{
"name": "Sample webhook 2",
"serviceUri": "http://www.example.com/webhook2",
"useCommonAlertSchema": true,
"useAadAuth": true,
"objectId": "d3bb868c-fe44-452c-aa26-769a6538c808",
"identifierUri": "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a",
"tenantId": "68a4459a-ccb8-493c-b9da-dd30457d1b84"
}
],
"voiceReceivers": [
{
"name": "Sample voice",
"countryCode": "1",
"phoneNumber": "2062022299"
}
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"parameters": {
"managementGroupId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
"tenantActionGroupName": "testTenantActionGroup",
"api-version": "2023-05-01-preview",
"x-ms-client-tenant-id": "72f988bf-86f1-41af-91ab-2d7cd011db47"
},
"responses": {
"200": {},
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"parameters": {
"managementGroupId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
"tenantActionGroupName": "testTenantActionGroup",
"api-version": "2023-05-01-preview",
"x-ms-client-tenant-id": "72f988bf-86f1-41af-91ab-2d7cd011db47"
},
"responses": {
"200": {
"headers": {},
"body": {
"id": "/providers/Microsoft.Management/managementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.Insights/tenantActionGroups/testTenantActionGroup",
"type": "Microsoft.Insights/TenantActionGroups",
"name": "testTenantActionGroup",
"location": "Global",
"tags": {},
"properties": {
"groupShortName": "sample",
"enabled": true,
"emailReceivers": [
{
"name": "John Doe's email",
"emailAddress": "[email protected]",
"status": "Enabled",
"useCommonAlertSchema": false
},
{
"name": "Jane Smith's email",
"emailAddress": "[email protected]",
"status": "Enabled",
"useCommonAlertSchema": true
}
],
"smsReceivers": [
{
"name": "John Doe's mobile",
"countryCode": "1",
"phoneNumber": "2062022299",
"status": "Enabled"
},
{
"name": "Jane Smith's mobile",
"countryCode": "1",
"phoneNumber": "0987654321",
"status": "Enabled"
}
],
"webhookReceivers": [
{
"name": "Sample webhook 1",
"serviceUri": "http://www.example.com/webhook1",
"useCommonAlertSchema": true
},
{
"name": "Sample webhook 2",
"serviceUri": "http://www.example.com/webhook2",
"useCommonAlertSchema": true,
"useAadAuth": true,
"objectId": "d3bb868c-fe44-452c-aa26-769a6538c808",
"identifierUri": "http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a",
"tenantId": "68a4459a-ccb8-493c-b9da-dd30457d1b84"
}
],
"voiceReceivers": [
{
"name": "Sample voice",
"countryCode": "1",
"phoneNumber": "2062022299"
}
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"parameters": {
"managementGroupId": "11111111-1111-1111-1111-111111111111",
"tenantActionGroupName": "testTenantActionGroup",
"x-ms-client-tenant-id": "72f988bf-86f1-41af-91ab-2d7cd011db47",
"notificationId": "11000222191287",
"api-version": "2023-05-01-preview"
},
"responses": {
"200": {
"headers": {},
"body": {
"context": {
"notificationSource": "Microsoft.Insights/TestNotification",
"contextType": "Microsoft.Insights/ServiceHealth"
},
"state": "Completed",
"completedTime": "0001-01-01T00:00:00+00:00",
"createdTime": "2021-09-21T04:52:29.5091168+00:00",
"actionDetails": [
{
"mechanismType": "AzureAppPush",
"name": "AzureAppPush-name",
"status": "Completed",
"subState": "Default",
"sendTime": "2021-09-21T04:52:42.8620629+00:00",
"message": null
},
{
"mechanismType": "Email",
"name": "Email-name",
"status": "Completed",
"subState": "Default",
"sendTime": "2021-09-21T04:52:40.7480368+00:00",
"message": null
},
{
"mechanismType": "Webhook",
"name": "Webhook-name",
"status": "Completed",
"subState": "Default",
"sendTime": "2021-09-21T04:52:42.0723479+00:00",
"message": null
},
{
"mechanismType": "SecureWebhook",
"name": "SecureWebhook-name",
"status": "Completed",
"subState": "Default",
"sendTime": "2021-09-21T04:52:42.0723479+00:00",
"message": null
},
{
"mechanismType": "Sms",
"name": "Sms-name",
"status": "Completed",
"subState": "Default",
"sendTime": "2021-09-21T04:52:41.353015+00:00",
"message": null
},
{
"mechanismType": "Voice",
"name": "Voice-name",
"status": "Completed",
"subState": "Default",
"sendTime": "2021-09-21T04:52:41.6330734+00:00",
"message": null
}
]
}
}
}
}
Loading

0 comments on commit 9f1fc4e

Please sign in to comment.