Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Aug 2, 2024
1 parent cbddcc4 commit b70dc74
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 7 deletions.
9 changes: 9 additions & 0 deletions doc-templates/VehicleParking.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ All updaters have the following parameters in common:

<!-- INSERT: bikeep -->

## SIRI-FM

The SIRI-FM updaters works slighly differently from the other in that it only updates the availability
of parking but does not create new lots in realtime.

The data source must conform to the [Italian SIRI-FM](https://github.com/noi-techpark/sta-nap-export/files/15302688/240502_SpecificaSIRI_v.1.0.3.pdf) profile.

<!-- INSERT: siri-fm -->

## Changelog

- Create initial sandbox implementation (January 2022, [#3796](https://github.com/opentripplanner/OpenTripPlanner/pull/3796))
Expand Down
6 changes: 6 additions & 0 deletions docs/RouterConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,12 @@ Used to group requests when monitoring OTP.
"feedId" : "bikeep",
"sourceType" : "bikeep",
"url" : "https://services.bikeep.com/location/v1/public-areas/no-baia-mobility/locations"
},
{
"type" : "vehicle-parking",
"feedId" : "parking",
"sourceType" : "siri-fm",
"url" : "https://transmodel.api.opendatahub.com/siri-lite/fm/parking"
}
],
"rideHailingServices" : [
Expand Down
89 changes: 84 additions & 5 deletions docs/sandbox/VehicleParking.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ All updaters have the following parameters in common:

The id of the data source, which will be the prefix of the parking lot's id.

This will end up in the API responses as the feed id of of the parking lot.
This will end up in the API responses as the feed id of the parking lot.

<h4 id="u__2__sourceType">sourceType</h4>

Expand Down Expand Up @@ -125,7 +125,7 @@ Used for converting abstract opening hours into concrete points in time.

The id of the data source, which will be the prefix of the parking lot's id.

This will end up in the API responses as the feed id of of the parking lot.
This will end up in the API responses as the feed id of the parking lot.

<h4 id="u__3__sourceType">sourceType</h4>

Expand Down Expand Up @@ -210,7 +210,7 @@ Tags to add to the parking lots.

The id of the data source, which will be the prefix of the parking lot's id.

This will end up in the API responses as the feed id of of the parking lot.
This will end up in the API responses as the feed id of the parking lot.

<h4 id="u__4__sourceType">sourceType</h4>

Expand Down Expand Up @@ -275,7 +275,7 @@ HTTP headers to add to the request. Any header key, value can be inserted.

The id of the data source, which will be the prefix of the parking lot's id.

This will end up in the API responses as the feed id of of the parking lot.
This will end up in the API responses as the feed id of the parking lot.

<h4 id="u__5__sourceType">sourceType</h4>

Expand Down Expand Up @@ -336,7 +336,7 @@ HTTP headers to add to the request. Any header key, value can be inserted.

The id of the data source, which will be the prefix of the parking lot's id.

This will end up in the API responses as the feed id of of the parking lot.
This will end up in the API responses as the feed id of the parking lot.

<h4 id="u__14__sourceType">sourceType</h4>

Expand Down Expand Up @@ -373,6 +373,85 @@ HTTP headers to add to the request. Any header key, value can be inserted.

<!-- bikeep END -->

## SIRI-FM

The SIRI-FM updaters works slighly differently from the other in that it only updates the availability
of parking but does not create new lots in realtime.

The data source must conform to the [Italian SIRI-FM](https://github.com/noi-techpark/sta-nap-export/files/15302688/240502_SpecificaSIRI_v.1.0.3.pdf) profile.

<!-- siri-fm BEGIN -->
<!-- NOTE! This section is auto-generated. Do not change, change doc in code instead. -->

| Config Parameter | Type | Summary | Req./Opt. | Default Value | Since |
|----------------------------------|:---------------:|------------------------------------------------------------------------------|:----------:|---------------|:-----:|
| type = "vehicle-parking" | `enum` | The type of the updater. | *Required* | | 1.5 |
| [feedId](#u__15__feedId) | `string` | The id of the data source, which will be the prefix of the parking lot's id. | *Required* | | 2.2 |
| frequency | `duration` | How often to update the source. | *Optional* | `"PT1M"` | 2.6 |
| [sourceType](#u__15__sourceType) | `enum` | The source of the vehicle updates. | *Required* | | 2.2 |
| [url](#u__15__url) | `uri` | URL of the SIRI-FM Light endpoint. | *Required* | | 2.6 |
| [headers](#u__15__headers) | `map of string` | HTTP headers to add to the request. Any header key, value can be inserted. | *Optional* | | 2.6 |


#### Details

<h4 id="u__15__feedId">feedId</h4>

**Since version:** `2.2`**Type:** `string`**Cardinality:** `Required`
**Path:** /updaters/[15]

The id of the data source, which will be the prefix of the parking lot's id.

This will end up in the API responses as the feed id of the parking lot.

<h4 id="u__15__sourceType">sourceType</h4>

**Since version:** `2.2`**Type:** `enum`**Cardinality:** `Required`
**Path:** /updaters/[15]
**Enum values:** `park-api` | `bicycle-park-api` | `hsl-park` | `bikely` | `noi-open-data-hub` | `bikeep` | `siri-fm`

The source of the vehicle updates.

<h4 id="u__15__url">url</h4>

**Since version:** `2.6`**Type:** `uri`**Cardinality:** `Required`
**Path:** /updaters/[15]

URL of the SIRI-FM Light endpoint.

SIRI Light means that it must be available as a HTTP GET request rather than the usual
SIRI request mechanism of HTTP POST.

The contents must also conform to the [Italian SIRI profile](https://github.com/noi-techpark/sta-nap-export/files/15302688/240502_SpecificaSIRI_v.1.0.3.pdf).


<h4 id="u__15__headers">headers</h4>

**Since version:** `2.6`**Type:** `map of string`**Cardinality:** `Optional`
**Path:** /updaters/[15]

HTTP headers to add to the request. Any header key, value can be inserted.



##### Example configuration

```JSON
// router-config.json
{
"updaters" : [
{
"type" : "vehicle-parking",
"feedId" : "parking",
"sourceType" : "siri-fm",
"url" : "https://transmodel.api.opendatahub.com/siri-lite/fm/parking"
}
]
}
```

<!-- siri-fm END -->

## Changelog

- Create initial sandbox implementation (January 2022, [#3796](https://github.com/opentripplanner/OpenTripPlanner/pull/3796))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static VehicleParkingUpdaterParameters create(String updaterRef, NodeAdap
.of("feedId")
.since(V2_2)
.summary("The id of the data source, which will be the prefix of the parking lot's id.")
.description("This will end up in the API responses as the feed id of of the parking lot.")
.description("This will end up in the API responses as the feed id of the parking lot.")
.asString();
return switch (sourceType) {
case HSL_PARK -> new HslParkUpdaterParameters(
Expand Down Expand Up @@ -103,7 +103,19 @@ public static VehicleParkingUpdaterParameters create(String updaterRef, NodeAdap
);
case SIRI_FM -> new SiriFmUpdaterParameters(
updaterRef,
c.of("url").since(V2_6).summary("URL of the SIRI-FM Light endpoint.").asUri(),
c
.of("url")
.since(V2_6)
.summary("URL of the SIRI-FM Light endpoint.")
.description(
"""
SIRI Light means that it must be available as a HTTP GET request rather than the usual
SIRI request mechanism of HTTP POST.
The contents must also conform to the [Italian SIRI profile](https://github.com/noi-techpark/sta-nap-export/files/15302688/240502_SpecificaSIRI_v.1.0.3.pdf).
"""
)
.asUri(),
feedId,
c
.of("frequency")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ void updateBicycleAvailability() {
assertEquals(8, updated.getAvailability().getBicycleSpaces());
assertNull(updated.getAvailability().getCarSpaces());
}

@Test
void notFound() {
var service = buildParkingService(VehicleParkingSpaces.builder().bicycleSpaces(15).build());
Expand Down
7 changes: 7 additions & 0 deletions src/test/resources/standalone/config/router-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,13 @@
"feedId": "bikeep",
"sourceType": "bikeep",
"url": "https://services.bikeep.com/location/v1/public-areas/no-baia-mobility/locations"
},
// SIRI-FM vehicle parking updater
{
"type": "vehicle-parking",
"feedId": "parking",
"sourceType": "siri-fm",
"url": "https://transmodel.api.opendatahub.com/siri-lite/fm/parking"
}
],
"rideHailingServices": [
Expand Down

0 comments on commit b70dc74

Please sign in to comment.