From f90862af1f067bc445841acad3a72b3d87d7dffc Mon Sep 17 00:00:00 2001 From: Ace Eldeib Date: Fri, 9 Mar 2018 10:56:12 -0800 Subject: [PATCH] Adding OperationalInsights Purge, PurgeStatus operations (#2541) * Adding OperationalInsights Purge, PurgeStatus operations * Modifying long running operation --- .../2015-03-20/OperationalInsights.json | 132 ++++++++++++++++++ .../2015-03-20/examples/WorkspacesPurge.json | 30 ++++ 2 files changed, 162 insertions(+) create mode 100644 specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2015-03-20/examples/WorkspacesPurge.json diff --git a/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2015-03-20/OperationalInsights.json b/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2015-03-20/OperationalInsights.json index 017ee5863d03..954dc92ce926 100644 --- a/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2015-03-20/OperationalInsights.json +++ b/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2015-03-20/OperationalInsights.json @@ -630,6 +630,49 @@ } } } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge": { + "post": { + "description": "Purges data in an Log Analytics workspace by a set of user-defined filters.", + "x-ms-long-running-operation": true, + "operationId": "Workspace_Purge", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/WorkspaceNameParameter" + }, + { + "$ref": "#/parameters/WorkspacePurgeParameter" + } + ], + "responses": { + "202": { + "description": "Accepted request for purging an Log Analytics workspace.", + "schema": { + "$ref": "#/definitions/WorkspacePurgeResponse" + } + }, + "200": { + "description": "Returns status of purge operation in body of response. e.g.: running, completed.", + "schema": { + "$ref": "#/definitions/WorkspacePurgeStatusResponse" + } + } + }, + "x-ms-examples": { + "WorkspacePurge": { + "$ref": "./examples/WorkspacesPurge.json" + } + } + } } }, "definitions": { @@ -1247,6 +1290,71 @@ } }, "description": "Common properties of proxy resource." + }, + "WorkspacePurgeBody": { + "description": "Describes the body of a purge request for an App Insights Workspace", + "required": [ + "table", + "filters" + ], + "properties": { + "table": { + "type": "string", + "description": "Table from which to purge data." + }, + "filters": { + "type": "array", + "description": "The set of columns and filters (queries) to run over them to purge the resulting data.", + "items": { + "$ref": "#/definitions/WorkspacePurgeBodyFilters" + } + } + } + }, + "WorkspacePurgeBodyFilters": { + "description": "User-defined filters to return data which will be purged from the table.", + "properties": { + "column": { + "description": "The column of the table over which the given query should run", + "type": "string" + }, + "filter": { + "description": "A query to to run over the provided table and column to purge the corresponding data.", + "type": "string" + } + } + }, + "WorkspacePurgeResponse": { + "description": "Response containing operationId for a specific purge action.", + "properties": { + "operationId": { + "description": "Id to use when querying for status for a particular purge operation.", + "type": "string" + } + }, + "required": [ + "operationId" + ] + }, + "WorkspacePurgeStatusResponse": { + "description": "Response containing status for a specific purge operation.", + "properties": { + "status": { + "description": "Status of the operation represented by the requested Id.", + "type": "string", + "enum": [ + "Pending", + "Completed" + ], + "x-ms-enum": { + "name": "PurgeState", + "modelAsString": true + } + } + }, + "required": [ + "status" + ] } }, "parameters": { @@ -1274,6 +1382,30 @@ "pattern": "^[-\\w\\._\\(\\)]+$", "minLength": 1, "maxLength": 90 + }, + "WorkspaceNameParameter": { + "name": "workspaceName", + "in": "path", + "required": true, + "type": "string", + "description": "Log Analytics workspace name", + "x-ms-parameter-location": "method" + }, + "WorkspacePurgeParameter": { + "name": "body", + "in": "body", + "description": "Describes the body of a request to purge data in a single table of an Log Analytics Workspace", + "required": true, + "schema": { + "$ref": "#/definitions/WorkspacePurgeBody" + } + }, + "WorkspacePurgeIdParameter": { + "name": "purgeId", + "in": "path", + "required": true, + "type": "string", + "description": "In a purge status request, this is the Id of the operation the status of which is returned." } } } \ No newline at end of file diff --git a/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2015-03-20/examples/WorkspacesPurge.json b/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2015-03-20/examples/WorkspacesPurge.json new file mode 100644 index 000000000000..28b6d5c7f551 --- /dev/null +++ b/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2015-03-20/examples/WorkspacesPurge.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "resourceGroupName":"OIAutoRest5123", + "workspaceName":"aztest5048", + "api-version":"2015-03-02", + "subscriptionId":"00000000-0000-0000-0000-00000000000", + "body": { + "table": "Heartbeat", + "filters": [ + { + "column": "TimeGenerated", + "filter": "< ago(30d)" + } + ] + } + }, + "responses": { + "202": { + "body": { + "operationId": "7d7cf277-9113-4ab3-8359-d0364b74d01d" + } + }, + "200": { + "body": { + "status": "Completed" + } + } + } +} + \ No newline at end of file