Skip to content

Commit

Permalink
Adding OperationalInsights Purge, PurgeStatus operations (Azure#2541)
Browse files Browse the repository at this point in the history
* Adding OperationalInsights Purge, PurgeStatus operations

* Modifying long running operation
  • Loading branch information
alexeldeib authored and sergey-shandar committed Mar 9, 2018
1 parent 09d388c commit f90862a
Show file tree
Hide file tree
Showing 2 changed files with 162 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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."
}
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}

0 comments on commit f90862a

Please sign in to comment.