From 414f6c2f5e9b93c6f89087eea82acd76a21d93c5 Mon Sep 17 00:00:00 2001 From: bikamani <41314966+bikamani@users.noreply.github.com> Date: Tue, 9 Mar 2021 16:12:38 -0800 Subject: [PATCH 1/3] initial design for types --- .../design/TimeSeriesTypes_API_Design.md | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/design/TimeSeriesTypes_API_Design.md diff --git a/sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/design/TimeSeriesTypes_API_Design.md b/sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/design/TimeSeriesTypes_API_Design.md new file mode 100644 index 0000000000000..db2a5d11d4735 --- /dev/null +++ b/sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/design/TimeSeriesTypes_API_Design.md @@ -0,0 +1,102 @@ +# Time Series Insights + +## Types + +Time Series Model types help you define variables or formulas for doing computations. Types are associated with a specific instance. + +A type can have one or more variables. For example, a Time Series Model instance might be of type Temperature Sensor, which consists of the variables avg temperature, min temperature, and max temperature. + +### GET /timeseries/types + +Returns time series types in pages. + +```csharp +/// +/// Gets time series insight types in pages asynchronously. +/// +/// The cancellation token. +/// The pageable list of Time Series instances types with the http response. +public virtual AsyncPageable GetTypesAsync( + CancellationToken cancellationToken = default) +``` + +### POST /timeseries/types + +Executes a batch get, create, update, delete operation on multiple time series types. + +#### Get Time Series Insights Types + +```csharp +/// +/// Gets time series insight types by Time Series Id asynchronously. +/// +/// List of Ids of the Time Series instances. +/// The cancellation token. +/// List of types or error objects corresponding by position to the array in the request. Type object is set when operation is successful and error object is set when operation is unsuccessful. +public virtual async Task> GetTypesAsync( + IEnumerable timeSeriesIds, + CancellationToken cancellationToken = default) +``` + +```csharp +/// +/// Gets time series insight types by Time Series Names asynchronously. +/// +/// List of names of the Time Series instances. +/// The cancellation token. +/// List of types or error objects corresponding by position to the array in the request. Type object is set when operation is successful and error object is set when operation is unsuccessful. +public virtual async Task> GetTypesAsync( + IEnumerable timeSeriesNames, + CancellationToken cancellationToken = default) +``` + +#### Create OR Replace Time Series Insights Types + +```csharp +/// +/// Creates Time Series instances types asynchronously. If a provided instance type is already in use, then this will attempt to replace the existing instance type with the provided Time Series Instance. +/// +/// The Time Series instances types to be created or replaced. +/// The cancellation token. +/// +/// List of error objects corresponding by position to the array in the request. +/// An error object will be set when operation is unsuccessful. +/// +public virtual async Task> CreateOrReplaceTimeSeriesTypesAsync( + IEnumerable timeSeriesTypes, + CancellationToken cancellationToken = default) +``` + +#### Delete Time Series Insights Types + +```csharp +/// +/// Deletes Time Series instances types asynchronously. +/// +/// List of Ids of the Time Series instances. +/// The cancellation token. +/// +/// List of error objects corresponding by position to the array in the request. +/// An error object will be set when operation is unsuccessful. +/// null will be set when the operation is successful. +/// +public virtual async Task> DeleteTimeSeriesTypesAsync( + IEnumerable timeSeriesIds, + CancellationToken cancellationToken = default) +``` + +```csharp +/// +/// Deletes Time Series instances types asynchronously. +/// +/// List of names of the Time Series instances. +/// The cancellation token. +/// +/// List of error objects corresponding by position to the array in the request. +/// An error object will be set when operation is unsuccessful. +/// null will be set when the operation is successful. +/// +public virtual async Task> DeleteTimeSeriesTypesAsync( + IEnumerable timeSeriesNames, + CancellationToken cancellationToken = default) +``` \ No newline at end of file From fa55b991d648a61d3831bbb2fe3a80b37e27d782 Mon Sep 17 00:00:00 2001 From: bikamani <41314966+bikamani@users.noreply.github.com> Date: Wed, 10 Mar 2021 15:34:11 -0800 Subject: [PATCH 2/3] review feedback --- .../design/TimeSeriesTypes_API_Design.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/design/TimeSeriesTypes_API_Design.md b/sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/design/TimeSeriesTypes_API_Design.md index db2a5d11d4735..d39ea5ca5931f 100644 --- a/sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/design/TimeSeriesTypes_API_Design.md +++ b/sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/design/TimeSeriesTypes_API_Design.md @@ -16,7 +16,7 @@ Returns time series types in pages. /// /// The cancellation token. /// The pageable list of Time Series instances types with the http response. -public virtual AsyncPageable GetTypesAsync( +public virtual AsyncPageable GetTimeSeriesTypesAsync( CancellationToken cancellationToken = default) ``` @@ -33,7 +33,7 @@ Executes a batch get, create, update, delete operation on multiple time series t /// List of Ids of the Time Series instances. /// The cancellation token. /// List of types or error objects corresponding by position to the array in the request. Type object is set when operation is successful and error object is set when operation is unsuccessful. -public virtual async Task> GetTypesAsync( +public virtual async Task> GetTimeSeriesTypesAsync( IEnumerable timeSeriesIds, CancellationToken cancellationToken = default) ``` @@ -45,7 +45,7 @@ public virtual async Task> GetTypesAsync( /// List of names of the Time Series instances. /// The cancellation token. /// List of types or error objects corresponding by position to the array in the request. Type object is set when operation is successful and error object is set when operation is unsuccessful. -public virtual async Task> GetTypesAsync( +public virtual async Task> GetTimeSeriesTypesAsync( IEnumerable timeSeriesNames, CancellationToken cancellationToken = default) ``` @@ -62,7 +62,7 @@ public virtual async Task> GetTypesAsync( /// List of error objects corresponding by position to the array in the request. /// An error object will be set when operation is unsuccessful. /// -public virtual async Task> CreateOrReplaceTimeSeriesTypesAsync( +public virtual async Task> CreateOrReplaceTimeSeriesTypesAsync( IEnumerable timeSeriesTypes, CancellationToken cancellationToken = default) ``` @@ -80,7 +80,7 @@ public virtual async Task> CreateOrReplaceTimeS /// An error object will be set when operation is unsuccessful. /// null will be set when the operation is successful. /// -public virtual async Task> DeleteTimeSeriesTypesAsync( +public virtual async Task> DeleteTimeSeriesTypesAsync( IEnumerable timeSeriesIds, CancellationToken cancellationToken = default) ``` @@ -96,7 +96,7 @@ public virtual async Task> DeleteTimeSeriesType /// An error object will be set when operation is unsuccessful. /// null will be set when the operation is successful. /// -public virtual async Task> DeleteTimeSeriesTypesAsync( +public virtual async Task> DeleteTimeSeriesTypesAsync( IEnumerable timeSeriesNames, CancellationToken cancellationToken = default) ``` \ No newline at end of file From 1bfe89cbacfe6acc4dd72ed90b257afbabc78437 Mon Sep 17 00:00:00 2001 From: bikamani <41314966+bikamani@users.noreply.github.com> Date: Wed, 10 Mar 2021 15:37:07 -0800 Subject: [PATCH 3/3] fix documentation --- .../design/TimeSeriesTypes_API_Design.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/design/TimeSeriesTypes_API_Design.md b/sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/design/TimeSeriesTypes_API_Design.md index d39ea5ca5931f..1055419a80a7f 100644 --- a/sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/design/TimeSeriesTypes_API_Design.md +++ b/sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/design/TimeSeriesTypes_API_Design.md @@ -76,7 +76,7 @@ public virtual async Task> CreateOrRep /// List of Ids of the Time Series instances. /// The cancellation token. /// -/// List of error objects corresponding by position to the array in the request. +/// List of error objects corresponding by position to the array in the request. /// An error object will be set when operation is unsuccessful. /// null will be set when the operation is successful. /// @@ -92,7 +92,7 @@ public virtual async Task> DeleteTimeS /// List of names of the Time Series instances. /// The cancellation token. /// -/// List of error objects corresponding by position to the array in the request. +/// List of error objects corresponding by position to the array in the request. /// An error object will be set when operation is unsuccessful. /// null will be set when the operation is successful. ///