Skip to content
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

Start doc of API responses #106

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
327 changes: 327 additions & 0 deletions specifications/example-api-responses.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,327 @@
# Examples of API Responses

* TOC
{:toc}

## 5.1.1 Topology Level

```
==Request==
GET /power-system-resource/US-WECC-CISO/topology?numLevels=2 HTTP/1.1
Host: demoutility.com

==Response==
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"id": "US-WECC-CISO",
"unit": "MW",
"capacity": [
{
"fuelSource": {
"technology": "Thermal - Steam engine - Unspecified",
"type": "Fossil - Solid - Hard Coal - Unspecified"
},
"value": 500,
"startDatetime": "2015-06-01 00:00:00+00",
"endDatetime": "2021-06-01T00:00:00+00"
},
{
"fuelSource": {
"technology": "Thermal - Steam engine - Unspecified",
"type": "Fossil - Solid - Hard Coal - Unspecified"
},
"startDatetime": "2010-06-01 00:00:00+00",
"value": 300
}
],
"next": null,
"previous": null
}
```

## 5.1.2 PSR (List)

The following is an example of the endpoint that returns a list of
PowerSystemResources. This LIST endpoint should only include the `id`,
`name`, and `topology_level` fields. It MUST NOT contain fields of
undefined size (such as fields that should contain lists or dicts), as
this endpoint is meant to be capable of returning several entries.

```
==Request==
GET /power-system-resources HTTP/1.1
Host: demoutility.com

==Response==
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

{
"power_system_resources": [
{
"id": "US-WECC",
"name": "Western Electricity Coordinating Council",
"topology_level": 0
},
{
"id": "US-WECC-CISO",
"name": "California ISO",
"topology_level": 1
},
{
"id": "US-WECC-CISO-ABC-HYDRO",
"name": "Hydropower Plant in ABC",
"topology_level": 2
}
],
"next": null,
"previous": null
}
```

## 5.1.4 PSR Describe

```
==Request==
GET /power-system-resource/US-WECC-CISO/describe HTTP/1.1
Host: demoutility.com

==Response==
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

{
"id": "US-WECC-CISO",
"describe": {
"location": {
"geojson": {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[[-122.376131, 42.009499], ...]
]
}
}
]
}
}
},
"next": null,
"previous": null
}
```

## 5.2.2 PSR Generation

```
==Request==
GET /power-system-resource/US-WECC-CISO/generation?startDatetime=2022-06-01&endDatetime=201-06-02 HTTP/1.1
Host: demoutility.com

==Response==
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

{
"id": "US-WECC-CISO",
"unit": "MWh",
"generation": [
{
"startDatetime": "2021-06-01 00:00:00+00",
"endDatetime": "2021-06-01 01:00:00+00",
"value": 10.5,
"valueByFuelSource": [
{
"technology": "Thermal - Steam engine - Unspecified",
"type": "Fossil - Solid - Hard Coal - Unspecified",
"value": 5.0
},
{
"technology": "Solar - Photovoltaic - Unspecified",
"type": "Renewables - Heating and Cooling - Solar",
"value": 10.5
},
// Additional entries for other fuel sources if available
]
}
// Additional entries for other time periods if available
],
"next": null,
"previous": null
}
```

### 5.2.3 PSR Demand

```
==Request==
GET /power-system-resource/US-WECC-CISO/demand?startDatetime=2022-01-01&endDatetime=2023-01-01 HTTP/1.1
Host: demoutility.com

==Response==
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

{
"id": "US-WECC-CISO",
"unit": "MWh",
"demand": [
{
"startDatetime": "2021-06-01 00:00:00+00",
"endDatetime": "2021-06-01 01:00:00+00",
"value": 10.5
},
// Additional entries for other time periods if available
],
"next": null,
"previous": null
}
```

## 5.2.4 PSR Imports

```
==Request==
GET /power-system-resource/US-WECC-CISO/imports?startDatetime=2022-01-01&endDatetime=2023-01-01 HTTP/1.1
Host: demoutility.com

==Response==
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

{
"id": "US-WECC-CISO",
"unit": "MWh",
"imports": [
{
"startDatetime": "2021-06-01 00:00:00+00",
"endDatetime": "2021-06-01 01:00:00+00",
"value": 10.5,
"importByConnectedPSR": [
{
"connectedPSR": "US-WECC-LADWP",
"value": 5.5
},
{
"connectedPSR": "US-WECC-BANC",
"value": 5
},
// Additional entries for other connected PSRs if available
]
},
// Additional entries for other time periods if available
],
"next": null,
"previous": null
}
```

## 5.2.5 PSR Exports

```
==Request==
GET /power-system-resource/US-WECC-CISO/exports?startDatetime=2022-01-01&endDatetime=2023-01-01 HTTP/1.1
Host: demoutility.com

==Response==
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

{
"id": "US-WECC-CISO",
"unit": "MWh",
"exports": [
{
"startDatetime": "2021-06-01 00:00:00+00",
"endDatetime": "2021-06-01 01:00:00+00",
"value": 10.5,
"exportByConnectedPSR": [
{
"connectedPSR": "US-WECC-LADWP",
"value": 5.5
},
{
"connectedPSR": "US-WECC-BANC",
"value": 5.0
},
// Additional entries for other connected PSRs if available
]
},
// Additional entries for other time periods if available
],
"next": null,
"previous": null
}
```

## 5.2.6 PSR Prices

```
==Request==
GET /power-system-resource/US-WECC-CISO/price?startDatetime=2022-01-01&endDatetime=2023-01-01 HTTP/1.1
Host: demoutility.com

==Response==
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

{
"id": "US-WECC-CISO",
"unit": "USD",
"price": [
{
"startDatetime": "2021-06-01 00:00:00+00",
"endDatetime": "2021-06-01 01:00:00+00",
"value": 10.5
},
// Additional entries for other time periods if available
],
"next": null,
"previous": null
}
```

## 5.2.7 PSR Curtailment

```
==Request==
GET /power-system-resource/US-WECC-CISO/curtailment?startDatetime=2022-06-01&endDatetime=201-06-02 HTTP/1.1
Host: demoutility.com

==Response==
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

{
"id": "US-WECC-CISO",
"unit": "MWh",
"curtailment": [
{
"startDatetime": "2021-06-01 00:00:00+00",
"endDatetime": "2021-06-01 01:00:00+00",
"value": 10.5,
"valueByFuelSource": [
{
"technology": "Thermal - Steam engine - Unspecified",
"type": "Fossil - Solid - Hard Coal - Unspecified",
"value": 5.0
},
{
"technology": "Solar - Photovoltaic - Unspecified",
"type": "Renewables - Heating and Cooling - Solar",
"value": 10.5
},
// Additional entries for other fuel sources if available
]
}
// Additional entries for other time periods if available
],
"next": null,
"previous": null
}
```