Argentine Tango Dance Shoes The Most Effective Of The Best In Tango Shoes

High heels are marketed to youngsters, and also some colleges motivate kids to wear them. 18% of injuries from putting on high heels were in children, and also 4% in under-tens, in a 2002–2012 United…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Exploring Time Series Insights queries with Postman

As with any other service in Microsoft Azure, there are RESTful APIs to interact with. Time Series Insights (TSI) is no exception.

Coming back to TSI, when working on IoT projects we follow the IoT Reference architecture and implement specific scenarios accordingly to the requirements. One of the usual requirements is related to providing an always easily accessible UI for analysis purposes, especially oriented to the operator’s daily needs. TSI offers out-of-the-box a powerful TSI explorer — a UI that corresponds to a managed visualization service for managing IoT-scale time-series data in the cloud.

Yes, it’s the perfect tool factory or power plant operators/advanced users that require granular, free-text query and point & click exploration.

Beyond this, TSI exposes REST Query APIs, enabling you to build applications that use time series data. And this fact makes TSI even more flexible for your needs!

Querying TSI will be one of the first things you’ll try before getting into more advanced topics — such as capacity, managing input data throttling, scaling the environment or even building applications with TSI data.

To use Postman and Azure Rest APIs, let’s start by authentication. By creating an Azure Active Directory Service Principal and using Postman to generate a Bearer Token, we’ll have things ready to start calling the TSI query APIs.

First authentication on your Azure subscription:

If you’re like me, you’ll have access to several azure subscriptions, so make sure you explicitly pick one:

Next, we’ll create the default Service Principal

I always copy the output to a temp location, because we’ll need it later.

Now close (yes, make sure your Postman is closed), and click this button:

You’ll notice your browser popped up with the following screen:

Whether you use postman in your browser or the app, make your pick!

Now, there will be a new collection in Postman, once it opens. It’s called TSI Azure REST and includes a set of calls that will help you tackle authorization for Azure REST API calls. Let’s take a closer look and get familiar with them:

Like TSI ENVIRONMENTS, the following requests also target the TSI REST API: TSI AVAILABILITY, TSI METADATA, TSI QUERY AGGREGATES and TSI QUERY EVENTS. The purpose of this requests is for you to be able to quickly query your data, changing the queries accordingly to your data. At the end of this post, I leave a brief explanation about these requests.

Because we will be executing several REST requests to TSI REST API, let’s use Postman environments. By clicking Run in Postman an environment was already created for your use. Next step is to set your Service Principal settings in the environment and be used in the requests. Click the gears icon in the upper right-hand corner, and select Manage Environments:

Click on the TSI Azure Rest Environment and you will see all the required settings:

Now, get back to the Service Principal settings info you saved temporarily. Set the values accordingly. Some info may be confusing — but no worries — you should put appID into clientId and password into clientSecret. The rest, as the name implies.

Close all dialogs, and in main Postman screen, check if the TSI Azure REST environment is selected: In the Environment dropdown in the upper right-hand corner of Postman.

OK, all configuration has been done, and we’re ready to execute the requests!

Let’s start by executing the Get AAD Token request. This will provide you your Bearer Token and set it in a Postman global variable. Open the Get AAD Token request and click the Send button.

The expected output should be similar to:

To access data in TSI, it’s necessary to data access policy to Azure Active Directory principals (users or apps). This will allow principals to issue data queries, manipulate reference data in the environment, and share saved queries and perspectives.

In this case, we will provide data access to the Service Principal we created initially. In Azure Portal, add a new Data Access Policy in TSI. When asked for the selected user, place the appID (taken from your notes, when creating the Service Principal).

Now that we have the access token and the correct TSI Data Access policies, we can call any TSI REST API endpoint. To start, we’ll use TSI ENVIRONMENTS request.

Open the TSI ENVIRONMENTS request and click the Send button.

You will see the following output:

That’s all there is to it. Now you can explore all the other TSI Azure REST APIs, and use this same method to generate the required Bearer Token Authorization header.

Feel free to provide feedback or ping me if you hit a blocker.

Here, I’ll summarize the rest of TSI queries included in the shared Postman collection:

TSI AVAILABILITY: this request will query TSI for the distribution of event count over the event timestamp $ts. This means you’ll be able to understand the time range of data ingested into TSI. Also, you’ll be able to understand the volume of events in a 1h distribution.

TSI METADATA: A request to collect your TSI environment metadata for a given search span. The metadata returned is as a set of property references.

TSI QUERY AGGREGATES will group events by given property with optionally measuring values of other properties.

TSI QUERY EVENTS: This query will probably be the one you’ll use the most, specially when understanding query patterns. It will return a list of raw events matching the search span and predicate.

Add a comment

Related posts:

Why disband the EWG?

The workload of the EWG leadership is a serious problem, but if it were the only one, we could solve it and keep the EWG intact. But it’s not the only important thing here. I think the group should…

Says Who? My Observant Mind!

The substances in the world revolving around me are trapping me in a deadlocked dark box. I seem to not find the right key to escape. Tthe key can never be bought through any capital nor the asset…

Weekly Technical Views on Cryptocurrencies

With passage of time, Bitcoin is consolidating its early April gain and that in itself is extremely bullish in intermediate term. As prices are not showing any significant weakness, we are expecting…