Skip to content

Commit

Permalink
[Stream Analytics] Add Subscription Level APIs (#13322)
Browse files Browse the repository at this point in the history
* add query testing apis

* add operationId and outputURI

* fix some linter errors

* fix model validation

* address some PR comments

* address some comments

* delete getoperationresults example

* try adding raw input datasource wrappers

* add inputs

* refactor input structure

* add outputs

* modify some descriptions

* address more comments

* add 200 response

* fix formatting

* Delete package-lock.json

* restore package-lock.json

* address final comments

* add compile query

* add sample input api

* add test input and test output apis

* fix validation errors

* update testQuery and compileQuery

* update sample input and test input/output

* final fixes

* fix linter errors pt1

* fix small bugs

* remove duplicate operations def

Co-authored-by: Roslyn Lu <roslu@microsoft.com>
  • Loading branch information
roslynlu and Roslyn Lu authored Jul 7, 2021
1 parent c6d70ab commit b5a2494
Show file tree
Hide file tree
Showing 13 changed files with 1,378 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,14 @@
"minLength": 1,
"maxLength": 90,
"x-ms-parameter-location": "method"
},
"LocationParameter": {
"name": "location",
"in": "path",
"required": true,
"type": "string",
"description": "The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/",
"x-ms-parameter-location": "method"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"parameters": {
"api-version": "2017-04-01-preview",
"subscriptionId": "56b5e0a9-b645-407d-99b0-c64f86013e3d",
"location": "West US",
"compileQuery": {
"query": "SELECT\r\n *\r\nINTO\r\n [output1]\r\nFROM\r\n [input1]",
"inputs": [
{
"name": "input1",
"type": "Stream"
}
],
"functions": [
{
"name": "function1",
"type": "Scalar",
"bindingType": "Microsoft.StreamAnalytics/JavascriptUdf",
"inputs": [
{
"dataType": "any",
"isConfigurationParameter": null
}
],
"output": {
"dataType": "bigint"
}
}
],
"jobType": "Cloud",
"compatibilityLevel": "1.2"
}
},
"responses": {
"200": {
"body": {
"errors": [
{
"message": "Query failed to compile.",
"isGlobal": true
}
],
"inputs": [
"inputtest"
],
"outputs": [
"outputtest"
],
"functions": [
"transformationtest"
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"parameters": {
"api-version": "2017-04-01-preview",
"subscriptionId": "56b5e0a9-b645-407d-99b0-c64f86013e3d",
"location": "West US",
"sampleInput": {
"input": {
"properties": {
"type": "Stream",
"datasource": {
"type": "Microsoft.Storage/Blob",
"properties": {
"storageAccounts": [
{
"accountName": "someAccountName",
"accountKey": "someAccountKey=="
}
],
"container": "state",
"pathPattern": "{date}/{time}",
"dateFormat": "yyyy/MM/dd",
"timeFormat": "HH",
"sourcePartitionCount": 16
}
},
"serialization": {
"type": "Csv",
"properties": {
"fieldDelimiter": ",",
"encoding": "UTF8"
}
}
}
},
"compatibilityLevel": "1.2",
"eventsUri": "http://myoutput.com",
"dataLocale": "en-US"
}
},
"responses": {
"202": {
"body": {
"status": "ReadAllEventsInRange",
"diagnostics": [
""
],
"eventsDownloadUrl": "http://myoutput.com",
"lastArrivalTime": "2020-12-05T14:35:00Z"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"parameters": {
"api-version": "2017-04-01-preview",
"subscriptionId": "56b5e0a9-b645-407d-99b0-c64f86013e3d",
"location": "West US",
"testInput": {
"input": {
"properties": {
"type": "Stream",
"datasource": {
"type": "Microsoft.Storage/Blob",
"properties": {
"storageAccounts": [
{
"accountName": "someAccountName",
"accountKey": "someAccountKey=="
}
],
"container": "state",
"pathPattern": "{date}/{time}",
"dateFormat": "yyyy/MM/dd",
"timeFormat": "HH",
"sourcePartitionCount": 16
}
},
"serialization": {
"type": "Csv",
"properties": {
"fieldDelimiter": ",",
"encoding": "UTF8"
}
}
}
}
}
},
"responses": {
"202": {
"body": {
"status": "TestSuceeded"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"parameters": {
"api-version": "2017-04-01-preview",
"subscriptionId": "56b5e0a9-b645-407d-99b0-c64f86013e3d",
"location": "West US",
"testOutput": {
"output": {
"properties": {
"datasource": {
"type": "Microsoft.Storage/Blob",
"properties": {
"storageAccounts": [
{
"accountName": "someAccountName",
"accountKey": "accountKey=="
}
],
"container": "state",
"pathPattern": "{date}/{time}",
"dateFormat": "yyyy/MM/dd",
"timeFormat": "HH"
}
},
"serialization": {
"type": "Csv",
"properties": {
"fieldDelimiter": ",",
"encoding": "UTF8"
}
}
}
}
}
},
"responses": {
"202": {
"body": {
"status": "TestSuceeded"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"parameters": {
"api-version": "2017-04-01-preview",
"subscriptionId": "56b5e0a9-b645-407d-99b0-c64f86013e3d",
"location": "West US",
"testQuery": {
"diagnostics": {
"writeUri": "http://myoutput.com",
"path": "/pathto/subdirectory"
},
"streamingJob": {
"properties": {
"sku": {
"name": "Standard"
},
"eventsOutOfOrderPolicy": "Drop",
"outputErrorPolicy": "Drop",
"eventsOutOfOrderMaxDelayInSeconds": 0,
"eventsLateArrivalMaxDelayInSeconds": 5,
"dataLocale": "en-US",
"compatibilityLevel": "1.0",
"inputs": [
{
"properties": {
"type": "Stream",
"datasource": {
"type": "Raw",
"properties": {
"payloadUri": "http://myinput.com"
}
},
"serialization": {
"type": "Json",
"properties": {
"encoding": "UTF8"
}
}
},
"name": "inputtest"
}
],
"transformation": {
"properties": {
"streamingUnits": 1,
"query": "Select Id, Name from inputtest"
},
"name": "transformationtest"
},
"outputs": [
{
"properties": {
"datasource": {
"type": "Raw",
"properties": {
"payloadUri": "http://myoutput.com"
}
},
"serialization": {
"type": "Json"
}
},
"name": "outputtest"
}
],
"functions": []
},
"location": "West US",
"tags": {
"key1": "value1",
"randomKey": "randomValue",
"key3": "value3"
}
}
}
},
"responses": {
"200": {
"body": {
"status": "Success",
"outputUri": "http://myoutput.com"
}
},
"202": {}
}
}
Loading

0 comments on commit b5a2494

Please sign in to comment.