Definitions for @turbot/azure-monitor

actionGroup

{
"allOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string"
},
"location": {
"type": "string"
},
"tags": {
"type": "object"
},
"groupShortName": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"emailReceivers": {
"type": "array",
"items": {
"properties": {
"name": {
"type": "string"
},
"emailAddress": {
"type": "string"
},
"useCommonAlertSchema": {
"type": "boolean"
},
"status": {
"type": "string"
}
}
}
},
"smsReceivers": {
"type": "array"
},
"webhookReceivers": {
"type": "array"
},
"itsmReceivers": {
"type": "array"
},
"azureAppPushReceivers": {
"type": "array"
},
"automationRunbookReceivers": {
"type": "array"
},
"voiceReceivers": {
"type": "array"
},
"logicAppReceivers": {
"type": "array"
},
"azureFunctionReceivers": {
"type": "array"
},
"armRoleReceivers": {
"type": "array"
},
"resourceGroupName": {
"type": "string"
},
"subscriptionId": {
"type": "string"
},
"api-version": {
"type": "string"
},
"name": {
"$ref": "#/definitions/actionGroupName"
},
"turbot": {
"type": "object",
"properties": {
"akas": {
"type": "array",
"items": {
"$ref": "#/definitions/actionGroupAka"
}
},
"title": {
"$ref": "#/definitions/actionGroupName"
},
"custom": {
"type": "object",
"properties": {
"azure": {
"$ref": "azure#/definitions/azureMetadata"
},
"createTimestamp": {
"$ref": "turbot#/definitions/isoTimestamp"
}
}
}
}
}
},
"additionalProperties": true,
"tests": [
{
"description": "Base - All valid Properties",
"input": {
"name": "test01",
"turbot": {
"akas": [
"azure:///subscriptions/9e3548cf-17e2-4751-b87e-b72bdd2c77f7/resourceGroups/dev/providers/Microsoft.Insights/actionGroups/test"
],
"title": "test01",
"custom": {
"azure": {
"subscriptionId": "9e3548cf-17e2-4751-b87e-b72bdd2c77f7",
"resourceGroupsName": "dev"
}
}
}
}
},
{
"description": "Invalid - activityLogAlert name empty",
"input": {
"name": "",
"turbot": {
"akas": [
"azure:///subscriptions/9e3548cf-17e2-4751-b87e-b72bdd2c77f7/resourceGroups/dev/providers/Microsoft.Insights/actionGroups/abc"
],
"title": "",
"custom": {
"azure": {
"subscriptionId": "9e3548cf-17e2-4751-b87e-b72bdd2c77f7",
"resourceGroupsName": "dev"
}
}
}
},
"expected": false
},
{
"description": "Invalid - name missing",
"input": {
"turbot": {
"akas": [
"azure:///subscriptions/9e3548cf-17e2-4751-b87e-b72bdd2c77f7/resourceGroups/dev/providers/Microsoft.monitoractivityLogAlerts/abc"
],
"title": "test-02",
"custom": {
"azure": {
"subscriptionId": "9e3548cf-17e2-4751-b87e-b72bdd2c77f7",
"resourceGroupsName": "dev"
}
}
}
},
"expected": false
}
]
}
],
".turbot": {
"uri": "tmod:@turbot/azure-monitor#/definitions/actionGroup",
"modUri": "tmod:@turbot/azure-monitor"
}
}

actionGroupAka

