Skip to content

Commit

Permalink
CodeGen from PR 22575 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[Hub Generated] Review request for Microsoft.Insights to add version preview/2023-01-01-preview (#22575)

* Adds base for updating Microsoft.Insights from version stable/2020-10-01 to version 2023-01-01-preview

* Updates readme

* Updates API version in new specs and examples

* added tenant scope in the new ALA api version

* updated tenant level service health rule example

* fixed linter errors

* added "actionProperties" to the api and examples

* fix prettier. added object types. typo fix

---------

Co-authored-by: Gregory Chris <[email protected]>
  • Loading branch information
SDKAuto and sgchris committed Mar 14, 2023
1 parent 5ed6daf commit a81b223
Show file tree
Hide file tree
Showing 2 changed files with 302 additions and 0 deletions.
299 changes: 299 additions & 0 deletions schemas/2023-01-01-preview/Microsoft.Insights.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,299 @@
{
"id": "https://schema.management.azure.com/schemas/2023-01-01-preview/Microsoft.Insights.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Microsoft.Insights",
"description": "Microsoft Insights Resource Types",
"resourceDefinitions": {
"activityLogAlerts": {
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"enum": [
"2023-01-01-preview"
]
},
"location": {
"type": "string",
"default": "global",
"description": "The location of the resource. Since Azure Activity Log Alerts is a global service, the location of the rules should always be 'global'."
},
"name": {
"oneOf": [
{
"type": "string",
"pattern": "^[-\\w\\._\\(\\)]+$"
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "The name of the Activity Log Alert rule."
},
"properties": {
"oneOf": [
{
"$ref": "#/definitions/AlertRuleProperties"
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "An Azure Activity Log Alert rule."
},
"tags": {
"oneOf": [
{
"type": "object",
"additionalProperties": {
"type": "string"
},
"properties": {}
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "The tags of the resource."
},
"type": {
"type": "string",
"enum": [
"Microsoft.Insights/activityLogAlerts"
]
}
},
"required": [
"apiVersion",
"name",
"properties",
"type"
],
"description": "Microsoft.Insights/activityLogAlerts"
}
},
"definitions": {
"ActionGroup": {
"type": "object",
"properties": {
"actionGroupId": {
"type": "string",
"description": "The resource ID of the Action Group. This cannot be null or empty."
},
"actionProperties": {
"oneOf": [
{
"type": "object",
"additionalProperties": {
"type": "string"
},
"properties": {}
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "Predefined list of properties and configuration items for the action group."
},
"webhookProperties": {
"oneOf": [
{
"type": "object",
"additionalProperties": {
"type": "string"
},
"properties": {}
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload."
}
},
"required": [
"actionGroupId"
],
"description": "A pointer to an Azure Action Group."
},
"ActionList": {
"type": "object",
"properties": {
"actionGroups": {
"oneOf": [
{
"type": "array",
"items": {
"$ref": "#/definitions/ActionGroup"
}
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "The list of the Action Groups."
}
},
"description": "A list of Activity Log Alert rule actions."
},
"AlertRuleAllOfCondition": {
"type": "object",
"properties": {
"allOf": {
"oneOf": [
{
"type": "array",
"items": {
"$ref": "#/definitions/AlertRuleAnyOfOrLeafCondition"
}
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "The list of Activity Log Alert rule conditions."
}
},
"required": [
"allOf"
],
"description": "An Activity Log Alert rule condition that is met when all its member conditions are met."
},
"AlertRuleAnyOfOrLeafCondition": {
"type": "object",
"properties": {
"anyOf": {
"oneOf": [
{
"type": "array",
"items": {
"$ref": "#/definitions/AlertRuleLeafCondition"
}
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met."
},
"containsAny": {
"oneOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met."
},
"equals": {
"type": "string",
"description": "The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met."
},
"field": {
"type": "string",
"description": "The name of the Activity Log event's field that this condition will examine.\nThe possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'."
}
},
"description": "An Activity Log Alert rule condition that is met when all its member conditions are met.\nEach condition can be of one of the following types:\n__Important__: Each type has its unique subset of properties. Properties from different types CANNOT exist in one condition.\n * __Leaf Condition -__ must contain 'field' and either 'equals' or 'containsAny'.\n _Please note, 'anyOf' should __not__ be set in a Leaf Condition._\n * __AnyOf Condition -__ must contain __only__ 'anyOf' (which is an array of Leaf Conditions).\n _Please note, 'field', 'equals' and 'containsAny' should __not__ be set in an AnyOf Condition._\n"
},
"AlertRuleLeafCondition": {
"type": "object",
"properties": {
"containsAny": {
"oneOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met."
},
"equals": {
"type": "string",
"description": "The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met."
},
"field": {
"type": "string",
"description": "The name of the Activity Log event's field that this condition will examine.\nThe possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'."
}
},
"description": "An Activity Log Alert rule condition that is met by comparing the field and value of an Activity Log event.\nThis condition must contain 'field' and either 'equals' or 'containsAny'."
},
"AlertRuleProperties": {
"type": "object",
"properties": {
"actions": {
"oneOf": [
{
"$ref": "#/definitions/ActionList"
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "A list of Activity Log Alert rule actions."
},
"condition": {
"oneOf": [
{
"$ref": "#/definitions/AlertRuleAllOfCondition"
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "An Activity Log Alert rule condition that is met when all its member conditions are met."
},
"description": {
"type": "string",
"description": "A description of this Activity Log Alert rule."
},
"enabled": {
"oneOf": [
{
"type": "boolean",
"default": true
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated."
},
"scopes": {
"oneOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression"
}
],
"description": "A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs that fall under one of these prefixes. This list must include at least one item."
},
"tenantScope": {
"type": "string",
"description": "The tenant GUID. Must be provided for tenant-level and management group events rules."
}
},
"required": [
"actions",
"condition"
],
"description": "An Azure Activity Log Alert rule."
}
}
}
3 changes: 3 additions & 0 deletions schemas/common/autogeneratedResources.json
Original file line number Diff line number Diff line change
Expand Up @@ -13687,6 +13687,9 @@
{
"$ref": "https://schema.management.azure.com/schemas/2023-01-01/Microsoft.Insights.json#/resourceDefinitions/actionGroups"
},
{
"$ref": "https://schema.management.azure.com/schemas/2023-01-01-preview/Microsoft.Insights.json#/resourceDefinitions/activityLogAlerts"
},
{
"$ref": "https://schema.management.azure.com/schemas/2018-09-01/Microsoft.IotCentral.json#/resourceDefinitions/iotApps"
},
Expand Down

0 comments on commit a81b223

Please sign in to comment.