Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new version for proactive detection config #3224

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,315 @@
{
"swagger": "2.0",
"info": {
"title": "ApplicationInsightsManagementClient",
"description": "Azure Application Insights client for ProactiveDetection configurations of a component.",
"version": "2018-05-01-preview"
},
"host": "management.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"security": [
{
"azure_auth": [
"user_impersonation"
]
}
],
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"flow": "implicit",
"description": "Azure Active Directory OAuth2 Flow.",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
},
"paths": {
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete API missing. If this is a tracked resource type, patch also MUST be supported atleast for the update of tags but preferably to allow update of any patachable properties.

{
"get": {
"description": "Gets a list of ProactiveDetection configurations of an Application Insights component.",
"operationId": "ProactiveDetectionConfigurations_List",
"parameters": [
{
"$ref": "#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceNameParameter"
}
],
"responses": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a default response to capture the error responses. The schema should match the ARm error contract schema. Example can be found in Batch RP swagger.

"200": {
"description":
"A list containing 0 or more ProactiveDetection configurations of an Application Insights component.",
"schema": {
"$ref": "#/definitions/ApplicationInsightsComponentProactiveDetectionConfigurationListResult"
}
}
},
"x-ms-examples": {
"ProactiveDetectionConfigurationsList": {
"$ref": "./examples/ProactiveDetectionConfigurationsList.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}":
{
"get": {
"description": "Get the ProactiveDetection configuration for this configuration id.",
"operationId": "ProactiveDetectionConfigurations_Get",
"parameters": [
{
"$ref": "#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceNameParameter"
},
{
"$ref": "#/parameters/ConfigurationId"
}
],
"responses": {
"200": {
"description": "The ProactiveDetection configuration for this configuration id.",
"schema": {
"$ref": "#/definitions/ApplicationInsightsComponentProactiveDetectionConfiguration"
}
}
},
"x-ms-examples": {
"ProactiveDetectionConfigurationGet": {
"$ref": "./examples/ProactiveDetectionConfigurationGet.json"
}
}
},
"put": {
"description": "Update the ProactiveDetection configuration for this configuration id.",
"operationId": "ProactiveDetectionConfigurations_Update",
"parameters": [
{
"$ref": "#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceNameParameter"
},
{
"$ref": "#/parameters/ConfigurationId"
},
{
"name": "ProactiveDetectionProperties",
"description": "Properties that need to be specified to update the ProactiveDetection configuration.",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/ApplicationInsightsComponentProactiveDetectionConfiguration"
}
}
],
"responses": {
"200": {
"description": "The ProactiveDetection configuration that was successfully updated.",
"schema": {
"$ref": "#/definitions/ApplicationInsightsComponentProactiveDetectionConfiguration"
}
}
},
"x-ms-examples": {
"ProactiveDetectionConfigurationUpdate": {
"$ref": "./examples/ProactiveDetectionConfigurationUpdate.json"
}
}
}
}
},
"definitions": {
"ApplicationInsightsComponentProactiveDetectionConfigurationListResult": {
"description": "A list of ProactiveDetection configurations.",
"type": "array",
"items": {
"$ref": "#/definitions/ApplicationInsightsComponentProactiveDetectionConfiguration"
}
},
"ApplicationInsightsComponentProactiveDetectionConfiguration": {
"description": "A ProactiveDetection configuration definition.",
"type": "object",
"x-ms-azure-resource": true,
"properties": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"tags" ARM top level property missing? Is this a tracked or proxy resource? Seems tracked since it has a location property

"id": {
"type": "string",
"readOnly": true,
"description": "Azure resource Id"
},
"name": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should also be readonly as it comes from the URL

"type": "string",
"description": "Azure resource name"
},
"type": {
"type": "string",
"readOnly": true,
"description": "Azure resource type"
},
"location": {
"type": "string",
"description": "Resource location"
},
"properties": {
"description": "Properties that define a ProactiveDetection configuration.",
"x-ms-client-flatten": true,
"$ref": "#/definitions/ApplicationInsightsComponentProactiveDetectionConfigurationProperties"
}
}
},
"ApplicationInsightsComponentProactiveDetectionConfigurationProperties": {
"description": "Properties that define a ProactiveDetection configuration.",
"type": "object",
"properties": {
"Name": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is this name different from the one outside of properties? If different, please call this something else like ruleName

"type": "string",
"readOnly": false,
"description": "The rule name"
},
"Enabled": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bools are typically not recommended. String enums generally work better.

"type": "boolean",
"readOnly": false,
"description": "A flag that indicates whether this rule is enabled by the user"
},
"SendEmailsToSubscriptionOwners": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above.

"type": "boolean",
"readOnly": false,
"description":
"A flag that indicated whether notifications on this rule should be sent to subscription owners"
},
"CustomEmails": {
"type": "array",
"readOnly": false,
"description": "Custom email addresses for this rule notifications",
"items": {
"type": "string"
}
},
"LastUpdatedTime": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readonly should be true

