From 4e627589dbbcf0690016dcccb44af65038a3bace Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 15 May 2023 06:01:36 +0000 Subject: [PATCH] CodeGen from PR 23714 in Azure/azure-rest-api-specs Add new test notification APIs for Tenant Action Groups (#23714) * 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 --- .../managementGroupDeploymentTemplate.json | 3 + .../Microsoft.Insights.json | 325 ++++++++++++++++++ 2 files changed, 328 insertions(+) create mode 100644 schemas/2023-05-01-preview/Microsoft.Insights.json diff --git a/schemas/2019-08-01/managementGroupDeploymentTemplate.json b/schemas/2019-08-01/managementGroupDeploymentTemplate.json index 9cdfc9b497..39a12d35f2 100644 --- a/schemas/2019-08-01/managementGroupDeploymentTemplate.json +++ b/schemas/2019-08-01/managementGroupDeploymentTemplate.json @@ -806,6 +806,9 @@ { "$ref": "https://schema.management.azure.com/schemas/2023-03-01-preview/Microsoft.Insights.json#/managementGroup_resourceDefinitions/tenantActionGroups" }, + { + "$ref": "https://schema.management.azure.com/schemas/2023-05-01-preview/Microsoft.Insights.json#/managementGroup_resourceDefinitions/tenantActionGroups" + }, { "$ref": "https://schema.management.azure.com/schemas/2022-01-01/Microsoft.Network.NRP.json#/managementGroup_resourceDefinitions/networkManagerConnections" }, diff --git a/schemas/2023-05-01-preview/Microsoft.Insights.json b/schemas/2023-05-01-preview/Microsoft.Insights.json new file mode 100644 index 0000000000..30f2799808 --- /dev/null +++ b/schemas/2023-05-01-preview/Microsoft.Insights.json @@ -0,0 +1,325 @@ +{ + "id": "https://schema.management.azure.com/schemas/2023-05-01-preview/Microsoft.Insights.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Microsoft.Insights", + "description": "Microsoft Insights Resource Types", + "resourceDefinitions": {}, + "managementGroup_resourceDefinitions": { + "tenantActionGroups": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2023-05-01-preview" + ] + }, + "location": { + "type": "string", + "description": "Resource location" + }, + "name": { + "oneOf": [ + { + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9]*$", + "minLength": 1, + "maxLength": 260 + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The name of the action group." + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/TenantActionGroup" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "A tenant action group." + }, + "tags": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "properties": {} + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Resource tags" + }, + "type": { + "type": "string", + "enum": [ + "Microsoft.Insights/tenantActionGroups" + ] + } + }, + "required": [ + "apiVersion", + "location", + "name", + "properties", + "type" + ], + "description": "Microsoft.Insights/tenantActionGroups" + } + }, + "definitions": { + "AzureAppPushReceiver": { + "type": "object", + "properties": { + "emailAddress": { + "type": "string", + "description": "The email address registered for the Azure mobile app." + }, + "name": { + "type": "string", + "description": "The name of the Azure mobile app push receiver. Names must be unique across all receivers within a tenant action group." + } + }, + "required": [ + "emailAddress", + "name" + ], + "description": "The Azure mobile App push notification receiver." + }, + "EmailReceiver": { + "type": "object", + "properties": { + "emailAddress": { + "type": "string", + "description": "The email address of this receiver." + }, + "name": { + "type": "string", + "description": "The name of the email receiver. Names must be unique across all receivers within a tenant action group." + }, + "useCommonAlertSchema": { + "oneOf": [ + { + "type": "boolean", + "default": false + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Indicates whether to use common alert schema." + } + }, + "required": [ + "emailAddress", + "name" + ], + "description": "An email receiver." + }, + "SmsReceiver": { + "type": "object", + "properties": { + "countryCode": { + "type": "string", + "description": "The country code of the SMS receiver." + }, + "name": { + "type": "string", + "description": "The name of the SMS receiver. Names must be unique across all receivers within a tenant action group." + }, + "phoneNumber": { + "type": "string", + "description": "The phone number of the SMS receiver." + } + }, + "required": [ + "countryCode", + "name", + "phoneNumber" + ], + "description": "An SMS receiver." + }, + "TenantActionGroup": { + "type": "object", + "properties": { + "azureAppPushReceivers": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/AzureAppPushReceiver" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The list of AzureAppPush receivers that are part of this tenant action group." + }, + "emailReceivers": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/EmailReceiver" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The list of email receivers that are part of this tenant action group." + }, + "enabled": { + "oneOf": [ + { + "type": "boolean", + "default": true + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Indicates whether this tenant action group is enabled. If a tenant action group is not enabled, then none of its receivers will receive communications." + }, + "groupShortName": { + "type": "string", + "maxLength": 12, + "description": "The short name of the action group. This will be used in SMS messages." + }, + "smsReceivers": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/SmsReceiver" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The list of SMS receivers that are part of this tenant action group." + }, + "voiceReceivers": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/VoiceReceiver" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The list of voice receivers that are part of this tenant action group." + }, + "webhookReceivers": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/WebhookReceiver" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The list of webhook receivers that are part of this tenant action group." + } + }, + "required": [ + "enabled", + "groupShortName" + ], + "description": "A tenant action group." + }, + "VoiceReceiver": { + "type": "object", + "properties": { + "countryCode": { + "type": "string", + "description": "The country code of the voice receiver." + }, + "name": { + "type": "string", + "description": "The name of the voice receiver. Names must be unique across all receivers within a tenant action group." + }, + "phoneNumber": { + "type": "string", + "description": "The phone number of the voice receiver." + } + }, + "required": [ + "countryCode", + "name", + "phoneNumber" + ], + "description": "A voice receiver." + }, + "WebhookReceiver": { + "type": "object", + "properties": { + "identifierUri": { + "type": "string", + "description": "Indicates the identifier uri for aad auth." + }, + "name": { + "type": "string", + "description": "The name of the webhook receiver. Names must be unique across all receivers within a tenant action group." + }, + "objectId": { + "type": "string", + "description": "Indicates the webhook app object Id for aad auth." + }, + "serviceUri": { + "type": "string", + "description": "The URI where webhooks should be sent." + }, + "tenantId": { + "type": "string", + "description": "Indicates the tenant id for aad auth." + }, + "useAadAuth": { + "oneOf": [ + { + "type": "boolean", + "default": false + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Indicates whether or not use AAD authentication." + }, + "useCommonAlertSchema": { + "oneOf": [ + { + "type": "boolean", + "default": false + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Indicates whether to use common alert schema." + } + }, + "required": [ + "name", + "serviceUri" + ], + "description": "A webhook receiver." + } + } +} \ No newline at end of file