From adcb573bc28a716af7276e87592e0db4bb7d035f Mon Sep 17 00:00:00 2001 From: rajrame <52300710+rajrame@users.noreply.github.com> Date: Wed, 16 Feb 2022 11:07:07 -0600 Subject: [PATCH] Manually moving DataCollectionRules from Private PR. (#17845) * Create readme.md * Create post_IngestUsingDataCollectionRule.json * Create DataCollectionRules.json --- .../DataCollectionRules.json | 136 ++++++++++++++++++ .../post_IngestUsingDataCollectionRule.json | 41 ++++++ .../monitor/data-plane/ingestion/readme.md | 19 +++ 3 files changed, 196 insertions(+) create mode 100644 specification/monitor/data-plane/ingestion/preview/2021-11-01-preview/DataCollectionRules.json create mode 100644 specification/monitor/data-plane/ingestion/preview/2021-11-01-preview/examples/post_IngestUsingDataCollectionRule.json create mode 100644 specification/monitor/data-plane/ingestion/readme.md diff --git a/specification/monitor/data-plane/ingestion/preview/2021-11-01-preview/DataCollectionRules.json b/specification/monitor/data-plane/ingestion/preview/2021-11-01-preview/DataCollectionRules.json new file mode 100644 index 000000000000..2430c5385d9c --- /dev/null +++ b/specification/monitor/data-plane/ingestion/preview/2021-11-01-preview/DataCollectionRules.json @@ -0,0 +1,136 @@ +{ + "swagger": "2.0", + "info": { + "title": "Ingestion Using Data Collection Rules", + "version": "2021-11-01-preview" + }, + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "#/parameters/Endpoint" + } + ] + }, + "schemes": [ + "https" + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "paths": { + "/dataCollectionRules/{ruleId}/streams/{stream}": { + "post": { + "tags": [ + "Data Collection Rules" + ], + "summary": "Ingestion API used to directly ingest data using Data Collection Rules", + "description": "See error response code and error response message for more detail.", + "operationId": "DataCollectionRule_Ingest", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "ruleId", + "description": "The immutable Id of the Data Collection Rule resource.", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "stream", + "description": "The streamDeclaration name as defined in the Data Collection Rule.", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "api-version", + "required": true, + "type": "string", + "description": "The API version to use for this operation." + }, + { + "in": "header", + "name": "Content-Encoding", + "description": "gzip", + "type": "string" + }, + { + "in": "header", + "name": "x-ms-client-request-id", + "description": "Client request Id", + "type": "string" + }, + { + "in": "body", + "name": "body", + "description": "An array of objects matching the schema defined by the provided stream.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "object" + } + } + } + ], + "x-ms-examples": { + "postIngestUsingDataCollectionRule": { + "$ref": "./examples/post_IngestUsingDataCollectionRule.json" + } + }, + "responses": { + "204": { + "description": "Ingestion request accepted" + }, + "default": { + "description": "An error response object.", + "schema": { + "$ref": "../../../../../common-types/data-plane/v1/types.json#/definitions/ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "A value that indicates the ingestion service error code.", + "type": "string" + } + } + } + } + } + } + }, + "definitions": {}, + "parameters": { + "Endpoint": { + "name": "endpoint", + "description": "The Data Collection Endpoint for the Data Collection Rule, for example https://dce-name.eastus-2.ingest.monitor.azure.com.", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true, + "x-ms-parameter-location": "client" + } + } +} diff --git a/specification/monitor/data-plane/ingestion/preview/2021-11-01-preview/examples/post_IngestUsingDataCollectionRule.json b/specification/monitor/data-plane/ingestion/preview/2021-11-01-preview/examples/post_IngestUsingDataCollectionRule.json new file mode 100644 index 000000000000..78c8aa20623a --- /dev/null +++ b/specification/monitor/data-plane/ingestion/preview/2021-11-01-preview/examples/post_IngestUsingDataCollectionRule.json @@ -0,0 +1,41 @@ +{ + "title": "Post Ingest Using Data Collection Rule", + "description": "Allows data to be ingested directly using Data Collection Rules", + "parameters": { + "endpoint": "https://dce-name.eastus-2.ingest.monitor.azure.com", + "ruleId": "c512b59c-4005-40e2-b13d-ac29cfb46af4", + "stream": "test-rg", + "api-version": "2021-11-01-preview", + "Authorization": "Bearer ey...", + "Content-Type": "application/json", + "Content-Encoding": "gzip", + "x-ms-client-request-id": "", + "body": [ + { + "Time": "2021-12-08T23:51:14.1104269Z", + "Computer": "Computer1", + "AdditionalContext": { + "InstanceName": "user1", + "TimeZone": "Pacific Time", + "Level": 4, + "CounterName": "AppMetric1", + "CounterValue": 15.3 + } + }, + { + "Time": "2021-12-08T23:51:14.1104269Z", + "Computer": "Computer2", + "AdditionalContext": { + "InstanceName": "user2", + "TimeZone": "Central Time", + "Level": 3, + "CounterName": "AppMetric1", + "CounterValue": 23.5 + } + } + ] + }, + "responses": { + "204": {} + } +} diff --git a/specification/monitor/data-plane/ingestion/readme.md b/specification/monitor/data-plane/ingestion/readme.md new file mode 100644 index 000000000000..1c16089af456 --- /dev/null +++ b/specification/monitor/data-plane/ingestion/readme.md @@ -0,0 +1,19 @@ +# My API +> see https://aka.ms/autorest + +### Basic Information +These are the global settings for the Ingestion API. + +``` yaml +openapi-type: data-plane +tag: package-2021-11-preview +``` + +### Tag: package-2021-11-preview + +These settings apply only when `--tag=package-2021-11-preview` is specified on the command line. + +``` yaml $(tag) == 'package-2021-11-preview' +input-file: +- preview/2021-11-01-preview/DataCollectionRules.json +```