Skip to content

Jekyll documentation site #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
title: "Power Grid Optimizer"
remote_theme: just-the-docs/just-the-docs
color_scheme: sinteflight
baseurl: /pgo
2 changes: 1 addition & 1 deletion docs/_includes/components/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{%- endcomment -%}

<div class="side-bar">
<img class="logoimg" src="/assets/sintef.jpg" />
<img class="logoimg" src="{{ '/' | relative_url }}assets/sintef.jpg" />
<div class="site-header" role="banner">
<a href="{{ '/' | relative_url }}" class="site-title lh-tight">{% include title.html %}</a>
<button id="menu-button" class="site-button btn-reset" aria-label="Toggle menu" aria-pressed="false">
Expand Down
4 changes: 2 additions & 2 deletions docs/background.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ We expect that usage of the PGO may achieve significant savings and added grid r

For a fast touch-and-feel introduction, please try out our [web application](https://pgosintef.azurewebsites.net/#/). This is a simple web-based user interface which you can use to access the PGO server and try out some grid configuration optimisation. The user manualfor the web application is [here](demo-client-user-manual.md).

![image](assets/PgoCapture-600x384.jpg)
![image](images/PgoCapture-600x384.jpg)

### The API

Expand All @@ -44,7 +44,7 @@ The API is http-based (see Figure 2). Simply put, this API can be used programma
* Upload any configuration that may have been otherwise produced outside the PGO, and have it evaluated in terms of power flow and configuration quality.


| ![pgo_swagger-600x568.png](assets/pgo_swagger-600x568.png) |
| ![pgo_swagger-600x568.png](images/pgo_swagger-600x568.png) |
|:--:|
| *The service comes with a complete on-line API reference documentation* |

Expand Down
12 changes: 12 additions & 0 deletions docs/contact.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Contact
nav_order: 5
---

## Please do not hesitate to get in touch
If you have questions regarding the Power Grid Optimizer, is usage, pricing, or other, please feel free to contact us.

Email our team: **[[email protected]](mailto:[email protected])**



Binary file added docs/documentation/3WindedProvider-300x166.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions docs/documentation/api-getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: API - Getting started
nav_order: 3
parent: Documentation
---

# Getting started using the API

In an actual deployment, the proper endpoints should be used, but it is also possible to test through Swagger. Here we illustrate the intended flow of the service.

1. `POST /api/networks/n1` with a network JSON file in the request body to load a power network and name it `n1`.
2. `GET /api/networks/n1/analysis` can optionally be called to analyse the loaded network and flag any issues with the network structure that might cause problems for the optimization.
3. `POST /api/sessions/s1` to create a session with id `s1` and give a forecast JSON file in the request body. Here, a start configuration JSON file may also be given.
4. `PUT /api/sessions/s1/runOptimization` with `true` in the request body to start the optimization.
5. Wait a minute or so. The optimizer works iteratively, and the current state can be polled with `GET /api/sessions/s1` or (for more details) `GET /api/sessions/s1/bestSolutionInfo`.
6. When a solution is desired, it can be retrieved with `GET /api/sessions/s1/bestSolution`.
7. To halt the solver work, `PUT /api/sessions/s1/runOptimization` with false in the request body.

![API workflow](apiflow-2.png)

See also the [full API reference](https://pgosintef.azurewebsites.net/swagger/index.html).

## How to authenticate with the Power Grid Optimizer API



When using the Power Grid Optimizer API, you are required to pass a bearer token along with your requests. The bearer token is received from a separate authentication endpoint in Azure.

To acquire a bearer token, send a POST request to https://login.microsoftonline.com/061e3366-f8d3-4124-83e5-7c78e66a78db/oauth2/v2.0/token . The body should consist of form data with the following fields:

* client_id: (Obtained from SINTEF)
* client_secret: (Obtained from SINTEF)
* grant_type: client_credentials
* scope: https://sintefconnect.onmicrosoft.com/4f57874f-66d5-4727-af75-b5da36bdf533/.default
*
The response will be JSON containing an access token under the key “access_token“. When sending requests to Power Grid Optimizer endpoints, add the token to the Authorization header, preceeded by the word “Bearer” like so:

```
Authorization: Bearer <token>
```

This header should be added to all HTTP API requests, both on SINTEFs cloud instance and on locally deployed Docker image instances.

Binary file added docs/documentation/apiflow-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/documentation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Below you will find an overview of the various types of documentation that will
The following documentation is available for the PGO service:

* [An introduction to the PGO model](introduction.md)
* [Modelling examples](modelling.md)
* [Modelling examples](modelling-examples.md)
* API documentation:
* [Getting started using the API](api-getting-started.md)
* [Full API reference](https://pgosintef.azurewebsites.net/swagger/index.html)
2 changes: 1 addition & 1 deletion docs/documentation/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ In addition, a start and end configuration may be provided, describing the state
## The models


In the current version, PGO uses JSON-formatted data to communicate problem data and solutions (in the near future also CIM data communication will be supported). Details on the structure of the JSON data can be viewed under the Models header in the served API overview, see [getting started](api-getting.started.md). In this section we will describe the concepts more generally, leaving the technical details to the API documentation. In the [examples](modelling.md) we show some simple illustrations of how to express a problem on the JSON format.
In the current version, PGO uses JSON-formatted data to communicate problem data and solutions (in the near future also CIM data communication will be supported). Details on the structure of the JSON data can be viewed under the Models header in the served API overview, see [getting started](api-getting.started.md). In this section we will describe the concepts more generally, leaving the technical details to the API documentation. In the [modelling examples](modelling-examples.md), we show some simple illustrations of how to express a problem on the JSON format.

### The power grid

Expand Down
Loading