Skip to content

Commit 8c7fcf4

Browse files
dulikvorDudi Likvornik
andauthored
OperationalInsights: DataCollectorLogs new api support. (#10365)
* Typo, upper case and other minor corrections. * Lets make all prettier. * Removing redundant property, marking datasourcetype as readonly. * DataCollectors custom logs swagger support. * Update DataCollectorLogs.json * Readme reference, prettier. * Update DataCollectorLogs.json * Segmenting Post request and List response. * Global variable is scoped as method parameter. * More name related changes. * Adding error response. * Refining error contract. * Turning post into delete. * Correcting path. * Adding a point get. Co-authored-by: Dudi Likvornik <[email protected]>
1 parent f758360 commit 8c7fcf4

File tree

5 files changed

+337
-0
lines changed

5 files changed

+337
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "Azure Log Analytics",
5+
"description": "Azure Log Analytics API reference",
6+
"version": "2020-03-01-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+
"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataCollectorLogs/{tableName}": {
38+
"delete": {
39+
"tags": [
40+
"DataCollectorLogs"
41+
],
42+
"x-ms-examples": {
43+
"DataCollectorLogsDelete": {
44+
"$ref": "./examples/DataCollectorLogsDelete.json"
45+
}
46+
},
47+
"operationId": "DataCollectorLogs_Delete",
48+
"description": "Deletes a specify data collector log table.",
49+
"parameters": [
50+
{
51+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter"
52+
},
53+
{
54+
"$ref": "../../../common/v1/types.json#/parameters/WorkspaceNameParameter"
55+
},
56+
{
57+
"name": "tableName",
58+
"in": "path",
59+
"required": true,
60+
"type": "string",
61+
"pattern": "^[A-Za-z0-9]+[A-Za-z0-9]_CL$",
62+
"minLength": 4,
63+
"maxLength": 63,
64+
"description": "DataCollector table name."
65+
},
66+
{
67+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter"
68+
},
69+
{
70+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter"
71+
},
72+
{
73+
"$ref": "#/parameters/ForceDeletion"
74+
}
75+
],
76+
"responses": {
77+
"200": {
78+
"description": "OK response definition."
79+
},
80+
"default": {
81+
"description": "Error response describing why the operation failed.",
82+
"schema": {
83+
"$ref": "#/definitions/ErrorContract"
84+
}
85+
}
86+
}
87+
},
88+
"get": {
89+
"tags": [
90+
"DataCollectorLogs"
91+
],
92+
"x-ms-examples": {
93+
"DataCollectorLogsDelete": {
94+
"$ref": "./examples/DataCollectorLogsGet.json"
95+
}
96+
},
97+
"operationId": "DataCollectorLogs_Get",
98+
"description": "Retrieves a specify data collector log table.",
99+
"parameters": [
100+
{
101+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter"
102+
},
103+
{
104+
"$ref": "../../../common/v1/types.json#/parameters/WorkspaceNameParameter"
105+
},
106+
{
107+
"name": "tableName",
108+
"in": "path",
109+
"required": true,
110+
"type": "string",
111+
"pattern": "^[A-Za-z0-9]+[A-Za-z0-9]_CL$",
112+
"minLength": 4,
113+
"maxLength": 63,
114+
"description": "DataCollector table name."
115+
},
116+
{
117+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter"
118+
},
119+
{
120+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter"
121+
},
122+
{
123+
"$ref": "#/parameters/ForceDeletion"
124+
}
125+
],
126+
"responses": {
127+
"200": {
128+
"description": "OK response definition.",
129+
"schema": {
130+
"$ref": "#/definitions/DataCollectorLog"
131+
}
132+
},
133+
"default": {
134+
"description": "Error response describing why the operation failed.",
135+
"schema": {
136+
"$ref": "#/definitions/ErrorContract"
137+
}
138+
}
139+
}
140+
}
141+
},
142+
"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataCollectorLogs": {
143+
"get": {
144+
"tags": [
145+
"DataCollectorLogs"
146+
],
147+
"description": "Listing all data collector log tables, being created via data collector endpoint and scoped to the specified workspace",
148+
"operationId": "DataCollectorLogs_ListByWorkspace",
149+
"parameters": [
150+
{
151+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter"
152+
},
153+
{
154+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter"
155+
},
156+
{
157+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter"
158+
},
159+
{
160+
"$ref": "../../../common/v1/types.json#/parameters/WorkspaceNameParameter"
161+
}
162+
],
163+
"responses": {
164+
"200": {
165+
"description": "OK response definition.",
166+
"schema": {
167+
"$ref": "#/definitions/DataCollectorLogsListResult"
168+
}
169+
},
170+
"default": {
171+
"description": "Error response describing why the operation failed.",
172+
"schema": {
173+
"$ref": "#/definitions/ErrorContract"
174+
}
175+
}
176+
},
177+
"x-ms-pageable": {
178+
"nextLinkName": null
179+
},
180+
"x-ms-examples": {
181+
"DataCollectorLogsListByWorkspace": {
182+
"$ref": "./examples/DataCollectorLogsListByWorkspace.json"
183+
}
184+
}
185+
}
186+
}
187+
},
188+
"definitions": {
189+
"DataCollectorLogProperties": {
190+
"description": "Data collector log properties.",
191+
"type": "object",
192+
"properties": {
193+
"name": {
194+
"description": "Table's name.",
195+
"type": "string"
196+
}
197+
}
198+
},
199+
"DataCollectorLog": {
200+
"properties": {
201+
"properties": {
202+
"x-ms-client-flatten": true,
203+
"$ref": "#/definitions/DataCollectorLogProperties",
204+
"description": "Data collector log properties."
205+
}
206+
},
207+
"allOf": [
208+
{
209+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ProxyResource"
210+
}
211+
],
212+
"description": "Data collector log top level resource container."
213+
},
214+
"DataCollectorLogsListResult": {
215+
"properties": {
216+
"value": {
217+
"type": "array",
218+
"items": {
219+
"$ref": "#/definitions/DataCollectorLog"
220+
},
221+
"description": "data collector log collection."
222+
}
223+
},
224+
"description": "Data collector log tables collection, all tables are scoped to the specified workspace."
225+
},
226+
"ErrorContract": {
227+
"properties": {
228+
"error": {
229+
"description": "The details of the error.",
230+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse"
231+
}
232+
},
233+
"description": "Contains details when the response code indicates an error."
234+
}
235+
},
236+
"parameters": {
237+
"ForceDeletion": {
238+
"name": "force",
239+
"in": "query",
240+
"required": false,
241+
"type": "boolean",
242+
"description": "When true, enables bypassing retention validation.",
243+
"x-ms-parameter-location": "method"
244+
}
245+
}
246+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"parameters": {
3+
"resourceGroupName": "mms-eus",
4+
"workspaceName": "testDataCollectorLogsWS",
5+
"tableName": "Test_CL",
6+
"api-version": "2020-03-01-preview",
7+
"subscriptionId": "00000000-0000-0000-0000-00000000000"
8+
},
9+
"responses": {
10+
"200": {}
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"parameters": {
3+
"resourceGroupName": "mms-eus",
4+
"workspaceName": "testDataCollectorLogsWS",
5+
"tableName": "Test_CL",
6+
"api-version": "2020-03-01-preview",
7+
"subscriptionId": "00000000-0000-0000-0000-00000000000"
8+
},
9+
"responses": {
10+
"200": {
11+
"body": {
12+
"properties": {
13+
"name": "Table0_CL"
14+
},
15+
"id": "/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testDataCollectorLogsWS/dataCollectorLogs/Test_CL",
16+
"name": "Test_CL",
17+
"type": "Microsoft.OperationalInsights/workspaces/dataCollectorLogs"
18+
}
19+
}
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"parameters": {
3+
"resourceGroupName": "mms-eus",
4+
"workspaceName": "testDataCollectorLogsWS",
5+
"api-version": "2020-03-01-preview",
6+
"subscriptionId": "00000000-0000-0000-0000-00000000000"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"value": [
12+
{
13+
"properties": {
14+
"name": "Table0_CL"
15+
},
16+
"id": "/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testDataCollectorLogsWS/dataCollectorLogs/Table0_CL",
17+
"name": "Table0_CL",
18+
"type": "Microsoft.OperationalInsights/workspaces/dataCollectorLogs"
19+
},
20+
{
21+
"properties": {
22+
"name": "Table1_CL"
23+
},
24+
"id": "/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testDataCollectorLogsWS/dataCollectorLogs/Table1_CL",
25+
"name": "Table1_CL",
26+
"type": "Microsoft.OperationalInsights/workspaces/dataCollectorLogs"
27+
},
28+
{
29+
"properties": {
30+
"name": "Table2_CL"
31+
},
32+
"id": "/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testDataCollectorLogsWS/dataCollectorLogs/Table2_CL",
33+
"name": "Table2_CL",
34+
"type": "Microsoft.OperationalInsights/workspaces/dataCollectorLogs"
35+
},
36+
{
37+
"properties": {
38+
"name": "Table3_CL"
39+
},
40+
"id": "/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testDataCollectorLogsWS/dataCollectorLogs/Table3_CL",
41+
"name": "Table3_CL",
42+
"type": "Microsoft.OperationalInsights/workspaces/dataCollectorLogs"
43+
},
44+
{
45+
"properties": {
46+
"name": "Table4_CL"
47+
},
48+
"id": "/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testDataCollectorLogsWS/dataCollectorLogs/Table4_CL",
49+
"name": "Table4_CL",
50+
"type": "Microsoft.OperationalInsights/workspaces/dataCollectorLogs"
51+
}
52+
]
53+
}
54+
}
55+
}
56+
}

