Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": {
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 final response when the PURGE operation succeeds?

Copy link
Contributor

Choose a reason for hiding this comment

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

It should be modeled in the 200 response

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved 200 from purge status to here, added x-ms-long-running-operation

"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"
}
}
}
}