"type": "string",
"readOnly": false,
"description": "The last time this rule was updated"
},
"RuleDefinitions": {
"type": "object",
"readOnly": false,
"description":
"Static definitions of the ProactiveDetection configuration rule (same values for all components).",
"properties": {
"Name": {
"type": "string",
"readOnly": false,
"description": "The rule name"
},
"DisplayName": {
"type": "string",
"readOnly": false,
"description": "The rule name as it is displayed in UI"
},
"Description": {
"type": "string",
"readOnly": false,
"description": "The rule description"
},
"HelpUrl": {
"type": "string",
"readOnly": false,
"description": "URL which displays aditional info about the proactive detection rule"
},
"IsHidden": {
"type": "boolean",
"readOnly": false,
"description": "A flag indicating whether the rule is hidden (from the UI)"
},
"IsEnabledByDefault": {
"type": "boolean",
"readOnly": false,
"description": "A flag indicating whether the rule is enabled by default"
},
"IsInPreview": {
"type": "boolean",
"readOnly": false,
"description": "A flag indicating whether the rule is in preview"
},
"SupportsEmailNotifications": {
"type": "boolean",
"readOnly": false,
"description": "A flag indicating whether email notifications are supported for detections for this rule"
}
}
}
}
}
},
"parameters": {
"SubscriptionIdParameter": {
"name": "subscriptionId",
"in": "path",
"required": true,
"type": "string",
"description": "The Azure subscription ID."
},
"ApiVersionParameter": {
"name": "api-version",
"in": "query",
"required": true,
"type": "string",
"description": "Client Api Version."
},
"ResourceGroupNameParameter": {
"name": "resourceGroupName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the resource group.",
"x-ms-parameter-location": "method"
},
"ResourceNameParameter": {
"name": "resourceName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the Application Insights component resource.",
"x-ms-parameter-location": "method"
},
"ConfigurationId": {
"name": "ConfigurationId",
"in": "path",
"required": true,
"type": "string",
"description": "The ProactiveDetection configuration ID. This is unique within a Application Insights component.",
"x-ms-parameter-location": "method"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"parameters": {
"api-version": "2018-05-01-preview",
"subscriptionId": "subid",
"resourceGroupName": "my-resource-group",
"resourceName": "my-component",
"ConfigurationId": "slowpageloadtime"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/subid/resourceGroups/my-resource-group/providers/microsoft.insights/components/my-component/ProactiveDetectionConfigs/slowpageloadtime",
"type": "Microsoft.Insights/components/ProactiveDetectionConfigs",
"name": "slowpageloadtime",
"location": "South Central US",
"properties": {
"Name": "slowpageloadtime",
"Enabled": true,
"SendEmailsToSubscriptionOwners": true,
"CustomEmails": [ "[email protected]", "[email protected]" ],
"LastUpdatedTime": null,
"RuleDefinitions": {
"Name": "slowpageloadtime",
"DisplayName": "Slow page load time",
"Description": "Smart Detection rules notify you of performance anomaly issues.",
"HelpUrl": "https://docs.microsoft.com/en-us/azure/application-insights/app-insights-proactive-performance-diagnostics",
"IsHidden": false,
"IsEnabledByDefault": true,
"IsInPreview": false,
"SupportsEmailNotifications": true
}
}
}
}
}
}

Loading