|
| 1 | +# Siri Azure Updater |
| 2 | + |
| 3 | +It is a sandbox extension developed by Skånetrafiken that allows OTP to fetch Siri ET & SX messages through *Azure Service Bus*. |
| 4 | +It also allows for OTP to download historical real-time data from an HTTP endpoint on startup. |
| 5 | + |
| 6 | +## Contact Info |
| 7 | + |
| 8 | +Skånetrafiken, Sweden |
| 9 | +developer.otp@skanetrafiken.se |
| 10 | + |
| 11 | +## Documentation |
| 12 | + |
| 13 | +Documentation available [here](../../examples/skanetrafiken/Readme.md). |
| 14 | + |
| 15 | +## Configuration |
| 16 | + |
| 17 | +To enable the SIRI updater you need to add it to the updaters section of the `router-config.json`. |
| 18 | + |
| 19 | +### Siri Azure ET Updater |
| 20 | + |
| 21 | +<!-- siri-azure-et-updater BEGIN --> |
| 22 | +<!-- NOTE! This section is auto-generated. Do not change, change doc in code instead. --> |
| 23 | + |
| 24 | +| Config Parameter | Type | Summary | Req./Opt. | Default Value | Since | |
| 25 | +|------------------------------------------------------------|:---------:|----------------------------------------------------------------|:----------:|---------------------|:-----:| |
| 26 | +| type = "siri-azure-et-updater" | `enum` | The type of the updater. | *Required* | | 1.5 | |
| 27 | +| [authenticationType](#u__11__authenticationType) | `enum` | Which authentication type to use | *Optional* | `"sharedaccesskey"` | 2.5 | |
| 28 | +| [customMidnight](#u__11__customMidnight) | `integer` | Time on which time breaks into new day. | *Optional* | `0` | 2.2 | |
| 29 | +| feedId | `string` | The ID of the feed to apply the updates to. | *Optional* | | 2.2 | |
| 30 | +| [fullyQualifiedNamespace](#u__11__fullyQualifiedNamespace) | `string` | Service Bus fully qualified namespace used for authentication. | *Optional* | | 2.5 | |
| 31 | +| fuzzyTripMatching | `boolean` | Whether to apply fuzzyTripMatching on the updates | *Optional* | `false` | 2.2 | |
| 32 | +| [servicebus-url](#u__11__servicebus_url) | `string` | Service Bus connection used for authentication. | *Optional* | | 2.2 | |
| 33 | +| topic | `string` | Service Bus topic to connect to. | *Optional* | | 2.2 | |
| 34 | +| history | `object` | Configuration for fetching historical data on startup | *Optional* | | 2.2 | |
| 35 | +| fromDateTime | `string` | Datetime boundary for historical data | *Optional* | `"-P1D"` | 2.2 | |
| 36 | +| timeout | `integer` | Timeout in milliseconds | *Optional* | `300000` | na | |
| 37 | +| url | `string` | Endpoint to fetch from | *Optional* | | na | |
| 38 | + |
| 39 | + |
| 40 | +##### Parameter details |
| 41 | + |
| 42 | +<h4 id="u__11__authenticationType">authenticationType</h4> |
| 43 | + |
| 44 | +**Since version:** `2.5` ∙ **Type:** `enum` ∙ **Cardinality:** `Optional` ∙ **Default value:** `"sharedaccesskey"` |
| 45 | +**Path:** /updaters/[11] |
| 46 | +**Enum values:** `sharedaccesskey` | `federatedidentity` |
| 47 | + |
| 48 | +Which authentication type to use |
| 49 | + |
| 50 | +<h4 id="u__11__customMidnight">customMidnight</h4> |
| 51 | + |
| 52 | +**Since version:** `2.2` ∙ **Type:** `integer` ∙ **Cardinality:** `Optional` ∙ **Default value:** `0` |
| 53 | +**Path:** /updaters/[11] |
| 54 | + |
| 55 | +Time on which time breaks into new day. |
| 56 | + |
| 57 | +It is common that operating day date breaks a little bit later than midnight so that the switch happens when traffic is at the lowest point. Parameter uses 24-hour format. If the switch happens on 4 am then set this field to 4. |
| 58 | + |
| 59 | +<h4 id="u__11__fullyQualifiedNamespace">fullyQualifiedNamespace</h4> |
| 60 | + |
| 61 | +**Since version:** `2.5` ∙ **Type:** `string` ∙ **Cardinality:** `Optional` |
| 62 | +**Path:** /updaters/[11] |
| 63 | + |
| 64 | +Service Bus fully qualified namespace used for authentication. |
| 65 | + |
| 66 | +Has to be present for authenticationMethod FederatedIdentity. |
| 67 | + |
| 68 | +<h4 id="u__11__servicebus_url">servicebus-url</h4> |
| 69 | + |
| 70 | +**Since version:** `2.2` ∙ **Type:** `string` ∙ **Cardinality:** `Optional` |
| 71 | +**Path:** /updaters/[11] |
| 72 | + |
| 73 | +Service Bus connection used for authentication. |
| 74 | + |
| 75 | +Has to be present for authenticationMethod SharedAccessKey. This should be Primary/Secondary connection string from service bus. |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | +##### Example configuration |
| 80 | + |
| 81 | +```JSON |
| 82 | +// router-config.json |
| 83 | +{ |
| 84 | + "updaters" : [ |
| 85 | + { |
| 86 | + "type" : "siri-azure-et-updater", |
| 87 | + "topic" : "some_topic", |
| 88 | + "authenticationType" : "SharedAccessKey", |
| 89 | + "fullyQualifiedNamespace" : "fully_qualified_namespace", |
| 90 | + "servicebus-url" : "service_bus_url", |
| 91 | + "feedId" : "feed_id", |
| 92 | + "customMidnight" : 4, |
| 93 | + "history" : { |
| 94 | + "url" : "endpoint_url", |
| 95 | + "fromDateTime" : "-P1D", |
| 96 | + "timeout" : 300000 |
| 97 | + } |
| 98 | + } |
| 99 | + ] |
| 100 | +} |
| 101 | +``` |
| 102 | + |
| 103 | +<!-- siri-azure-et-updater END --> |
| 104 | + |
| 105 | +### Siri Azure SX Updater |
| 106 | + |
| 107 | +<!-- siri-azure-sx-updater BEGIN --> |
| 108 | +<!-- NOTE! This section is auto-generated. Do not change, change doc in code instead. --> |
| 109 | + |
| 110 | +| Config Parameter | Type | Summary | Req./Opt. | Default Value | Since | |
| 111 | +|------------------------------------------------------------|:---------:|----------------------------------------------------------------|:----------:|---------------------|:-----:| |
| 112 | +| type = "siri-azure-sx-updater" | `enum` | The type of the updater. | *Required* | | 1.5 | |
| 113 | +| [authenticationType](#u__10__authenticationType) | `enum` | Which authentication type to use | *Optional* | `"sharedaccesskey"` | 2.5 | |
| 114 | +| [customMidnight](#u__10__customMidnight) | `integer` | Time on which time breaks into new day. | *Optional* | `0` | 2.2 | |
| 115 | +| feedId | `string` | The ID of the feed to apply the updates to. | *Optional* | | 2.2 | |
| 116 | +| [fullyQualifiedNamespace](#u__10__fullyQualifiedNamespace) | `string` | Service Bus fully qualified namespace used for authentication. | *Optional* | | 2.5 | |
| 117 | +| fuzzyTripMatching | `boolean` | Whether to apply fuzzyTripMatching on the updates | *Optional* | `false` | 2.2 | |
| 118 | +| [servicebus-url](#u__10__servicebus_url) | `string` | Service Bus connection used for authentication. | *Optional* | | 2.2 | |
| 119 | +| topic | `string` | Service Bus topic to connect to. | *Optional* | | 2.2 | |
| 120 | +| history | `object` | Configuration for fetching historical data on startup | *Optional* | | 2.2 | |
| 121 | +| fromDateTime | `string` | Datetime boundary for historical data. | *Optional* | `"-P1D"` | 2.2 | |
| 122 | +| timeout | `integer` | Timeout in milliseconds | *Optional* | `300000` | na | |
| 123 | +| toDateTime | `string` | Datetime boundary for historical data. | *Optional* | `"P1D"` | 2.2 | |
| 124 | +| url | `string` | Endpoint to fetch from | *Optional* | | na | |
| 125 | + |
| 126 | + |
| 127 | +##### Parameter details |
| 128 | + |
| 129 | +<h4 id="u__10__authenticationType">authenticationType</h4> |
| 130 | + |
| 131 | +**Since version:** `2.5` ∙ **Type:** `enum` ∙ **Cardinality:** `Optional` ∙ **Default value:** `"sharedaccesskey"` |
| 132 | +**Path:** /updaters/[10] |
| 133 | +**Enum values:** `sharedaccesskey` | `federatedidentity` |
| 134 | + |
| 135 | +Which authentication type to use |
| 136 | + |
| 137 | +<h4 id="u__10__customMidnight">customMidnight</h4> |
| 138 | + |
| 139 | +**Since version:** `2.2` ∙ **Type:** `integer` ∙ **Cardinality:** `Optional` ∙ **Default value:** `0` |
| 140 | +**Path:** /updaters/[10] |
| 141 | + |
| 142 | +Time on which time breaks into new day. |
| 143 | + |
| 144 | +It is common that operating day date breaks a little bit later than midnight so that the switch happens when traffic is at the lowest point. Parameter uses 24-hour format. If the switch happens on 4 am then set this field to 4. |
| 145 | + |
| 146 | +<h4 id="u__10__fullyQualifiedNamespace">fullyQualifiedNamespace</h4> |
| 147 | + |
| 148 | +**Since version:** `2.5` ∙ **Type:** `string` ∙ **Cardinality:** `Optional` |
| 149 | +**Path:** /updaters/[10] |
| 150 | + |
| 151 | +Service Bus fully qualified namespace used for authentication. |
| 152 | + |
| 153 | +Has to be present for authenticationMethod FederatedIdentity. |
| 154 | + |
| 155 | +<h4 id="u__10__servicebus_url">servicebus-url</h4> |
| 156 | + |
| 157 | +**Since version:** `2.2` ∙ **Type:** `string` ∙ **Cardinality:** `Optional` |
| 158 | +**Path:** /updaters/[10] |
| 159 | + |
| 160 | +Service Bus connection used for authentication. |
| 161 | + |
| 162 | +Has to be present for authenticationMethod SharedAccessKey. This should be Primary/Secondary connection string from service bus. |
| 163 | + |
| 164 | + |
| 165 | + |
| 166 | +##### Example configuration |
| 167 | + |
| 168 | +```JSON |
| 169 | +// router-config.json |
| 170 | +{ |
| 171 | + "updaters" : [ |
| 172 | + { |
| 173 | + "type" : "siri-azure-sx-updater", |
| 174 | + "topic" : "some_topic", |
| 175 | + "servicebus-url" : "service_bus_url", |
| 176 | + "feedId" : "feed_id", |
| 177 | + "customMidnight" : 4, |
| 178 | + "history" : { |
| 179 | + "url" : "endpoint_url", |
| 180 | + "fromDateTime" : "-P1D", |
| 181 | + "toDateTime" : "P1D", |
| 182 | + "timeout" : 300000 |
| 183 | + } |
| 184 | + } |
| 185 | + ] |
| 186 | +} |
| 187 | +``` |
| 188 | + |
| 189 | +<!-- siri-azure-sx-updater END --> |
| 190 | + |
| 191 | +## Changelog |
| 192 | +- Added configuration for turning off stop arrival time match feature. |
| 193 | +- Initial version (April 2022) |
| 194 | +- Minor changes in logging (November 2022) |
| 195 | +- Retry fetch from history endpoint if it failed (February 2023) |
| 196 | +- Solve a bug in SiriAzureETUpdater and improve error logging (March 2023) |
| 197 | +- Add support with federated identity authentication (February 2024) |
0 commit comments