-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add swagger for annotation and work item config api for microsoft.insights components namespace for api version 2015-05-01 #2384
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
Changes from 16 commits
4e685d3
724d58a
1336db6
e41b658
74015ef
3c9eb16
d65c3df
109cec0
62334ee
872b444
beb1e96
f7c2334
a39d1a0
c284f75
e89fc31
d73b422
a07c46b
ae8994b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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": { | ||
| "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": { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So properties like category, eventtime etc need to be moved.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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": { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please make sure all property names are camel cased.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.