From d529c8b86ecfad341936b80474ee89057a242d82 Mon Sep 17 00:00:00 2001 From: Ace Eldeib Date: Mon, 26 Feb 2018 13:24:13 -0800 Subject: [PATCH 1/2] Adding OperationalInsights Purge, PurgeStatus operations --- .../2015-03-20/OperationalInsights.json | 161 ++++++++++++++++++ .../2015-03-20/examples/WorkspacesPurge.json | 25 +++ .../examples/WorkspacesPurgeStatus.json | 17 ++ 3 files changed, 203 insertions(+) create mode 100644 specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2015-03-20/examples/WorkspacesPurge.json create mode 100644 specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2015-03-20/examples/WorkspacesPurgeStatus.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..7d0cfc9aec9a 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,78 @@ } } } + }, + "/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.", + "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" + } + } + }, + "x-ms-examples": { + "WorkspacePurge": { + "$ref": "./examples/WorkspacesPurge.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/operations/{purgeId}": { + "get": { + "description": "Gets the status of a previously submitted purge using the id returned from the original purge request.", + "operationId": "Workspace_GetPurgeStatus", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/WorkspaceNameParameter" + }, + { + "$ref": "#/parameters/WorkspacePurgeIdParameter" + } + ], + "responses": { + "200": { + "description": "Returns status of purge operation in body of response. e.g.: running, completed.", + "schema": { + "$ref": "#/definitions/WorkspacePurgeStatusResponse" + } + } + }, + "x-ms-examples": { + "WorkspacePurgeStatus": { + "$ref": "./examples/WorkspacesPurgeStatus.json" + } + } + } } }, "definitions": { @@ -1247,6 +1319,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 +1411,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..1ec1f2df2d66 --- /dev/null +++ b/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2015-03-20/examples/WorkspacesPurge.json @@ -0,0 +1,25 @@ +{ + "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" + } + } + } +} + \ No newline at end of file diff --git a/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2015-03-20/examples/WorkspacesPurgeStatus.json b/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2015-03-20/examples/WorkspacesPurgeStatus.json new file mode 100644 index 000000000000..a872c141bed9 --- /dev/null +++ b/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2015-03-20/examples/WorkspacesPurgeStatus.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "resourceGroupName":"OIAutoRest5123", + "workspaceName":"aztest5048", + "api-version":"2015-03-02", + "subscriptionId":"00000000-0000-0000-0000-00000000000", + "purgeId": "6779dd32-272a-45d3-a9b8-84d7f47abfb7" + }, + "responses": { + "200": { + "body": { + "status": "Completed" + } + } + } +} + \ No newline at end of file From 58b88b90a7c07420de51e0bbb45fd944f6a6601e Mon Sep 17 00:00:00 2001 From: Ace Eldeib Date: Thu, 1 Mar 2018 13:11:34 -0800 Subject: [PATCH 2/2] Modifying long running operation --- .../2015-03-20/OperationalInsights.json | 35 ++----------------- .../2015-03-20/examples/WorkspacesPurge.json | 5 +++ .../examples/WorkspacesPurgeStatus.json | 17 --------- 3 files changed, 8 insertions(+), 49 deletions(-) delete mode 100644 specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2015-03-20/examples/WorkspacesPurgeStatus.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 7d0cfc9aec9a..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 @@ -634,6 +634,7 @@ "/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": [ { @@ -658,37 +659,7 @@ "schema": { "$ref": "#/definitions/WorkspacePurgeResponse" } - } - }, - "x-ms-examples": { - "WorkspacePurge": { - "$ref": "./examples/WorkspacesPurge.json" - } - } - } - }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/operations/{purgeId}": { - "get": { - "description": "Gets the status of a previously submitted purge using the id returned from the original purge request.", - "operationId": "Workspace_GetPurgeStatus", - "parameters": [ - { - "$ref": "#/parameters/ResourceGroupNameParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/WorkspaceNameParameter" }, - { - "$ref": "#/parameters/WorkspacePurgeIdParameter" - } - ], - "responses": { "200": { "description": "Returns status of purge operation in body of response. e.g.: running, completed.", "schema": { @@ -697,8 +668,8 @@ } }, "x-ms-examples": { - "WorkspacePurgeStatus": { - "$ref": "./examples/WorkspacesPurgeStatus.json" + "WorkspacePurge": { + "$ref": "./examples/WorkspacesPurge.json" } } } 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 index 1ec1f2df2d66..28b6d5c7f551 100644 --- 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 @@ -19,6 +19,11 @@ "body": { "operationId": "7d7cf277-9113-4ab3-8359-d0364b74d01d" } + }, + "200": { + "body": { + "status": "Completed" + } } } } diff --git a/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2015-03-20/examples/WorkspacesPurgeStatus.json b/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2015-03-20/examples/WorkspacesPurgeStatus.json deleted file mode 100644 index a872c141bed9..000000000000 --- a/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2015-03-20/examples/WorkspacesPurgeStatus.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "parameters": { - "resourceGroupName":"OIAutoRest5123", - "workspaceName":"aztest5048", - "api-version":"2015-03-02", - "subscriptionId":"00000000-0000-0000-0000-00000000000", - "purgeId": "6779dd32-272a-45d3-a9b8-84d7f47abfb7" - }, - "responses": { - "200": { - "body": { - "status": "Completed" - } - } - } -} - \ No newline at end of file