specification/operationalinsights/resource-manager/readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ These settings apply only when `--tag=package-2020-03-preview` is specified on t
7070
input-file:
7171
- Microsoft.OperationalInsights/preview/2020-03-01-preview/DataExports.json
7272
- Microsoft.OperationalInsights/preview/2020-03-01-preview/DataSources.json
73+
- Microsoft.OperationalInsights/preview/2020-03-01-preview/DataCollectorLogs.json
7374
- Microsoft.OperationalInsights/preview/2020-03-01-preview/IntelligencePacks.json
7475
- Microsoft.OperationalInsights/preview/2020-03-01-preview/LinkedServices.json
7576
- Microsoft.OperationalInsights/preview/2020-03-01-preview/LinkedStorageAccounts.json
@@ -237,6 +238,7 @@ input-file:
237238
- $(this-folder)/Microsoft.OperationalInsights/preview/2019-08-01-preview/OperationalInsights.json
238239
- $(this-folder)/Microsoft.OperationalInsights/preview/2020-03-01-preview/DataExports.json
239240
- $(this-folder)/Microsoft.OperationalInsights/preview/2020-03-01-preview/DataSources.json
241+
- $(this-folder)/Microsoft.OperationalInsights/preview/2020-03-01-preview/DataCollectorLogs.json
240242
- $(this-folder)/Microsoft.OperationalInsights/preview/2020-03-01-preview/IntelligencePacks.json
241243
- $(this-folder)/Microsoft.OperationalInsights/preview/2020-03-01-preview/LinkedServices.json
242244
- $(this-folder)/Microsoft.OperationalInsights/preview/2020-03-01-preview/LinkedStorageAccounts.json

0 commit comments

Comments
 (0)