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

OperationalInsights: DataCollectorLogs new api support. #10365

Merged
merged 16 commits into from
Aug 24, 2020
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
{
"swagger": "2.0",
"info": {
"title": "Azure Log Analytics",
"description": "Azure Log Analytics API reference",
dulikvor marked this conversation as resolved.
Show resolved Hide resolved
"version": "2020-03-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.OperationalInsights/workspaces/{workspaceName}/dataCollectorLogs/{tableName}": {
"delete": {
"tags": [
"DataCollectorLogs"
],
"x-ms-examples": {
"DataCollectorLogsDelete": {
"$ref": "./examples/DataCollectorLogsDelete.json"
}
},
"operationId": "DataCollectorLogs_Delete",
dulikvor marked this conversation as resolved.
Show resolved Hide resolved
"description": "Deletes a specify data collector log table.",
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "../../../common/v1/types.json#/parameters/WorkspaceNameParameter"
},
{
"name": "tableName",
"in": "path",
"required": true,
"type": "string",
"pattern": "^[A-Za-z0-9]+[A-Za-z0-9]_CL$",
"minLength": 4,
"maxLength": 63,
"description": "DataCollector table name."
},
{
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/ForceDeletion"
}
],
"responses": {
"200": {
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the response of this post action?

Copy link
Contributor

Choose a reason for hiding this comment

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

please add the response schema.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no schema, just 200 since its basically a delete.

"description": "OK response definition."
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorContract"
}
}
dulikvor marked this conversation as resolved.
Show resolved Hide resolved
}
},
"get": {
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 the POST different from this GET? the API signature is same.

Copy link
Contributor

Choose a reason for hiding this comment

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

so the scenario is user lists the tables and then you want to give them the option to delete them. In that case, your POST should be changed to a DELETE, and they can provide the tableName that they want to delete. Much cleaner approach. POST for delete is ugly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we do not support full CRUD, is it fine if i will supply delete and get and no put? this is why we used post instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, it will be ok to have GET and DELETE

"tags": [
"DataCollectorLogs"
],
"x-ms-examples": {
"DataCollectorLogsDelete": {
"$ref": "./examples/DataCollectorLogsGet.json"
}
},
"operationId": "DataCollectorLogs_Get",
"description": "Retrieves a specify data collector log table.",
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "../../../common/v1/types.json#/parameters/WorkspaceNameParameter"
},
{
"name": "tableName",
"in": "path",
"required": true,
"type": "string",
"pattern": "^[A-Za-z0-9]+[A-Za-z0-9]_CL$",
"minLength": 4,
"maxLength": 63,
"description": "DataCollector table name."
},
{
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/ForceDeletion"
}
],
"responses": {
"200": {
"description": "OK response definition.",
"schema": {
"$ref": "#/definitions/DataCollectorLog"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorContract"
}
}
}
}
},
"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataCollectorLogs": {
"get": {
"tags": [
"DataCollectorLogs"
],
"description": "Listing all data collector log tables, being created via data collector endpoint and scoped to the specified workspace",
"operationId": "DataCollectorLogs_ListByWorkspace",
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter"
},
{
"$ref": "../../../common/v1/types.json#/parameters/WorkspaceNameParameter"
}
],
"responses": {
"200": {
"description": "OK response definition.",
"schema": {
"$ref": "#/definitions/DataCollectorLogsListResult"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorContract"
}
}
},
"x-ms-pageable": {
"nextLinkName": null
},
"x-ms-examples": {
"DataCollectorLogsListByWorkspace": {
"$ref": "./examples/DataCollectorLogsListByWorkspace.json"
}
}
}
}
},
"definitions": {
"DataCollectorLogProperties": {
"description": "Data collector log properties.",
"type": "object",
"properties": {
"name": {
"description": "Table's name.",
"type": "string"
}
}
},
"DataCollectorLog": {
"properties": {
"properties": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/DataCollectorLogProperties",
"description": "Data collector log properties."
}
},
"allOf": [
{
"$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ProxyResource"
}
],
"description": "Data collector log top level resource container."
},
"DataCollectorLogsListResult": {
"properties": {
"value": {
"type": "array",
"items": {
"$ref": "#/definitions/DataCollectorLog"
},
"description": "data collector log collection."
}
},
"description": "Data collector log tables collection, all tables are scoped to the specified workspace."
},
"ErrorContract": {
"properties": {
"error": {
"description": "The details of the error.",
"$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse"
}
},
"description": "Contains details when the response code indicates an error."
}
},
"parameters": {
"ForceDeletion": {
"name": "force",
"in": "query",
"required": false,
"type": "boolean",
"description": "When true, enables bypassing retention validation.",
"x-ms-parameter-location": "method"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"parameters": {
"resourceGroupName": "mms-eus",
"workspaceName": "testDataCollectorLogsWS",
"tableName": "Test_CL",
"api-version": "2020-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-00000000000"
},
"responses": {
"200": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"parameters": {
"resourceGroupName": "mms-eus",
"workspaceName": "testDataCollectorLogsWS",
"tableName": "Test_CL",
"api-version": "2020-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-00000000000"
},
"responses": {
"200": {
"body": {
"properties": {
"name": "Table0_CL"
},
"id": "/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testDataCollectorLogsWS/dataCollectorLogs/Test_CL",
"name": "Test_CL",
"type": "Microsoft.OperationalInsights/workspaces/dataCollectorLogs"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"parameters": {
"resourceGroupName": "mms-eus",
"workspaceName": "testDataCollectorLogsWS",
"api-version": "2020-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-00000000000"
},
"responses": {
"200": {
"body": {
"value": [
{
"properties": {
"name": "Table0_CL"
},
"id": "/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testDataCollectorLogsWS/dataCollectorLogs/Table0_CL",
"name": "Table0_CL",
"type": "Microsoft.OperationalInsights/workspaces/dataCollectorLogs"
},
{
"properties": {
"name": "Table1_CL"
},
"id": "/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testDataCollectorLogsWS/dataCollectorLogs/Table1_CL",
"name": "Table1_CL",
"type": "Microsoft.OperationalInsights/workspaces/dataCollectorLogs"
},
{
"properties": {
"name": "Table2_CL"
},
"id": "/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testDataCollectorLogsWS/dataCollectorLogs/Table2_CL",
"name": "Table2_CL",
"type": "Microsoft.OperationalInsights/workspaces/dataCollectorLogs"
},
{
"properties": {
"name": "Table3_CL"
},
"id": "/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testDataCollectorLogsWS/dataCollectorLogs/Table3_CL",
"name": "Table3_CL",
"type": "Microsoft.OperationalInsights/workspaces/dataCollectorLogs"
},
{
"properties": {
"name": "Table4_CL"
},
"id": "/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testDataCollectorLogsWS/dataCollectorLogs/Table4_CL",
"name": "Table4_CL",
"type": "Microsoft.OperationalInsights/workspaces/dataCollectorLogs"
}
]
}
}
}
}
2 changes: 2 additions & 0 deletions specification/operationalinsights/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ These settings apply only when `--tag=package-2020-03-preview` is specified on t
input-file:
- Microsoft.OperationalInsights/preview/2020-03-01-preview/DataExports.json
- Microsoft.OperationalInsights/preview/2020-03-01-preview/DataSources.json
- Microsoft.OperationalInsights/preview/2020-03-01-preview/DataCollectorLogs.json
- Microsoft.OperationalInsights/preview/2020-03-01-preview/IntelligencePacks.json
- Microsoft.OperationalInsights/preview/2020-03-01-preview/LinkedServices.json
- Microsoft.OperationalInsights/preview/2020-03-01-preview/LinkedStorageAccounts.json
Expand Down Expand Up @@ -202,6 +203,7 @@ input-file:
- $(this-folder)/Microsoft.OperationalInsights/preview/2019-08-01-preview/OperationalInsights.json
- $(this-folder)/Microsoft.OperationalInsights/preview/2020-03-01-preview/DataExports.json
- $(this-folder)/Microsoft.OperationalInsights/preview/2020-03-01-preview/DataSources.json
- $(this-folder)/Microsoft.OperationalInsights/preview/2020-03-01-preview/DataCollectorLogs.json
- $(this-folder)/Microsoft.OperationalInsights/preview/2020-03-01-preview/IntelligencePacks.json
- $(this-folder)/Microsoft.OperationalInsights/preview/2020-03-01-preview/LinkedServices.json
- $(this-folder)/Microsoft.OperationalInsights/preview/2020-03-01-preview/LinkedStorageAccounts.json
Expand Down