Skip to content

Commit d27a2c4

Browse files
authored
[Hub Generated] Review request for Microsoft.Insights to add version preview/2021-03-03-preview (#13269)
* Adds base for updating Microsoft.Insights from version preview/2020-10-05-preview to version 2021-03-03-preview * Updates readme * Updates API version in new specs and examples * Add DiagnosticServiceToken API * Update examples to split tokens for readonly vs readwrite * Fix accoding to code review feedback * Update examples due to review feedback from ARM
1 parent c4132e2 commit d27a2c4

File tree

4 files changed

+173
-0
lines changed

4 files changed

+173
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "ApplicationInsightsManagementClient",
5+
"description": "Azure Application Insights client for application insights diagnostic services token.",
6+
"version": "2021-03-03-preview"
7+
},
8+
"host": "management.azure.com",
9+
"schemes": [
10+
"https"
11+
],
12+
"consumes": [
13+
"application/json"
14+
],
15+
"produces": [
16+
"application/json"
17+
],
18+
"security": [
19+
{
20+
"azure_auth": [
21+
"user_impersonation"
22+
]
23+
}
24+
],
25+
"securityDefinitions": {
26+
"azure_auth": {
27+
"type": "oauth2",
28+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
29+
"flow": "implicit",
30+
"description": "Azure Active Directory OAuth2 Flow.",
31+
"scopes": {
32+
"user_impersonation": "impersonate your user account"
33+
}
34+
}
35+
},
36+
"paths": {
37+
"/{resourceUri}/providers/Microsoft.Insights/generateDiagnosticServiceReadOnlyToken": {
38+
"post": {
39+
"tags": [
40+
"generateDiagnosticServiceReadOnlyToken"
41+
],
42+
"operationId": "DiagnosticServiceToken_GetReadOnly",
43+
"description": "Gets an read-only access token for application insights diagnostic service data.",
44+
"parameters": [
45+
{
46+
"$ref": "#/parameters/ResourceUriParameter"
47+
},
48+
{
49+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter"
50+
}
51+
],
52+
"responses": {
53+
"default": {
54+
"description": "Error response describing why the operation failed .",
55+
"schema": {
56+
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
57+
}
58+
},
59+
"200": {
60+
"description": "Successful response containing the application insights diagnostic services token.",
61+
"schema": {
62+
"$ref": "#/definitions/DiagnosticServicesTokenResponse"
63+
}
64+
}
65+
},
66+
"x-ms-examples": {
67+
"Get diagnostic services read-only token for resource": {
68+
"$ref": "./examples/DiagnosticServicesReadOnlyTokenPost.json"
69+
}
70+
}
71+
}
72+
},
73+
"/{resourceUri}/providers/Microsoft.Insights/generateDiagnosticServiceReadWriteToken": {
74+
"post": {
75+
"tags": [
76+
"generateDiagnosticServiceReadWriteToken"
77+
],
78+
"operationId": "DiagnosticServiceToken_GetReadWrite",
79+
"description": "Gets an read-write access token for application insights diagnostic service data.",
80+
"parameters": [
81+
{
82+
"$ref": "#/parameters/ResourceUriParameter"
83+
},
84+
{
85+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter"
86+
}
87+
],
88+
"responses": {
89+
"default": {
90+
"description": "Error response describing why the operation failed .",
91+
"schema": {
92+
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
93+
}
94+
},
95+
"200": {
96+
"description": "Successful response containing the application insights diagnostic services token.",
97+
"schema": {
98+
"$ref": "#/definitions/DiagnosticServicesTokenResponse"
99+
}
100+
}
101+
},
102+
"x-ms-examples": {
103+
"Get diagnostic services read-write token for resource": {
104+
"$ref": "./examples/DiagnosticServicesReadWriteTokenPost.json"
105+
}
106+
}
107+
}
108+
}
109+
},
110+
"definitions": {
111+
"DiagnosticServicesTokenResponse": {
112+
"type": "object",
113+
"properties": {
114+
"token": {
115+
"x-ms-secret": true,
116+
"type": "string",
117+
"description": "JWT token for accessing application insights diagnostic service data."
118+
}
119+
},
120+
"description": "The response to a diagnostic services token query."
121+
}
122+
},
123+
"parameters": {
124+
"ResourceUriParameter": {
125+
"name": "resourceUri",
126+
"in": "path",
127+
"required": true,
128+
"type": "string",
129+
"description": "The identifier of the resource.",
130+
"x-ms-parameter-location": "method",
131+
"x-ms-skip-url-encoding": true
132+
}
133+
}
134+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"parameters": {
3+
"resourceUri": "subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/FabrikamFiberApp/providers/microsoft.insights/components/CustomAvailabilityTest/",
4+
"api-version": "2021-03-03-preview"
5+
},
6+
"responses": {
7+
"200": {
8+
"body": {
9+
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
10+
}
11+
}
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"parameters": {
3+
"resourceUri": "subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/FabrikamFiberApp/providers/microsoft.insights/components/CustomAvailabilityTest/",
4+
"api-version": "2021-03-03-preview"
5+
},
6+
"responses": {
7+
"200": {
8+
"body": {
9+
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
10+
}
11+
}
12+
}
13+
}

specification/applicationinsights/resource-manager/readme.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,21 @@ directive:
201201
reason: 'get workbook list by subscription is not supported'
202202
- suppress: OperationsAPIImplementation
203203
reason: 'Previously implemented operation apis are using an incorrect RP case format which I cannot change.'
204+
- suppress: SECRET_PROPERTY
205+
from: diagnosticServicesToken_API.json
206+
where:
207+
- $.definitions.DiagnosticServicesTokenResponse.properties.token
208+
reason: 'Secrets are OK to return in a POST response.'
204209
```
205210
211+
### Tag: package-preview-2021-03-only
212+
213+
These settings apply only when `--tag=package-preview-2021-03-only` is specified on the command line.
214+
215+
```yaml $(tag) == 'package-preview-2021-03-only'
216+
input-file:
217+
- Microsoft.Insights/preview/2021-03-03-preview/diagnosticServicesToken_API.json
218+
```
206219
### Tag: package-2020-02-12
207220

208221
These settings apply only when `--tag=package-2020-02-12` is specified on the command line.

0 commit comments

Comments
 (0)