Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 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,344 @@
{
"swagger": "2.0",
"info": {
"title": "ApplicationInsightsManagementClient",
"description": "Azure Application Insights client for Annotations for a component.",
"version": "2015-05-01"
},
"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}/Annotations": {
"get": {
"description": "Gets the list of annotations for a component for given time range",
"operationId": "Annotations_List",
"parameters": [
{
"$ref": "#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceNameParameter"
},
{
"$ref": "#/parameters/StartParameter"
},
{
"$ref": "#/parameters/EndParameter"
}
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Annotation"
}
}
},
"400": {
"description": "Invalid start or end time",
"schema": {
"$ref": "#/definitions/AnnotationCreateError"
}
}
},
"x-ms-examples": {
"AnnotationsList": {
"$ref": "./examples/AnnotationsList.json"
}
},
"x-ms-pageable": {
"nextLinkName": null
}
},
"put": {
"description": "Create an Annotation of an Application Insights component.",
"operationId": "Annotations_Create",
"parameters": [
{
"$ref": "#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceNameParameter"
},
{
"name": "AnnotationProperties",
"description": "Properties that need to be specified to create an annotation of a Application Insights component.",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/Annotation"
}
}
],
"responses": {
"200": {
"description": "An object containing the annotation definition created by this PUT call.",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Annotation"
}
}
},
"409": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove all 4xx related errors and include a "default" model which captures all error responses. Check Batch api spec in this repo. They have a CloudError model.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated this just now in both files.

"description": "Annotation with Id already exists.",
"schema": {
"$ref": "#/definitions/AnnotationCreateError"
}
},
"400": {
"description": "Invalid time",
"schema": {
"$ref": "#/definitions/AnnotationCreateError"
}
}
},
"x-ms-examples": {
"AnnotationsCreate": {
"$ref": "./examples/AnnotationsCreate.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations/{annotationId}": {
"delete": {
"description": "Delete an Annotation of an Application Insights component.",
"operationId": "Annotations_Delete",
"parameters": [
{
"$ref": "#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceNameParameter"
},
{
"$ref": "#/parameters/AnnotationIdParameter"
}
],
"responses": {
"200": {
"description": "The annotation that was successfully deleted.",
"schema": {
}
}
},
"x-ms-examples": {
"AnnotationsDelete": {
"$ref": "./examples/AnnotationsDelete.json"
}
}
},
"get": {
"description": "Get the annotation for given id.",
"operationId": "Annotations_Get",
"parameters": [
{
"$ref": "#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceNameParameter"
},
{
"$ref": "#/parameters/AnnotationIdParameter"
}
],
"responses": {
"200": {
"description": "The Annotation object for this id.",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Annotation"
}
}
},
"404": {
"description": "The Annotation with given id does not exist.",
"schema": {
"$ref": "#/definitions/AnnotationCreateError"
}
}
},
"x-ms-examples": {
"AnnotationsGet": {
"$ref": "./examples/AnnotationsGet.json"
}
}
}
}
},
"definitions": {
"Annotation": {
"type": "object",
"description": "Annotation associated with an application insights resource.",
"properties": {
"AnnotationName": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

all RP specific properties should go inside the "properties" property. Top level allowed properties are id, name, type, tags, location etc.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So properties like category, eventtime etc need to be moved.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is a released version in PROD for 2+ years now. We'll update this in next api-version.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok, since this is existing behavior which will break clients, lets identify the path forward in the next major version update.

"type": "string",
"description": "Name of annotation"
},
"Category": {
"type": "string",
"description": "Category of annotation, free form"
},
"EventTime": {
"type": "string",
"format": "date-time",
"description": "Time when event occurred"
},
"Id": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please make sure all property names are camel cased.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is a released version in PROD for 2+ years now. We'll update this in next api-version.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, please.

"type": "string",
"description": "Unique Id for annotation"
},
"Properties": {
"type": "string",
"description": "Serialized JSON object for detailed properties"
},
"RelatedAnnotation": {
"type": "string",
"description": "Related parent annotation if any",
"default": "null"
}
}
},
"InnerError": {
"type": "object",
"description": "Inner error",
"properties": {
"diagnosticcontext": {
"type": "string",
"description": "Provides correlation for request"
},
"time": {
"type": "string",
"format": "date-time",
"description": "Request time"
}
}
},
"AnnotationCreateError": {
"type": "object",
"description": "Error associated with trying to create annotation with Id that already exist",
"properties": {
"code": {
"type": "string",
"description": "Error detail code and explanation"
},
"message": {
"type": "string",
"description": "Error message"
},
"innererror": {
"$ref": "#/definitions/InnerError"
}
}
}
},
"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"
},
"AnnotationIdParameter": {
"name": "annotationId",
"in": "path",
"required": true,
"type": "string",
"description": "The unique annotation ID. This is unique within a Application Insights component.",
"x-ms-parameter-location": "method"
},
"StartParameter": {
"name": "start",
"in": "query",
"required": true,
"type": "string",
"description": "The start time to query from for annotations, cannot be older than 90 days from current date.",
"x-ms-parameter-location": "method"
},
"EndParameter": {
"name": "end",
"in": "query",
"required": true,
"type": "string",
"description": "The end time to query for annotations.",
"x-ms-parameter-location": "method"
}
}
}
Loading