diff --git a/specification/applicationinsights/resource-manager/microsoft.insights/stable/2015-05-01/components_API.json b/specification/applicationinsights/resource-manager/microsoft.insights/stable/2015-05-01/components_API.json index 5fbdac483403..eb6e4ba00c9f 100644 --- a/specification/applicationinsights/resource-manager/microsoft.insights/stable/2015-05-01/components_API.json +++ b/specification/applicationinsights/resource-manager/microsoft.insights/stable/2015-05-01/components_API.json @@ -243,6 +243,78 @@ } } } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/purge": { + "post": { + "description": "Purges data in an Application Insights component by a set of user-defined filters.", + "operationId": "Components_Purge", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceNameParameter" + }, + { + "$ref": "#/parameters/ComponentPurgeParameter" + } + ], + "responses": { + "202": { + "description": "Accepted request for purging an Application Insights component.", + "schema": { + "$ref": "#/definitions/ComponentPurgeResponse" + } + } + }, + "x-ms-examples": { + "ComponentPurge": { + "$ref": "./examples/ComponentsPurge.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/operations/{purgeId}": { + "get": { + "description": "Gets the status of a previously submitted purge using the id returned from the original purge request.", + "operationId": "Components_GetPurgeStatus", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceNameParameter" + }, + { + "$ref": "#/parameters/ComponentPurgeIdParameter" + } + ], + "responses": { + "200": { + "description": "Returns status of purge operation in body of response. e.g.: running, completed.", + "schema": { + "$ref": "#/definitions/ComponentPurgeStatusResponse" + } + } + }, + "x-ms-examples": { + "ComponentPurgeStatus": { + "$ref": "./examples/ComponentsPurgeStatus.json" + } + } + } } }, "definitions": { @@ -434,6 +506,71 @@ "description": "The URI to get the next set of Application Insights component defintions if too many components where returned in the result set." } } + }, + "ComponentPurgeBody": { + "description": "Describes the body of a purge request for an App Insights component", + "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/ComponentPurgeBodyFilters" + } + } + } + }, + "ComponentPurgeBodyFilters": { + "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" + } + } + }, + "ComponentPurgeResponse": { + "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" + ] + }, + "ComponentPurgeStatusResponse": { + "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": { @@ -466,6 +603,22 @@ "type": "string", "description": "The name of the Application Insights component resource.", "x-ms-parameter-location": "method" + }, + "ComponentPurgeParameter": { + "name": "body", + "in": "body", + "description": "Describes the body of a request to purge data in a single table of an Application Insights component", + "required": true, + "schema": { + "$ref": "#/definitions/ComponentPurgeBody" + } + }, + "ComponentPurgeIdParameter": { + "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/applicationinsights/resource-manager/microsoft.insights/stable/2015-05-01/examples/ComponentsPurge.json b/specification/applicationinsights/resource-manager/microsoft.insights/stable/2015-05-01/examples/ComponentsPurge.json new file mode 100644 index 000000000000..599cea6afb76 --- /dev/null +++ b/specification/applicationinsights/resource-manager/microsoft.insights/stable/2015-05-01/examples/ComponentsPurge.json @@ -0,0 +1,33 @@ +{ + "parameters": { + "api-version": "2015-05-01", + "subscriptionId": "subid", + "resourceGroupName": "my-resource-group", + "resourceName": "my-component", + "body": { + "table": "requests", + "filters": [ + { + "column": "duration", + "filter": ">1000" + }, + { + "column": "timestamp", + "filter": ">= datetime(2017-09-01T00:00:00.000Z)" + }, + { + "column": "application_Version", + "filter": "in ('Draft_master_20171018.2', 'Draft_master_2017024.1')" + } + ] + } + }, + "responses": { + "202": { + "body": { + "operationId": "7d7cf277-9113-4ab3-8359-d0364b74d01d" + } + } + } +} + \ No newline at end of file diff --git a/specification/applicationinsights/resource-manager/microsoft.insights/stable/2015-05-01/examples/ComponentsPurgeStatus.json b/specification/applicationinsights/resource-manager/microsoft.insights/stable/2015-05-01/examples/ComponentsPurgeStatus.json new file mode 100644 index 000000000000..c28fdc13744d --- /dev/null +++ b/specification/applicationinsights/resource-manager/microsoft.insights/stable/2015-05-01/examples/ComponentsPurgeStatus.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "api-version": "2015-05-01", + "subscriptionId": "subid", + "resourceGroupName": "my-resource-group", + "resourceName": "my-component", + "purgeId": "6779dd32-272a-45d3-a9b8-84d7f47abfb7" + }, + "responses": { + "200": { + "body": { + "status": "Completed" + } + } + } +} + \ No newline at end of file