{
"type": "string",
"pattern": "^azure:///subscriptions/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/resourceGroups/[A-Za-z0-9-_().]*[A-Za-z0-9-_()]/providers/Microsoft.Insights/actionGroups/([^<>*#%&:?+\\/]{1,60})$",
"tests": [
{
"descritpion": "base case",
"input": "azure:///subscriptions/9e3548cf-17e2-4751-b87e-b72bdd2c77f7/resourceGroups/dev/providers/Microsoft.Insights/actionGroups/test"
},
{
"description": "invalid - Wrong Account id",
"input": "azure:///subscriptions/9e3548cf-17e2-4751-b87e-b72bdd2c77f7uytgfhgfn/resourceGroups/dev/providers/Microsoft.Insights/actionGroups/abc",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/azure-monitor#/definitions/actionGroupAka",
"modUri": "tmod:@turbot/azure-monitor"
}
}

actionGroupName

{
"type": "string",
"pattern": "^([^<>*%&:?+\\/#]{1,60})$",
"tests": [
{
"descritpion": "base case",
"input": "test-@01"
},
{
"description": "invalid - does not support triangular braces, asterisk, ampersand, colon, slashes, question mark, plus sign and hash",
"input": "test<>*%&\"\":?",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/azure-monitor#/definitions/actionGroupName",
"modUri": "tmod:@turbot/azure-monitor"
}
}

actionGroupServiceNow

{
"defaultColumns": {
"resource_group": {
"type": "string",
"size": 200,
"column": "enabled",
"path": "metadata.azure.resourceGroupName"
},
"subscription_id": {
"column": "enabled",
"label": "Subscription ID",
"path": "metadata.azure.subscriptionId"
},
"id": {
"column": "enabled",
"label": "ID"
},
"type": {
"column": "enabled"
},
"action_group_location": {
"column": "enabled",
"path": "data.location",
"label": "Location"
},
"action_group_name": {
"column": "enabled",
"label": "Name",
"path": "data.name"
},
"group_short_name": {
"column": "enabled",
"type": "string"
},
"logic_app_receivers": {
"column": "enabled",
"type": "string",
"size": 1000
},
"voice_receivers": {
"path": "data.voiceReceivers",
"column": "enabled",
"type": "string",
"size": 1000
},
"webhook_receivers": {
"path": "data.webhookReceivers",
"column": "enabled",
"type": "string",
"size": 1000
},
"tags": {
"column": "enabled",
"label": "Tags",
"type": "string",
"size": 1000
}
},
".turbot": {
"uri": "tmod:@turbot/azure-monitor#/definitions/actionGroupServiceNow",
"modUri": "tmod:@turbot/azure-monitor"
}
}

alertAka

{
"type": "string",
"pattern": "^azure:///subscriptions/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/resourceGroups/[A-Za-z0-9-_().]*[A-Za-z0-9-_()]/providers/Microsoft.Insights/activityLogAlerts/([^<>*%&:?+\\/]{1,128})$",
"tests": [
{
"descritpion": "base case",
"input": "azure:///subscriptions/9e3548cf-17e2-4751-b87e-b72bdd2c77f7/resourceGroups/dev/providers/Microsoft.Insights/activityLogAlerts/test"
},
{
"description": "invalid - Wrong Account id",
"input": "azure:///subscriptions/9e3548cf-17e2-4751-b87e-b72bdd2c77f7uytgfhgfn/resourceGroups/dev/providers/Microsoft.Insights/activityLogAlerts/abc",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/azure-monitor#/definitions/alertAka",
"modUri": "tmod:@turbot/azure-monitor"
}
}

alertName

{
"type": "string",
"pattern": "^([^<>*%&:?+\\/]{1,128})$",
"tests": [
{
"descritpion": "base case",
"input": "test-01"
},
{
"description": "invalid - does not support triangular braces, asterisk, ampersand, colon, slashes, question mark and plus sign",
"input": "test<>*%&:?",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/azure-monitor#/definitions/alertName",
"modUri": "tmod:@turbot/azure-monitor"
}
}

alerts

{
"allOf": [
{
"type": "object",
"properties": {
"name": {
"$ref": "#/definitions/alertName"
},
"id": {
"type": "string"
},
"location": {
"type": "string"
},
"scopes": {
"type": "array"
},
"enabled": {
"type": "boolean"
},
"condition": {
"type": "object"
},
"actions": {
"type": "object"
},
"description": {
"type": "string"
},
"kind": {
"type": "string"
},
"identity": {
"type": "string"
},
"turbot": {
"type": "object",
"properties": {
"akas": {
"type": "array",
"items": {
"$ref": "#/definitions/alertAka"
}
},
"title": {
"$ref": "#/definitions/alertName"
},
"custom": {
"type": "object",
"properties": {
"azure": {
"$ref": "azure#/definitions/azureMetadata"
},
"createTimestamp": {
"$ref": "turbot#/definitions/isoTimestamp"
}
}
}
}
}
},
"additionalProperties": true,
"tests": [
{
"description": "Base - All valid Properties",
"input": {
"name": "test01",
"turbot": {
"akas": [
"azure:///subscriptions/9e3548cf-17e2-4751-b87e-b72bdd2c77f7/resourceGroups/dev/providers/Microsoft.Insights/activityLogAlerts/test"
],
"title": "test01",
"custom": {
"azure": {
"subscriptionId": "9e3548cf-17e2-4751-b87e-b72bdd2c77f7",
"resourceGroupsName": "dev"
}
}
}
}
},
{
"description": "Invalid - activityLogAlert name empty",
"input": {
"name": "",
"turbot": {
"akas": [
"azure:///subscriptions/9e3548cf-17e2-4751-b87e-b72bdd2c77f7/resourceGroups/dev/providers/Microsoft.Insights/activityLogAlerts/abc"
],
"title": "",
"custom": {
"azure": {
"subscriptionId": "9e3548cf-17e2-4751-b87e-b72bdd2c77f7",
"resourceGroupsName": "dev"
}
}
}
},
"expected": false
},
{
"description": "Invalid - name missing",
"input": {
"turbot": {
"akas": [
"azure:///subscriptions/9e3548cf-17e2-4751-b87e-b72bdd2c77f7/resourceGroups/dev/providers/Microsoft.monitoractivityLogAlerts/abc"
],
"title": "test-02",
"custom": {
"azure": {
"subscriptionId": "9e3548cf-17e2-4751-b87e-b72bdd2c77f7",
"resourceGroupsName": "dev"
}
}
}
},
"expected": false
}
]
}
],
".turbot": {
"uri": "tmod:@turbot/azure-monitor#/definitions/alerts",
"modUri": "tmod:@turbot/azure-monitor"
}
}

alertsServiceNow

{
"defaultColumns": {
"resource_group": {
"type": "string",
"size": 200,
"column": "enabled",
"path": "metadata.azure.resourceGroupName"
},
"subscription_id": {
"column": "enabled",
"label": "Subscription ID",
"path": "metadata.azure.subscriptionId"
},
"id": {
"column": "enabled",
"label": "ID"
},
"type": {
"column": "enabled"
},
"actions": {
"column": "enabled",
"path": "data.actions"
},
"condition": {
"column": "enabled"
},
"alerts_location": {
"column": "enabled",
"path": "data.location",
"label": "Location"
},
"alerts_name": {
"column": "enabled",
"label": "Name",
"path": "data.name"
},
"tags": {
"column": "enabled",
"label": "Tags",
"type": "string",
"size": 1000
}
},
".turbot": {
"uri": "tmod:@turbot/azure-monitor#/definitions/alertsServiceNow",
"modUri": "tmod:@turbot/azure-monitor"
}
}

logProfile

{
"type": "object",
"properties": {
"name": {
"$ref": "#/definitions/logProfileName"
},
"id": {
"type": "string"
},
"location": {
"type": "string"
},
"storageAccountId": {
"type": "string"
},
"serviceBusRuleId": {
"type": "string"
},
"locations": {
"type": "array"
},
"categories": {
"type": "array"
},
"retentionPolicy": {
"type": "object"
},
"kind": {
"type": "string"
},
"identity": {
"type": "string"
},
"turbot": {
"type": "object",
"properties": {
"createTimestamp": {
"$ref": "turbot#/definitions/isoTimestamp"
},
"akas": {
"type": "array",
"items": {
"$ref": "#/definitions/logProfileAka"
}
},
"title": {
"$ref": "#/definitions/logProfileName"
},
"custom": {
"type": "object",
"properties": {
"createTimestamp": {
"$ref": "turbot#/definitions/isoTimestamp"
},
"azure": {
"$ref": "azure#/definitions/azureMetadata"
}
}
}
}
}
},
"additionalProperties": true,
"tests": [
{
"description": "Base - All valid Properties",
"input": {
"name": "test01",
"turbot": {
"akas": [
"azure:///subscriptions/9e3548cf-17e2-4751-b87e-b72bdd2c77f7/providers/Microsoft.Insights/logprofiles/test01"
],
"title": "test01",
"custom": {
"azure": {
"subscriptionId": "9e3548cf-17e2-4751-b87e-b72bdd2c77f7"
}
}
}
}
},
{
"description": "Invalid - empty string passed in name",
"input": {
"name": "",
"turbot": {
"akas": [
"azure:///subscriptions/9e3548cf-17e2-4751-b87e-b72bdd2c77f7/providers/Microsoft.Insights/logProfiles/abc"
],
"title": "",
"custom": {
"azure": {
"subscriptionId": "9e3548cf-17e2-4751-b87e-b72bdd2c77f7"
}
}
}
},
"expected": false
},
{
"description": "Invalid - name missing",
"input": {
"turbot": {
"akas": [
"azure:///subscriptions/9e3548cf-17e2-4751-b87e-b72bdd2c77f7/providers/Microsoft.Insights/logProfiles/abc"
],
"title": "test-02",
"custom": {
"azure": {
"subscriptionId": "9e3548cf-17e2-4751-b87e-b72bdd2c77f7"
}
}
}
},
"expected": false
},
{
"description": "Invalid - turbot data not passed",
"input": {
"name": "teste01"
}
}
],
".turbot": {
"uri": "tmod:@turbot/azure-monitor#/definitions/logProfile",
"modUri": "tmod:@turbot/azure-monitor"
}
}

logProfileAka

{
"type": "string",
"pattern": "^azure:///subscriptions/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/providers/Microsoft.Insights/logprofiles/([a-z0-9]+)$",
"tests": [
{
"descritpion": "base case",
"input": "azure:///subscriptions/9e3548cf-17e2-4751-b87e-b72bdd2c77f7/providers/Microsoft.Insights/logprofiles/test"
},
{
"description": "invalid - Wrong Account id",
"input": "azure:///subscriptions/9e3548cf-17e2-4751-b87e-b72bdd2c77f7uytgfhgfn/providers/Microsoft.Insights/logprofiles/abc",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/azure-monitor#/definitions/logProfileAka",
"modUri": "tmod:@turbot/azure-monitor"
}
}

logProfileName

{
"type": "string",
"pattern": "^[a-z0-9]+$",
"tests": [
{
"descritpion": "base case",
"input": "test1"
},
{
"description": "invalid - does not support triangular braces, asterisk, ampersand, colon, slashes, question mark, plus sign and hash",
"input": "test<>*%&\"\":?",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/azure-monitor#/definitions/logProfileName",
"modUri": "tmod:@turbot/azure-monitor"
}
}

logProfileServiceNow

{
"defaultColumns": {
"subscription_id": {
"column": "enabled",
"label": "Subscription ID",
"path": "metadata.azure.subscriptionId"
},
"id": {
"column": "enabled",
"label": "ID"
},
"categories": {
"column": "enabled"
},
"retention_policy": {
"column": "enabled",
"type": "string",
"size": 1000
},
"storage_account_id": {
"column": "enabled",
"label": "Storage Account ID",
"type": "string"
},
"log_profile_locations": {
"column": "enabled",
"label": "Location",
"path": "data.locations"
},
"log_profile_name": {
"column": "enabled",
"label": "Name",
"path": "data.name"
},
"tags": {
"column": "enabled",
"label": "Tags",
"type": "string",
"size": 1000
}
},
".turbot": {
"uri": "tmod:@turbot/azure-monitor#/definitions/logProfileServiceNow",
"modUri": "tmod:@turbot/azure-monitor"
}
}

monitor

{
"allOf": [
{
"$ref": "turbot#/definitions/service"
},
{
"type": "object",
"properties": {
"turbot": {
"type": "object",
"properties": {
"akas": {
"type": "array",
"items": {
"$ref": "#/definitions/monitorAka"
}
},
"title": {
"const": "Monitor"
},
"custom": {
"type": "object",
"properties": {
"azure": {
"$ref": "azure#/definitions/azureMetadata"
}
}
}
}
}
},
"required": [
"turbot"
],
"additionalProperties": true,
"tests": [
{
"description": "base",
"input": {
"turbot": {
"akas": [
"azure:///subscriptions/ec7a5a3a-4225-474f-9dbe-bf477c8ea51b/providers/Microsoft.Insights/services/monitor"
],
"title": "Monitor",
"custom": {
"azure": {
"subscriptionId": "ec7a5a3a-4225-474f-9dbe-bf477c8ea51b"
}
}
}
}
},
{
"description": "invalid - wrong title",
"input": {
"turbot": {
"akas": [
"azure:///subscriptions/ec7a5a3a-4225-474f-9dbe-bf477c8ea51b/providers/Microsoft.Insights/services/monitor"
],
"title": "Monitor",
"custom": {
"azure": {
"subscriptionId": "ec7a5a3a-4225-474f-9dbe-bf477c8ea51b"
}
}
}
},
"expected": false
}
]
}
],
".turbot": {
"uri": "tmod:@turbot/azure-monitor#/definitions/monitor",
"modUri": "tmod:@turbot/azure-monitor"
}
}

monitorAka

{
"type": "string",
"pattern": "^azure:///subscriptions/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/providers/Microsoft.Insights/services/monitor",
"tests": [
{
"descritpion": "base case",
"input": "azure:///subscriptions/9e3548cf-17e2-4751-b87e-b72bdd2c77f7/providers/Microsoft.Insights/services/monitor"
},
{
"description": "invalid - account ID too long",
"input": "^azure:///subscriptions/9e3548cf-17e2-4751-b87e-b72bdd2c77f7jfhsjkds/monitor",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/azure-monitor#/definitions/monitorAka",
"modUri": "tmod:@turbot/azure-monitor"
}
}