├── .attachments
├── sample
├── stddev.JPG
├── Building_blocks.JPG
├── auth-token-postman.JPG
├── environment-selection.png
├── auth-code-token-postmanJPG.JPG
├── manage-environments-postman.JPG
├── pre-request-script-postman.JPG
├── select-environment-postman.JPG
├── environment-variables-postman.JPG
├── streaming-architecture-simple.png
├── streaming-architecture-simple-link.PNG
├── Omnia Timeseries Beta.postman_environment.json
├── Omnia Timeseries Production.postman_environment.json
└── Omnia Timeseries.postman_collection.json
├── .gitignore
├── Omnia Streaming
├── schema
│ ├── README.MD
│ └── datapoints_v2.json
└── README.md
├── Omnia Timeseries API
├── csharp samples
│ ├── README.MD
│ └── Program.cs
├── timeseries_msal_devicecode
│ ├── timeseries_msal_devicecode.csproj
│ ├── timeseries_msal_devicecode.sln
│ └── Program.cs
├── README.md
└── CHANGELOG.md
├── Postman
├── README.MD
└── pre-request-script.md
├── Support
└── README.md
├── FAQ
└── README.MD
├── Omnia Subscriptions API
└── README.md
├── .github
└── ISSUE_TEMPLATE
│ ├── improvement-proposal.md
│ └── bug_report.md
├── LICENSE
└── README.md
/.attachments/sample:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .vs
2 | bin
3 | obj
4 |
--------------------------------------------------------------------------------
/.attachments/stddev.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/equinor/OmniaPlant/HEAD/.attachments/stddev.JPG
--------------------------------------------------------------------------------
/.attachments/Building_blocks.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/equinor/OmniaPlant/HEAD/.attachments/Building_blocks.JPG
--------------------------------------------------------------------------------
/Omnia Streaming/schema/README.MD:
--------------------------------------------------------------------------------
1 | # Streaming schema
2 |
3 | Here you find support schemes you can use for Streaming.
4 |
--------------------------------------------------------------------------------
/.attachments/auth-token-postman.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/equinor/OmniaPlant/HEAD/.attachments/auth-token-postman.JPG
--------------------------------------------------------------------------------
/Omnia Timeseries API/csharp samples/README.MD:
--------------------------------------------------------------------------------
1 | Simple C# samples demonstrating how to make requests to the Timeseries API
2 |
--------------------------------------------------------------------------------
/Postman/README.MD:
--------------------------------------------------------------------------------
1 | # Postman
2 |
3 | - [How to Connect to Postman](https://github.com/equinor/OmniaPlant/wiki/Postman)
4 |
5 |
--------------------------------------------------------------------------------
/.attachments/environment-selection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/equinor/OmniaPlant/HEAD/.attachments/environment-selection.png
--------------------------------------------------------------------------------
/Support/README.md:
--------------------------------------------------------------------------------
1 | # Do you need help?
2 |
3 | Check out our support pages at https://github.com/equinor/OmniaPlant/wiki/Support
4 |
--------------------------------------------------------------------------------
/.attachments/auth-code-token-postmanJPG.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/equinor/OmniaPlant/HEAD/.attachments/auth-code-token-postmanJPG.JPG
--------------------------------------------------------------------------------
/.attachments/manage-environments-postman.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/equinor/OmniaPlant/HEAD/.attachments/manage-environments-postman.JPG
--------------------------------------------------------------------------------
/.attachments/pre-request-script-postman.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/equinor/OmniaPlant/HEAD/.attachments/pre-request-script-postman.JPG
--------------------------------------------------------------------------------
/.attachments/select-environment-postman.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/equinor/OmniaPlant/HEAD/.attachments/select-environment-postman.JPG
--------------------------------------------------------------------------------
/.attachments/environment-variables-postman.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/equinor/OmniaPlant/HEAD/.attachments/environment-variables-postman.JPG
--------------------------------------------------------------------------------
/.attachments/streaming-architecture-simple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/equinor/OmniaPlant/HEAD/.attachments/streaming-architecture-simple.png
--------------------------------------------------------------------------------
/.attachments/streaming-architecture-simple-link.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/equinor/OmniaPlant/HEAD/.attachments/streaming-architecture-simple-link.PNG
--------------------------------------------------------------------------------
/FAQ/README.MD:
--------------------------------------------------------------------------------
1 | # Frequently Asked Questions
2 |
3 | All frequently asked questions are answered here:
4 | https://github.com/equinor/OmniaPlant/wiki/FAQ
5 |
--------------------------------------------------------------------------------
/Omnia Streaming/README.md:
--------------------------------------------------------------------------------
1 | # Omnia Streaming
2 |
3 | * [How to stream timeseries data to Omnia Industrial IoT platform](https://github.com/equinor/OmniaPlant/wiki/Omnia-Streaming)
4 | * [How to stream timeseries data from Omnia Industrial IoT platform](https://github.com/equinor/OmniaPlant/wiki/Streaming-API)
5 |
--------------------------------------------------------------------------------
/Omnia Subscriptions API/README.md:
--------------------------------------------------------------------------------
1 | # Omnia Subscriptions API
2 |
3 | The Omnia Subscriptions API is documented in Wiki.
4 | - [Public Omnia Subscriptions OpenAPI documentation](https://api.equinor.com/docs/services)
5 | - [How to authenticate and authorize](https://github.com/equinor/OmniaPlant/wiki/Authentication-&-Authorization)
6 | - [Subscriptions API](https://github.com/equinor/OmniaPlant/wiki/Subscriptions)
7 | - [Subscriptions Real-Time API](https://github.com/equinor/OmniaPlant/wiki/Subscriptions-Real-Time)
8 |
--------------------------------------------------------------------------------
/Omnia Timeseries API/timeseries_msal_devicecode/timeseries_msal_devicecode.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp2.2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/improvement-proposal.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Improvement proposal
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/Omnia Streaming/schema/datapoints_v2.json:
--------------------------------------------------------------------------------
1 | {
2 | "schema": "equinor/plant/schemas/ingest/datapoints_v2",
3 | "data": {
4 | "items": [
5 | {
6 | "id": "",
7 | "datapoints": [
8 | {
9 | "time": "2019-11-01T10:00:00.000Z",
10 | "value": 124.6,
11 | "status": 192
12 | },
13 | {
14 | "time": "2019-11-01T10:00:01.000Z",
15 | "value": 124.2,
16 | "status": 192
17 | }
18 | ]
19 | }
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **Trace ID**
14 | If you have received a response with a trace id, include it here.
15 |
16 | **To Reproduce**
17 | Steps to reproduce the behavior:
18 | 1. Go to '...'
19 | 2. Click on '....'
20 | 3. Scroll down to '....'
21 | 4. See error
22 |
23 | **Expected behavior**
24 | A clear and concise description of what you expected to happen.
25 |
26 | **Screenshots**
27 | If applicable, add screenshots to help explain your problem.
28 |
29 | **Criticality**
30 | Add something about criticality based on your usage. Showstopper? High? Medium? Low?
31 |
--------------------------------------------------------------------------------
/Omnia Timeseries API/README.md:
--------------------------------------------------------------------------------
1 | # Omnia Timeseries API
2 |
3 | The Omnia Timeseries API is documented in Wiki.
4 | - [Public Omnia Timeseries OpenAPI documentation](https://api.equinor.com)
5 | - [Omnia Timeseries API changelog](https://github.com/equinor/OmniaPlant/blob/master/Omnia%20Timeseries%20API/CHANGELOG.md)
6 | - [Introduction to Omnia Timeseries API](https://github.com/equinor/OmniaPlant/wiki)
7 | - [Timeseries Metadata (CRUD)](https://github.com/equinor/OmniaPlant/wiki/Timeseries-Metadata)
8 | - [Timeseries Raw Data (CRUD)](https://github.com/equinor/OmniaPlant/wiki/Timeseries-Data)
9 | - [Timeseries Aggregated Data](https://github.com/equinor/OmniaPlant/wiki/Timeseries-Aggregated-Data)
10 | - [How to authenticate and authorize](https://github.com/equinor/OmniaPlant/wiki/Authentication-&-Authorization)
11 | - [How to connect to Omnia Timeseries API from Postman](https://github.com/equinor/OmniaPlant/tree/master/Postman)
12 | - [Python SDK](https://github.com/equinor/OmniaPlant/wiki/Python-SDK)
13 | - [API Examples](https://github.com/equinor/OmniaPlant/wiki/API-examples)
14 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Equinor
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Omnia Timeseries API/timeseries_msal_devicecode/timeseries_msal_devicecode.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.28803.156
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "timeseries_msal_devicecode", "timeseries_msal_devicecode.csproj", "{C390C4D9-AD54-4ACC-BEB9-8319783830D5}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {C390C4D9-AD54-4ACC-BEB9-8319783830D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {C390C4D9-AD54-4ACC-BEB9-8319783830D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {C390C4D9-AD54-4ACC-BEB9-8319783830D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {C390C4D9-AD54-4ACC-BEB9-8319783830D5}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {E5231972-5360-432F-8766-A5DBA530440A}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/.attachments/Omnia Timeseries Beta.postman_environment.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "8013bbc8-ccf3-4d6e-a7f5-f6f879e68430",
3 | "name": "Omnia Timeseries Beta",
4 | "values": [
5 | {
6 | "key": "callbackUrl",
7 | "value": "https://www.getpostman.com/oauth2/callback/",
8 | "enabled": true
9 | },
10 | {
11 | "key": "tenant",
12 | "value": "3aa4a235-b6e2-48d5-9195-7fcf05b459b0",
13 | "enabled": true
14 | },
15 | {
16 | "key": "resource",
17 | "value": "32f2a909-8a98-4eb8-b22d-1208d9350cb0",
18 | "enabled": true
19 | },
20 | {
21 | "key": "clientId",
22 | "value": "675bd975-260f-498e-82cd-65f67b34fe7d",
23 | "enabled": true
24 | },
25 | {
26 | "key": "apiBaseUrl",
27 | "value": "https://api.gateway.equinor.com",
28 | "enabled": true
29 | },
30 | {
31 | "key": "clientSecret",
32 | "value": "",
33 | "enabled": true
34 | },
35 | {
36 | "key": "authUrl",
37 | "value": "https://login.microsoftonline.com/{{tenant}}/oauth2/authorize",
38 | "enabled": true
39 | },
40 | {
41 | "key": "tokenUrl",
42 | "value": "https://login.microsoftonline.com/{{tenant}}/oauth2/token",
43 | "enabled": true
44 | },
45 | {
46 | "key": "apim",
47 | "value": "https://api-test.gateway.equinor.com/plant",
48 | "enabled": true
49 | },
50 | {
51 | "key": "version",
52 | "value": "v1.7",
53 | "enabled": true
54 | },
55 | {
56 | "key": "timeseriesApi",
57 | "value": "{{apim}}/timeseries/{{version}}",
58 | "enabled": true
59 | }
60 | ],
61 | "_postman_variable_scope": "environment",
62 | "_postman_exported_at": "2021-12-20T11:22:48.151Z",
63 | "_postman_exported_using": "Postman/9.4.0"
64 | }
--------------------------------------------------------------------------------
/.attachments/Omnia Timeseries Production.postman_environment.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "28d3c97c-7b93-46b4-8dc1-35c19731dae7",
3 | "name": "Omnia Timeseries Production",
4 | "values": [
5 | {
6 | "key": "callbackUrl",
7 | "value": "https://www.getpostman.com/oauth2/callback/",
8 | "enabled": true
9 | },
10 | {
11 | "key": "tenant",
12 | "value": "3aa4a235-b6e2-48d5-9195-7fcf05b459b0",
13 | "enabled": true
14 | },
15 | {
16 | "key": "resource",
17 | "value": "141369bd-3dca-4b55-825b-56ad4a69b1fc",
18 | "enabled": true
19 | },
20 | {
21 | "key": "clientId",
22 | "value": "67da184b-6bde-43fd-a155-30ed4ff162d2",
23 | "enabled": true
24 | },
25 | {
26 | "key": "apiBaseUrl",
27 | "value": "https://api.gateway.equinor.com",
28 | "enabled": true
29 | },
30 | {
31 | "key": "clientSecret",
32 | "value": "",
33 | "enabled": true
34 | },
35 | {
36 | "key": "authUrl",
37 | "value": "https://login.microsoftonline.com/{{tenant}}/oauth2/authorize",
38 | "enabled": true
39 | },
40 | {
41 | "key": "tokenUrl",
42 | "value": "https://login.microsoftonline.com/{{tenant}}/oauth2/token",
43 | "enabled": true
44 | },
45 | {
46 | "key": "apim",
47 | "value": "https://api.gateway.equinor.com/plant",
48 | "enabled": true
49 | },
50 | {
51 | "key": "version",
52 | "value": "v1.7",
53 | "enabled": true
54 | },
55 | {
56 | "key": "timeseriesApi",
57 | "value": "{{apim}}/timeseries/{{version}}",
58 | "enabled": true
59 | }
60 | ],
61 | "_postman_variable_scope": "environment",
62 | "_postman_exported_at": "2021-12-20T11:23:03.573Z",
63 | "_postman_exported_using": "Postman/9.4.0"
64 | }
--------------------------------------------------------------------------------
/Postman/pre-request-script.md:
--------------------------------------------------------------------------------
1 | ```javascript
2 | var clientId = pm.variables.get("clientId");
3 |
4 | var clientSecret = pm.variables.get("clientSecret");
5 |
6 | var resource = pm.variables.get("resource");
7 |
8 | if (!clientId || !clientSecret || !resource) return;
9 |
10 |
11 |
12 | var currentResourceId = pm.globals.get("currentResourceId");
13 |
14 | var currentClientId = pm.globals.get("currentClientId");
15 |
16 | var expiresOn = pm.globals.get("accessTokenExpiry");
17 |
18 | if (currentResourceId == resource &&
19 |
20 | clientId == currentClientId &&
21 |
22 | expiresOn && Date.now() < expiresOn*1000) return;
23 |
24 |
25 |
26 | function urlEncode(obj) {
27 |
28 | var keys = Object.keys(obj), qParams = [];
29 |
30 | for (var i = 0; i < keys.length; i++) {
31 |
32 | qParams.push(keys[i] + "=" + encodeURIComponent(obj[keys[i]]));
33 |
34 | }
35 |
36 | return qParams.join("&");
37 |
38 | }
39 |
40 | const tokenRequest = {
41 |
42 | url: 'https://login.microsoftonline.com/3aa4a235-b6e2-48d5-9195-7fcf05b459b0/oauth2/token',
43 |
44 | method: 'POST',
45 |
46 | header: [
47 |
48 | 'Content-Type: application/x-www-form-urlencoded',
49 |
50 | 'Accept: application/json'
51 |
52 | ],
53 |
54 | body: {
55 |
56 | mode: 'raw',
57 |
58 | raw: urlEncode({
59 |
60 | resource: resource,
61 |
62 | client_id: clientId,
63 |
64 | client_secret: clientSecret,
65 |
66 | grant_type: "client_credentials"
67 |
68 | })
69 |
70 | }
71 |
72 | }
73 |
74 | pm.sendRequest(tokenRequest, function (err, response) {
75 |
76 | var jsonResult = response.json();
77 |
78 | if (err) {
79 |
80 | console.log(jsonResult);
81 |
82 | } else {
83 |
84 | pm.globals.set("currentAccessToken", jsonResult.access_token);
85 |
86 | pm.globals.set("accessTokenExpiry", jsonResult.expires_on);
87 |
88 | pm.globals.set("currentClientId", clientId);
89 |
90 | pm.globals.set("currentResourceId", resource);
91 |
92 | pm.globals.set("tokenExpireDate", new Date(jsonResult.expires_on*1000).toISOString());
93 |
94 | }
95 |
96 | });
97 | ```
98 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Omnia Industrial IoT Platform
2 | The Omnia Industrial IoT Platform is Equinor's platform for accessing contextualized industrial data from Equinor plants. All data and functionality are made available through open APIs so you can spend your time developing applications, applying analytics and accelerate/scale your digital initiatives. The platform is supporting and enabling many of Equinor's major projects on the digital roadmap such as Integrated Operations Centre (IOC), and it is also used for bi-directional data sharing with external suppliers and partners.
3 |
4 | 
5 |
6 | The current building blocks in the platform is centered around timeseries metadata and data. It consists of services to export and stream timeseries data and metadata from a number of different timeseries data sources both internally and externally. Data and functionality in Omnia Plant Data Platform is exposed by using APIs that both internal and external customers can use to build new value-adding application and services.
7 |
8 | The APIs are products themselves in the Omnia Plant Data Platform, and we adhere to the following overall data sharing principles:
9 | * All data sharing will happen through open, well-documented (using OpenAPI) and versioned APIs.
10 | * All data needs to be searchable.
11 | * Customers writing data back to Omnia Plant Data Platform shall provide it in a machine-readable format (that can be automatically read and processed by a computer).
12 | * No underlying technology will be exposed through the API - to ensure a continuous optimization of the backend.
13 | * APIs are defined and developed iteratively, driven by concrete use cases with business value.
14 |
15 | The Omnia Plant Data Platform is also adhering to Equinor's API strategy: https://github.com/equinor/api-strategy
16 |
17 | ## Working mode
18 | The team building the platform operates in two-week sprints, and a product goes through Alpha, Beta, General Available (GA) and Deprecation phases. When a product is released in Beta, invited customers and stakeholders will test and provide feedback on the product. When the product is General Available (put into production) customers can expect standard technical support according to Service Level Agreement (SLA), and full documentation will be available.
19 |
20 | A product or feature will be available and supported 12 months after customers have been notified that it will be removed. Deprecation takes for instance place when there is a new major release. The previous version can then be used and will be supported for 12 months before it is taken out of production.
21 |
22 | ## Support
23 | Do you need help? Take a look at https://github.com/equinor/OmniaPlant/wiki/Support
24 |
--------------------------------------------------------------------------------
/Omnia Timeseries API/csharp samples/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Microsoft.IdentityModel.Clients.ActiveDirectory;
7 | using System.Net.Http;
8 | using System.Web;
9 |
10 | namespace HelloTimeseries
11 | {
12 | class Program
13 | {
14 | public static void Main(string[] args)
15 | {
16 | try
17 | {
18 | callTimeseriesAPI().Wait();
19 | }
20 | catch (Exception)
21 | {
22 |
23 | throw;
24 | }
25 |
26 |
27 | }
28 |
29 | static private async Task callTimeseriesAPI ()
30 | {
31 | /*
32 | * NuGet Packages:
33 | * Microsoft.IdentityModel.Clients.ActiveDirectory
34 | *
35 | * Below you find client credentials. It is the user responsibility to be compliance to Equinor WR1211 chapter 9.3.1:
36 | * Passwords used to access Equinor information are private and shall not be shared or handled in a way that it allows
37 | * unauthorized access.
38 | * Secure the parameters and credentials, keep them out of the source code and version control.
39 | */
40 |
41 | //This is the resource id of the Timeseries API, provided by Omnia Plant
42 | const string resourceId = "";
43 |
44 | //This is the Equinor Azure AD tenant id, provided by Omnia Plant
45 | const string tenant = "";
46 |
47 | //This is the authority host where authentication requests are served
48 | const string authorityHostUrl = "";
49 |
50 | //This is the client/application id of your client app registered in Equinor's Azure AD tenant, provided by Omnia Plant
51 | const string clientId = "";
52 |
53 | //This is the client/application secret of your client app registered in Equinor's Azure AD tenant, provided by Omnia Plant
54 | const string clientSecret = "";
55 |
56 | //This is the API version, the version is included in the URI
57 | const string apiVersion = "v1.0";
58 |
59 | //API endpoint to call
60 | const string apiEndpoint = "timeseries";
61 |
62 | //Omnia Timeseries API host, will differ depending on being beta or GA release
63 | const string apiHost = "https://host/timeseries";
64 |
65 | // Get Access Token
66 | var authenticationContext = new AuthenticationContext(
67 | $"{authorityHostUrl}/{tenant}",
68 | TokenCache.DefaultShared);
69 |
70 |
71 | // Get Calling User's Access Token (Native Client)
72 | //AuthenticationResult token = await authenticationContext.AcquireTokenAsync(resourceId,
73 | // clientId, new Uri($"{redirectUri}"),
74 | // new PlatformParameters(PromptBehavior.Auto));
75 |
76 | // Get Access Token from API Client/Secret (Web)
77 | AuthenticationResult token = await authenticationContext.AcquireTokenAsync(
78 | resource: resourceId,
79 | clientCredential: new ClientCredential(
80 | clientId: clientId,
81 | clientSecret: clientSecret));
82 |
83 | string bearerToken = token.CreateAuthorizationHeader();
84 |
85 | // Get Timeseries Metadata object by ID
86 | var client = new HttpClient();
87 |
88 | // Request headers
89 | client.DefaultRequestHeaders.Add("Authorization", bearerToken);
90 |
91 | // ID of the Timeseries Metadata object to get
92 | string id = "guid";
93 |
94 | var myUri = $"{apiHost}/{apiVersion}/{apiEndpoint}/{id}";
95 | var response = await client.GetAsync(myUri);
96 |
97 | string json = await response.Content.ReadAsStringAsync();
98 |
99 | Console.WriteLine(json);
100 |
101 | }
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/Omnia Timeseries API/timeseries_msal_devicecode/Program.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Identity.Client;
2 | using Microsoft.Identity.Client.Extensibility;
3 | using System;
4 | using System.Diagnostics;
5 | using System.Linq;
6 | using System.Net.Http;
7 | using System.Net.Http.Headers;
8 | using System.Runtime.InteropServices;
9 | using System.Security.Claims;
10 | using System.Security.Principal;
11 | using System.Threading;
12 | using System.Threading.Tasks;
13 |
14 | namespace timeseries_msal_devicecode
15 | {
16 | class Program
17 | {
18 | static async Task Main(string[] args)
19 | {
20 | const string tenant = "3aa4a235-b6e2-48d5-9195-7fcf05b459b0";
21 | const string resource = "32f2a909-8a98-4eb8-b22d-1208d9350cb0";
22 | const string clientId = "b5e79b0d-fddb-4f65-8d10-99863858779f";
23 | //var authority = new Uri($"https://login.windows.net/{tenant}");
24 | string redirectUri = "https://login.microsoftonline.com/common/oauth2/nativeclient";
25 | string[] scopes = new string[] { $"{resource}/.default" };
26 |
27 | try
28 | {
29 |
30 | var app = PublicClientApplicationBuilder.Create(clientId)
31 | .WithTenantId(tenant)
32 | .WithExtraQueryParameters($"resource={resource}")
33 | .WithRedirectUri(redirectUri)
34 | .Build();
35 |
36 | AuthenticationResult result = null;
37 | var accounts = await app.GetAccountsAsync();
38 | try
39 | {
40 | result = await app.AcquireTokenSilent(scopes, accounts.FirstOrDefault())
41 | //.WithClaims("Timeseries.Admin,Timeseries.Read,Timeseries.Read.All")
42 | .ExecuteAsync();
43 |
44 | }
45 | catch (MsalUiRequiredException)
46 | {
47 | var customWebUi = new CustomWebUi();
48 | result = await app.AcquireTokenWithDeviceCode(scopes,
49 | async (dc) =>
50 | {
51 | Console.WriteLine($"Enter the following device code on the web page: {dc.UserCode}");
52 | OpenBrowser(dc.VerificationUrl);
53 | })
54 | .ExecuteAsync();
55 | }
56 |
57 | if (result != null)
58 | {
59 | var httpClient = new HttpClient();
60 | httpClient.BaseAddress = new Uri("https://api.gateway.equinor.com/");
61 | httpClient.DefaultRequestHeaders.Authorization =
62 | new AuthenticationHeaderValue("Bearer", result.AccessToken);
63 | Console.WriteLine("Requesting timeseries...");
64 | var response = await httpClient.GetAsync("/plant-beta/timeseries/v1.2?limit=10");
65 | Console.WriteLine("Reading response body...");
66 | var body = await response.Content.ReadAsStringAsync();
67 | Console.WriteLine(body);
68 | }
69 |
70 | }
71 | catch (Exception ex)
72 | {
73 | Console.WriteLine($"[{ex.GetType().Name}] {ex.Message}");
74 | Console.WriteLine(ex.StackTrace);
75 | }
76 |
77 | Console.ReadLine();
78 | }
79 |
80 | private class CustomWebUi : ICustomWebUi
81 | {
82 | public CustomWebUi()
83 | {
84 | }
85 |
86 | public Task AcquireAuthorizationCodeAsync(Uri authorizationUri, Uri redirectUri, CancellationToken cancellationToken)
87 | {
88 | throw new NotImplementedException();
89 | }
90 | }
91 |
92 | private static void OpenBrowser(string url)
93 | {
94 | try
95 | {
96 | Process.Start(url);
97 | }
98 | catch
99 | {
100 | // hack because of this: https://github.com/dotnet/corefx/issues/10361
101 | if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
102 | {
103 | Process.Start(new ProcessStartInfo(url) { CreateNoWindow = true, UseShellExecute = true });
104 | }
105 | else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
106 | {
107 | Process.Start("xdg-open", url);
108 | }
109 | else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
110 | {
111 | Process.Start("open", url);
112 | }
113 | else
114 | {
115 | throw;
116 | }
117 | }
118 | }
119 | }
120 | }
121 |
--------------------------------------------------------------------------------
/Omnia Timeseries API/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Omnia Timeseries API changelog
2 |
3 | All notable changes to this API will be documented in this file.
4 |
5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6 | ## [v1.7.7]
7 | ### Added
8 | - New StandardUnit returned in metadata payload, where dialects of UoM (Unit of Measurement) are translated to standardized unit ref Equinor "common library".
9 |
10 | ### Changed
11 | - General improvements and error corrections
12 |
13 | ## [v1.7.6]
14 | ### Added
15 | - Federation, support messagepack on raw anda ggregated
16 | - Federation, improved time limit support on calls federated to Data Lake
17 | - Federation to Data Lake, enable fill, limit and status filter
18 |
19 | ### Changed
20 | - Optimize first and lates on federation
21 | - improved metrics
22 |
23 | ## [v1.7.5]
24 | ### Added
25 | - Multiple aggregates in Data Lake federation
26 | - Rate limiting
27 |
28 | ### Changed
29 | - General improvements and error corrections
30 |
31 | ## [v1.7.4]
32 | ### Changed
33 | - Improved metrics logging
34 |
35 | ## [v1.7.3]
36 | ### Added
37 | - Search on datetime
38 |
39 | ### Changed
40 | - Optimized getlatest when status filter used
41 | - General improvements and error corrections
42 |
43 | ## [v1.7.2]
44 | ### Changed
45 | - Improved caching
46 | - General improvements and error corrections
47 |
48 | ## [v1.7.1]
49 | ### Added
50 | - Federation, black / white listing consept included
51 |
52 | ### Changed
53 | - Federation, general improvements and error corrections
54 |
55 | ## [v1.7]
56 | ### Added
57 | - Federation, new concept, new optional parameter federationSource on some endpoints
58 | - Federation, new endpoint:
59 | * https://api.equinor.com/docs/services/Timeseries-api-beta-v1-7/operations/getDataByName?
60 | - New endpoints for streaming subscriptions
61 | - New endpoint to read metadata change history
62 |
63 | ### Changed
64 | - General improvements and error corrections
65 |
66 | ## [v1.6] SUNSET (REMOVED) Aug 2022.
67 | ### Added
68 | - Response encoded in Protobuf added as an option for the following data points (/data) endpoints:
69 | * https://api.equinor.com/docs/services/Timeseries-api-v1-6/operations/getDatapoints?
70 | * https://api.equinor.com/docs/services/Timeseries-api-v1-6/operations/get-aggregates?
71 | * https://api.equinor.com/docs/services/Timeseries-api-v1-6/operations/getMultiDatapoints?
72 | * https://api.equinor.com/docs/services/Timeseries-api-v1-6/operations/getFirstDatapoint?
73 | * https://api.equinor.com/docs/services/Timeseries-api-v1-6/operations/getFirstMultiDatapoint?
74 | * https://api.equinor.com/docs/services/Timeseries-api-v1-6/operations/getLatestDatapoint?
75 | * https://api.equinor.com/docs/services/Timeseries-api-v1-6/operations/getLastMultiDatapoint?
76 | - Added "Facility" as a mandatory new metadata field when creating a new timeseries object (https://api.equinor.com/docs/services/Timeseries-api-v1-6/operations/postTimeseries?). The facility field shall represent the plant code the timeseries belongs to. Only valid facility codes according to Equinor Common Library (master data) will be accepted. If an invalid facility code is sent in the body, a **"400 Bad Request" is returned with the message "Facility not found."**
77 | - Enhanced access control where we are able to control the access on source (e.g. Historian) across plants and on both source and plant (e.g. Historian from Åsgard B). This works both for both OAuth 2.0 grant flows (service-to-service and user impersonation).
78 | - Support for CORS (Cross-Origin Resource Sharing) [minor v1.6.1]
79 | - Improved authorization to data from other sources than historian/IMS [minor v1.6.1]
80 | - New endpoint to add or get multiple timeseries objects: [minor v1.6.2
81 | * https://api.equinor.com/docs/services/Timeseries-api-v1-6/operations/postGetOrAddTimeseries
82 |
83 |
84 | ### Removed
85 | - Metadata (name and unit) removed from the response returned from all data point endpoints (/data), you will only get the timeseries id and VQT (value, quality, timestamp).
86 |
87 | ### Changed
88 | - You are not allowed to create a timeseries metadata object with the same name on the same facility. A **"409 Conflict" with the message "Attempt to store timeseries 'name' from 'facility' which already exists"**. In version 1.5 the constraint was on the fields "name + assetId".
89 | - Creating a new timeseries object in Omnia Timeseries API v1.6 with facility = "XXX" where a timeseries already exists with the same name and assetId = "XXX" will return a **"409 Conflict" with the message "Attempt to store timeseries 'name' from 'facility' which already exists"**.
90 | - The "facility" field is now mandatory as opposed to "assetId" in v1.5 that was optional.
91 | - Error message response, tracedID returned instead of activityID. [minor v.1.6.2]
92 |
93 | ### Fixed
94 | - Various backend tuning to improve the performance.
95 |
96 | ## [v1.5]
97 | ### Added
98 | - Added support for retrieves datapoints from multiple timeseries (max 100) in one request.
99 | - Added a new field "metadata" that can be used to add custom metadata on a timeseries (key,value pairs).
100 | - Both afterTime and beforeTime (bounds) now optional parameters when getting the first datapoint.
101 | - Both afterTime and beforeTime (bounds) now optional parameters when getting the last datapoint.
102 | - Added support for filtering on datapoint status on both raw and aggregated timeseries data.
103 | - The return limit for data points is now increased to 100 000.
104 |
105 | ## [v1.4]
106 | ### Added
107 | - Added support to authenticate on behalf of a user and authorize based on AD group membership. Only for users with Equinor accounts.
108 | - New endpoint for deleting timeseries data points and timeseries metadata objects
109 |
110 | ## [v1.3]
111 | ### Added
112 | - Writing timeseries data points using HTTP POST on one or multiple timeseries, with the option of choosing it to be asynchronous or not.
113 | - Wildcard (using asterisk) search on the timeseries metadata fields name, description and unit, and now support for starting the search with asterisk
114 | - Filtering on multiple fields in timeseries list
115 |
116 | ## [v1.2]
117 | ### Added
118 | - Get aggregated timeseries data (avg, min, max, sum, stddev, count) according to time window, processing interval and filling of empty processing intervals.
119 | - Wildcard (using asterisk) search on timeseries name (currently not supporting searches starting with asterisk)
120 |
121 | ## [v1.1]
122 | ### Added
123 | - Create one timeseries metadata object
124 | - Partial update of one timeseries metadata object
125 | - Full update of one timeseries metadata object
126 | - Retrieve one timeseries metadata object by id
127 | - Retrieve a list of all timeseries, or a subset based on one of the query parameters: name, externalId or assetId
128 | - Retrieve raw data points (timeseries data) within a given time window (id, startTime, endTime)
129 | - Include outside data points (left and right outside points)
130 | - Retrieve first data point of a timeseries
131 | - Retrieve latest data point of a timeseries
132 | - Support for paging (by continuation token) on both timeseries metadata and timeseries data
133 |
--------------------------------------------------------------------------------
/.attachments/Omnia Timeseries.postman_collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "info": {
3 | "_postman_id": "c1919ced-6c20-494f-aabc-d0fac1db6acf",
4 | "name": "Omnia Timeseries",
5 | "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
6 | },
7 | "item": [
8 | {
9 | "name": "Metadata",
10 | "item": [
11 | {
12 | "name": "List timeseries",
13 | "event": [
14 | {
15 | "listen": "prerequest",
16 | "script": {
17 | "exec": [
18 | ""
19 | ],
20 | "type": "text/javascript"
21 | }
22 | }
23 | ],
24 | "request": {
25 | "method": "GET",
26 | "header": [
27 | {
28 | "key": "Content-Type",
29 | "value": "application/json",
30 | "type": "text"
31 | }
32 | ],
33 | "url": {
34 | "raw": "{{timeseriesApi}}?limit=5",
35 | "host": [
36 | "{{timeseriesApi}}"
37 | ],
38 | "query": [
39 | {
40 | "key": "limit",
41 | "value": "5"
42 | }
43 | ]
44 | }
45 | },
46 | "response": []
47 | },
48 | {
49 | "name": "Get timeseries by id",
50 | "request": {
51 | "method": "GET",
52 | "header": [],
53 | "url": {
54 | "raw": "{{timeseriesApi}}/:id",
55 | "host": [
56 | "{{timeseriesApi}}"
57 | ],
58 | "path": [
59 | ":id"
60 | ],
61 | "variable": [
62 | {
63 | "key": "id",
64 | "value": "{{id}}"
65 | }
66 | ]
67 | }
68 | },
69 | "response": []
70 | }
71 | ],
72 | "event": [
73 | {
74 | "listen": "prerequest",
75 | "script": {
76 | "type": "text/javascript",
77 | "exec": [
78 | ""
79 | ]
80 | }
81 | },
82 | {
83 | "listen": "test",
84 | "script": {
85 | "type": "text/javascript",
86 | "exec": [
87 | ""
88 | ]
89 | }
90 | }
91 | ]
92 | },
93 | {
94 | "name": "Data",
95 | "item": [
96 | {
97 | "name": "Get raw data",
98 | "request": {
99 | "method": "GET",
100 | "header": [],
101 | "url": {
102 | "raw": "{{timeseriesApi}}/:id/data/?startTime=2021-11-09T14:03:05Z&endTime=2021-11-10T14:03:05Z",
103 | "host": [
104 | "{{timeseriesApi}}"
105 | ],
106 | "path": [
107 | ":id",
108 | "data",
109 | ""
110 | ],
111 | "query": [
112 | {
113 | "key": "startTime",
114 | "value": "2021-11-09T14:03:05Z"
115 | },
116 | {
117 | "key": "endTime",
118 | "value": "2021-11-10T14:03:05Z"
119 | }
120 | ],
121 | "variable": [
122 | {
123 | "key": "id",
124 | "value": "{{id}}"
125 | }
126 | ]
127 | }
128 | },
129 | "response": []
130 | },
131 | {
132 | "name": "Get raw data latest",
133 | "request": {
134 | "method": "GET",
135 | "header": [],
136 | "url": {
137 | "raw": "{{timeseriesApi}}/:id/data/latest/?afterTime=2021-11-09T14:03:05Z&beforeTime=2021-11-10T14:03:05Z",
138 | "host": [
139 | "{{timeseriesApi}}"
140 | ],
141 | "path": [
142 | ":id",
143 | "data",
144 | "latest",
145 | ""
146 | ],
147 | "query": [
148 | {
149 | "key": "afterTime",
150 | "value": "2021-11-09T14:03:05Z"
151 | },
152 | {
153 | "key": "beforeTime",
154 | "value": "2021-11-10T14:03:05Z"
155 | }
156 | ],
157 | "variable": [
158 | {
159 | "key": "id",
160 | "value": "{{id}}"
161 | }
162 | ]
163 | }
164 | },
165 | "response": []
166 | },
167 | {
168 | "name": "Get raw data first",
169 | "request": {
170 | "method": "GET",
171 | "header": [],
172 | "url": {
173 | "raw": "{{timeseriesApi}}/:id/data/first/?afterTime=2021-11-09T14:03:05Z&beforeTime=2021-11-10T14:03:05Z",
174 | "host": [
175 | "{{timeseriesApi}}"
176 | ],
177 | "path": [
178 | ":id",
179 | "data",
180 | "first",
181 | ""
182 | ],
183 | "query": [
184 | {
185 | "key": "afterTime",
186 | "value": "2021-11-09T14:03:05Z"
187 | },
188 | {
189 | "key": "beforeTime",
190 | "value": "2021-11-10T14:03:05Z"
191 | }
192 | ],
193 | "variable": [
194 | {
195 | "key": "id",
196 | "value": "{{id}}"
197 | }
198 | ]
199 | }
200 | },
201 | "response": []
202 | },
203 | {
204 | "name": "Get aggregated data",
205 | "event": [
206 | {
207 | "listen": "test",
208 | "script": {
209 | "exec": [
210 | "var jsonData = JSON.parse(responseBody);\r",
211 | "//postman.setEnvironmentVariable(\"continue\", jsonData.continuationToken);\r",
212 | "pm.environment.unset(\"continue\");\r",
213 | "pm.globals.set(\"continue\", jsonData.continuationToken);"
214 | ],
215 | "type": "text/javascript"
216 | }
217 | }
218 | ],
219 | "protocolProfileBehavior": {
220 | "disableBodyPruning": true
221 | },
222 | "request": {
223 | "method": "GET",
224 | "header": [
225 | {
226 | "key": "Content-Type",
227 | "name": "Content-Type",
228 | "type": "text",
229 | "value": "application/json"
230 | }
231 | ],
232 | "body": {
233 | "mode": "raw",
234 | "raw": ""
235 | },
236 | "url": {
237 | "raw": "{{timeseriesApi}}/:id/data/aggregates?startTime=2021-07-01T00:00:00.000000Z&endTime=2021-07-01T01:00:00.000000Z&processingInterval=5m&aggregateFunction=avg",
238 | "host": [
239 | "{{timeseriesApi}}"
240 | ],
241 | "path": [
242 | ":id",
243 | "data",
244 | "aggregates"
245 | ],
246 | "query": [
247 | {
248 | "key": "startTime",
249 | "value": "2021-07-01T00:00:00.000000Z"
250 | },
251 | {
252 | "key": "endTime",
253 | "value": "2021-07-01T01:00:00.000000Z"
254 | },
255 | {
256 | "key": "processingInterval",
257 | "value": "5m"
258 | },
259 | {
260 | "key": "aggregateFunction",
261 | "value": "avg"
262 | },
263 | {
264 | "key": "limit",
265 | "value": "15",
266 | "disabled": true
267 | }
268 | ],
269 | "variable": [
270 | {
271 | "key": "id",
272 | "value": "{{id}}"
273 | }
274 | ]
275 | }
276 | },
277 | "response": []
278 | },
279 | {
280 | "name": "Multiple raw data",
281 | "event": [
282 | {
283 | "listen": "test",
284 | "script": {
285 | "exec": [
286 | ""
287 | ],
288 | "type": "text/javascript"
289 | }
290 | }
291 | ],
292 | "request": {
293 | "method": "POST",
294 | "header": [
295 | {
296 | "key": "Content-Type",
297 | "name": "Content-Type",
298 | "type": "text",
299 | "value": "application/json"
300 | }
301 | ],
302 | "body": {
303 | "mode": "raw",
304 | "raw": "[\r\n {\r\n \"id\": \"{{id}}\",\r\n \"startTime\": \"2021-06-01T02:48:50.000Z\",\r\n \"endTime\": \"2021-06-01T02:58:50.000Z\"\r\n },\r\n {\r\n \"id\": \"{{id2}}\",\r\n \"startTime\": \"2021-06-01T02:48:50.000Z\",\r\n \"endTime\": \"2021-06-01T02:58:50.000Z\"\r\n }\r\n]"
305 | },
306 | "url": {
307 | "raw": "{{timeseriesApi}}/query/data",
308 | "host": [
309 | "{{timeseriesApi}}"
310 | ],
311 | "path": [
312 | "query",
313 | "data"
314 | ]
315 | }
316 | },
317 | "response": []
318 | },
319 | {
320 | "name": "Multiple raw data latest",
321 | "event": [
322 | {
323 | "listen": "test",
324 | "script": {
325 | "exec": [
326 | ""
327 | ],
328 | "type": "text/javascript"
329 | }
330 | }
331 | ],
332 | "request": {
333 | "method": "POST",
334 | "header": [
335 | {
336 | "key": "Content-Type",
337 | "name": "Content-Type",
338 | "type": "text",
339 | "value": "application/json"
340 | }
341 | ],
342 | "body": {
343 | "mode": "raw",
344 | "raw": "[\r\n {\r\n \"id\": \"{{id}}\",\r\n \"startTime\": \"2021-06-01T02:48:50.000Z\",\r\n \"endTime\": \"2021-06-01T02:58:50.000Z\"\r\n },\r\n {\r\n \"id\": \"{{id2}}\",\r\n \"startTime\": \"2021-06-01T02:48:50.000Z\",\r\n \"endTime\": \"2021-06-01T02:58:50.000Z\"\r\n }\r\n]"
345 | },
346 | "url": {
347 | "raw": "{{timeseriesApi}}/query/data/latest",
348 | "host": [
349 | "{{timeseriesApi}}"
350 | ],
351 | "path": [
352 | "query",
353 | "data",
354 | "latest"
355 | ]
356 | }
357 | },
358 | "response": []
359 | },
360 | {
361 | "name": "Multiple raw data first",
362 | "event": [
363 | {
364 | "listen": "test",
365 | "script": {
366 | "exec": [
367 | ""
368 | ],
369 | "type": "text/javascript"
370 | }
371 | }
372 | ],
373 | "request": {
374 | "method": "POST",
375 | "header": [
376 | {
377 | "key": "Content-Type",
378 | "name": "Content-Type",
379 | "type": "text",
380 | "value": "application/json"
381 | }
382 | ],
383 | "body": {
384 | "mode": "raw",
385 | "raw": "[\r\n {\r\n \"id\": \"{{id}}\",\r\n \"startTime\": \"2021-06-01T02:48:50.000Z\",\r\n \"endTime\": \"2021-06-01T02:58:50.000Z\"\r\n },\r\n {\r\n \"id\": \"{{id2}}\",\r\n \"startTime\": \"2021-06-01T02:48:50.000Z\",\r\n \"endTime\": \"2021-06-01T02:58:50.000Z\"\r\n }\r\n]"
386 | },
387 | "url": {
388 | "raw": "{{timeseriesApi}}/query/data/first",
389 | "host": [
390 | "{{timeseriesApi}}"
391 | ],
392 | "path": [
393 | "query",
394 | "data",
395 | "first"
396 | ]
397 | }
398 | },
399 | "response": []
400 | },
401 | {
402 | "name": "Multiple aggregate data",
403 | "event": [
404 | {
405 | "listen": "test",
406 | "script": {
407 | "exec": [
408 | ""
409 | ],
410 | "type": "text/javascript"
411 | }
412 | }
413 | ],
414 | "request": {
415 | "method": "POST",
416 | "header": [
417 | {
418 | "key": "Content-Type",
419 | "name": "Content-Type",
420 | "type": "text",
421 | "value": "application/json"
422 | }
423 | ],
424 | "body": {
425 | "mode": "raw",
426 | "raw": "[\r\n {\r\n \"id\": \"{{id}}\",\r\n \"startTime\": \"2021-06-01T02:48:50.000Z\",\r\n \"endTime\": \"2021-06-01T02:58:50.000Z\",\r\n \"aggregateFunctions\": [\r\n \"avg\"\r\n ]\r\n },\r\n {\r\n \"id\": \"{{id2}}\",\r\n \"startTime\": \"2021-06-01T02:48:50.000Z\",\r\n \"endTime\": \"2021-06-01T02:58:50.000Z\",\r\n \"aggregateFunctions\": [\r\n \"avg\"\r\n ]\r\n }\r\n]"
427 | },
428 | "url": {
429 | "raw": "{{timeseriesApi}}/query/data",
430 | "host": [
431 | "{{timeseriesApi}}"
432 | ],
433 | "path": [
434 | "query",
435 | "data"
436 | ]
437 | }
438 | },
439 | "response": []
440 | }
441 | ]
442 | },
443 | {
444 | "name": "Search",
445 | "item": [
446 | {
447 | "name": "Search metadata by facility and name",
448 | "request": {
449 | "method": "GET",
450 | "header": [],
451 | "url": {
452 | "raw": "{{timeseriesApi}}/search/?facility=1191&name=ASGB.17IIC1030/Meas/PRIM",
453 | "host": [
454 | "{{timeseriesApi}}"
455 | ],
456 | "path": [
457 | "search",
458 | ""
459 | ],
460 | "query": [
461 | {
462 | "key": "facility",
463 | "value": "1191"
464 | },
465 | {
466 | "key": "name",
467 | "value": "ASGB.17IIC1030/Meas/PRIM"
468 | }
469 | ]
470 | }
471 | },
472 | "response": []
473 | },
474 | {
475 | "name": "Search metadata",
476 | "request": {
477 | "method": "GET",
478 | "header": [],
479 | "url": {
480 | "raw": "{{timeseriesApi}}/search/ASGB.17IIC1030*?source=IMS",
481 | "host": [
482 | "{{timeseriesApi}}"
483 | ],
484 | "path": [
485 | "search",
486 | "ASGB.17IIC1030*"
487 | ],
488 | "query": [
489 | {
490 | "key": "facility",
491 | "value": "1191",
492 | "disabled": true
493 | },
494 | {
495 | "key": "name",
496 | "value": "ASGB.17IIC1030/Meas/PRIM",
497 | "disabled": true
498 | },
499 | {
500 | "key": "source",
501 | "value": "IMS"
502 | }
503 | ]
504 | }
505 | },
506 | "response": []
507 | },
508 | {
509 | "name": "Search metadata with wildcard",
510 | "request": {
511 | "method": "GET",
512 | "header": [],
513 | "url": {
514 | "raw": "{{timeseriesApi}}/search/?facility=1191&name=ASGB.17IIC1030/*/PRIM",
515 | "host": [
516 | "{{timeseriesApi}}"
517 | ],
518 | "path": [
519 | "search",
520 | ""
521 | ],
522 | "query": [
523 | {
524 | "key": "facility",
525 | "value": "1191"
526 | },
527 | {
528 | "key": "name",
529 | "value": "ASGB.17IIC1030/*/PRIM"
530 | }
531 | ]
532 | }
533 | },
534 | "response": []
535 | }
536 | ]
537 | }
538 | ],
539 | "auth": {
540 | "type": "oauth2",
541 | "oauth2": [
542 | {
543 | "key": "resource",
544 | "value": {
545 | "4ec58f7e-e210-4d47-9a4c-469d9bdf537f": "{{resource}}"
546 | },
547 | "type": "any"
548 | },
549 | {
550 | "key": "clientId",
551 | "value": "{{clientId}}",
552 | "type": "string"
553 | },
554 | {
555 | "key": "accessTokenUrl",
556 | "value": "{{tokenUrl}}",
557 | "type": "string"
558 | },
559 | {
560 | "key": "authUrl",
561 | "value": "{{authUrl}}",
562 | "type": "string"
563 | },
564 | {
565 | "key": "redirect_uri",
566 | "value": "{{callbackUrl}}",
567 | "type": "string"
568 | },
569 | {
570 | "key": "tokenName",
571 | "value": "tstoken",
572 | "type": "string"
573 | },
574 | {
575 | "key": "client_authentication",
576 | "value": "body",
577 | "type": "string"
578 | },
579 | {
580 | "key": "addTokenTo",
581 | "value": "header",
582 | "type": "string"
583 | }
584 | ]
585 | },
586 | "event": [
587 | {
588 | "listen": "prerequest",
589 | "script": {
590 | "type": "text/javascript",
591 | "exec": [
592 | ""
593 | ]
594 | }
595 | },
596 | {
597 | "listen": "test",
598 | "script": {
599 | "type": "text/javascript",
600 | "exec": [
601 | ""
602 | ]
603 | }
604 | }
605 | ]
606 | }
--------------------------------------------------------------------------------