Skip to content

Commit

Permalink
Specification true up for temporary ratings
Browse files Browse the repository at this point in the history
  • Loading branch information
getorymckeag committed Jul 30, 2024
1 parent a352ea6 commit 94d6ba2
Show file tree
Hide file tree
Showing 18 changed files with 442 additions and 318 deletions.
9 changes: 5 additions & 4 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ GEM
commonmarker (0.23.10)
concurrent-ruby (1.3.3)
connection_pool (2.4.1)
dnsruby (1.72.1)
dnsruby (1.72.2)
simpleidn (~> 0.2.1)
drb (2.2.1)
em-websocket (0.5.3)
Expand All @@ -35,7 +35,7 @@ GEM
execjs (2.9.1)
faraday (2.9.2)
faraday-net_http (>= 2.0, < 3.2)
faraday-net_http (3.1.0)
faraday-net_http (3.1.1)
net-http
ffi (1.17.0)
forwardable-extended (2.6.0)
Expand Down Expand Up @@ -227,7 +227,7 @@ GEM
mutex_m (0.2.0)
net-http (0.4.1)
uri
nokogiri (1.16.6-x86_64-linux)
nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
octokit (4.25.1)
faraday (>= 1, < 3)
Expand All @@ -240,7 +240,7 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rexml (3.3.1)
rexml (3.3.2)
strscan
rouge (3.26.0)
rubyzip (2.3.2)
Expand Down Expand Up @@ -269,6 +269,7 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
faraday (>= 2.9, < 2.10)
github-pages (~> 228)
jekyll-redirect-from
just-the-docs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ type: array
minItems: 0
maxItems: 1000
items:
$ref: ./temporary-rating.yaml
$ref: ./seasonal-override.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
type: object
additionalProperties: false
description: |
Data structure for a temporary rating against a segment.
Data structure for a seasonal override against a resource.
Includes a unique ID, start and (optional) end time, and a reason.
May include a set of values, which apply if this temporary rating
is either an AAR Exception or temporary seasonal rating.
Must also include a set of values.
properties:
provenance:
$ref: ./data-provenance.yaml
id:
$ref: ./generic-identifier.yaml
resource-id:
$ref: ./resource-id.yaml
$ref: ./server-generated-id.yaml
resource:
$ref: ./names.yaml
start-time:
$ref: ./period-start.yaml
end-time:
$ref: ./period-start.yaml
updated-time:
$ref: ./timestamp.yaml
continuous-operating-limit:
$ref: ./limit.yaml
emergency-operating-limits:
$ref: ./array-max-emergency-durations.yaml#/limit-value-set
reason:
description: |
Free-form text indicating the reason for the temporary rating.
Free-form text indicating the reason for the seasonal override.
type: string
format: free-form
maxLength: 100
maxLength: 4000
required:
- resource
- start-time
- continuous-operating-limit
- emergency-operating-limits
10 changes: 10 additions & 0 deletions docs/_data/components/schemas/server-generated-id.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type: string
description: |
Unique identifier for the object, as generated by the TROLIE server, typically as a result of POST
requests. For POST requests, this should not be provided, as it will be generated by the server and
returned.
maxLength: 250
pattern: ^(.){0,250}$
example: "//trolie.example.com/limits/forecast-snapshot/2025-07-05T01:00:00-0500"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: array
minItems: 0
maxItems: 1000
items:
$ref: ./temporary-aar-exception.yaml
32 changes: 32 additions & 0 deletions docs/_data/components/schemas/temporary-aar-exception.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
type: object
additionalProperties: false
description: |
Data structure for a temporary AAR Exception against a resource.
Includes a unique ID, start and (optional) end time, and a reason.
May or may not include a set of values, depending on the business
context in which the temporary AAR exception is used.
properties:
provenance:
$ref: ./data-provenance.yaml
id:
$ref: ./server-generated-id.yaml
resource:
$ref: ./names.yaml
start-time:
$ref: ./period-start.yaml
end-time:
$ref: ./period-start.yaml
continuous-operating-limit:
$ref: ./limit.yaml
emergency-operating-limits:
$ref: ./array-max-emergency-durations.yaml#/limit-value-set
reason:
description: |
Free-form text indicating the reason for the exception.
type: string
format: free-form
maxLength: 4000
required:
- resource
- start-time
12 changes: 6 additions & 6 deletions docs/_data/openapi-split.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ tags:
data feed could be down for some reason. Therefore, this provides a
placeholder set of numbers until the AAR data feed is repaired.
- name: Temporary Seasonal Ratings
- name: Seasonal Overrides
description: >
A TemporarySeasonalRating allows for temporary overrides of the seasonal
A Seasonal Override allows for temporary overrides of the seasonal
rating, due to some unusual condition on the facility. This essentially
overrides the current "recourse" rating used in operations.
Expand Down Expand Up @@ -175,10 +175,10 @@ paths:
$ref: paths/temporary-aar-exceptions.yaml
/temporary-aar-exceptions/{id}:
$ref: paths/temporary-aar-exceptions_{id}.yaml
/temporary-seasonal-ratings:
$ref: paths/temporary-seasonal-ratings.yaml
/temporary-seasonal-ratings/{id}:
$ref: paths/temporary-seasonal-ratings_{id}.yaml
/seasonal-overrides:
$ref: paths/seasonal-overrides.yaml
/seasonal-overrides/{id}:
$ref: paths/seasonal-overrides_{id}.yaml
components:
responses:

Expand Down
95 changes: 95 additions & 0 deletions docs/_data/paths/seasonal-overrides.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
get:
operationId: getSeasonalOverrides
description: |
Search for Seasonal Overrides. Will return any Seasonal Overrides that overlap with the start/end period.
Clients SHOULD perform Conditional `GET` using the `If-None-Match` header
and the `ETag` of a previous `GET` response.
summary: Get Seasonal Overrides
tags: &tags
- Seasonal Overrides
parameters:
- $ref: ../components/parameters/period-start-query.yaml
- $ref: ../components/parameters/period-end.yaml
- $ref: ../components/parameters/monitoring-set-filter.yaml
- $ref: ../components/parameters/segment-filter.yaml
responses:
'200':
description: The requested seasonal ratings are returned.
content:
application/vnd.trolie.seasonal-override-set.v1+json:
schema:
$ref: ../components/schemas/seasonal-override-set.yaml
example:
$ref: ../../example-narratives/examples/seasonal-override-list.json
headers:
$ref: '../openapi-split.yaml#/components/responses/204/headers'

'304':
$ref: '../openapi-split.yaml#/components/responses/304'
'400': &malformed
$ref: '../openapi-split.yaml#/components/responses/400-problem'
'401': &unauthorized-empty
$ref: '../openapi-split.yaml#/components/responses/401-empty'
'403': &forbidden-empty
$ref: '../openapi-split.yaml#/components/responses/403-empty'
'404': &not-found-empty
$ref: '../openapi-split.yaml#/components/responses/404-empty'
'406': &not-acceptable-empty
$ref: '../openapi-split.yaml#/components/responses/406-empty'
'410':
$ref: '../openapi-split.yaml#/components/responses/410-empty'
'429': &rate-limit-hit
$ref: '../openapi-split.yaml#/components/responses/429-empty'
'500': &unexpected-error-empty
$ref: '../openapi-split.yaml#/components/responses/500-empty'
default: *unexpected-error-empty

security:
- oauth2-primary-flow:
- read:seasonal-overrides

post:
operationId: createSeasonalOverride
description: &post_desc |
Create a new seasonal override
summary: *post_desc
tags: *tags
requestBody:
content:
application/vnd.trolie.seasonal-override.v1+json:
schema:
$ref: ../components/schemas/seasonal-override.yaml
example:
$ref: ../../example-narratives/examples/seasonal-override-post.json
responses:
'201':
description: The seasonal override was created
content:
application/vnd.trolie.seasonal-override.v1+json:
schema:
$ref: ../components/schemas/seasonal-override.yaml
example:
$ref: ../../example-narratives/examples/seasonal-override-get.json
headers:
$ref: '../openapi-split.yaml#/components/responses/204/headers'

'400': *malformed
'401': *unauthorized-empty
'403': *forbidden-empty
'404': *not-found-empty
'406': *not-acceptable-empty
'413':
$ref: '../openapi-split.yaml#/components/responses/413-empty'
'415':
$ref: '../openapi-split.yaml#/components/responses/415-problem'
'422':
$ref: '../openapi-split.yaml#/components/responses/422-problem'
'429': *rate-limit-hit
'500': *unexpected-error-empty
default: *unexpected-error-empty
security:
- oauth2-primary-flow:
- write:seasonal-overrides
Original file line number Diff line number Diff line change
@@ -1,37 +1,20 @@
get:
operationId: getTemporarySeasonalRating
operationId: getSeasonalOverride
description: &get_desc Obtain a specific temporary seasonal rating by Id.
summary: *get_desc
tags: &tags
- Temporary Seasonal Ratings
- Seasonal Overrides
parameters:
- $ref: ../components/parameters/id.yaml
responses:
'200':
description: OK
content:
application/vnd.trolie.temporary-seasonal-rating.v1+json:
application/vnd.trolie.seasonal-override.v1+json:
schema:
$ref: ../components/schemas/temporary-rating.yaml
$ref: ../components/schemas/seasonal-override.yaml
example:
id: 46f7212b-1633-4c30-ba71-c6e987b2ded7
resource-id: segmentX
start-time: '2025-07-12T16:00:00-07:00'
end-time: '2025-07-13T12:00:00-07:00'
updated-time: '2025-07-08T13:05:43.044267100-07:00'
continuous-operating-limit:
mva: 160
emergency-operating-limits:
- duration-name: emergency
limit:
mva: 165
- duration-name: "load-shed"
limit:
mva: 170
reason: Free-form text reason.
application/json:
schema:
$ref: ../components/schemas/temporary-rating.yaml
$ref: ../../example-narratives/examples/seasonal-override-get.json
headers:
$ref: '../openapi-split.yaml#/components/responses/204/headers'

Expand All @@ -57,10 +40,10 @@ get:

security:
- oauth2-primary-flow:
- read:temporary-seasonal-ratings
- read:seasonal-overrides
delete:
operationId: deleteTemporarySeasonalRating
description: &delete_desc Delete a specific temporary seasonal rating by its Id.
operationId: deleteSeasonalOverride
description: &delete_desc Delete a specific seasonal override by its Id.
summary: *delete_desc
tags: *tags
parameters:
Expand All @@ -81,37 +64,21 @@ delete:

security: &authorize-admin
- oauth2-primary-flow:
- write:temporary-seasonal-ratings
- write:seasonal-overrides
put:
operationId: updateTemporarySeasonalRating
description: &put_desc Updates an existing Temporary Seasonal Rating.
operationId: updateSeasonalOverride
description: &put_desc Updates an existing Seasonal override
summary: *put_desc
tags: *tags
parameters:
- $ref: ../components/parameters/id.yaml
requestBody:
content:
application/vnd.trolie.temporary-seasonal-rating.v1+json:
application/vnd.trolie.seasonal-override.v1+json:
schema:
$ref: ../components/schemas/temporary-rating.yaml
$ref: ../components/schemas/seasonal-override.yaml
example:
id: 46f7212b-1633-4c30-ba71-c6e987b2ded7
resource-id: segmentX
start-time: '2025-07-12T16:00:00-07:00'
end-time: '2025-07-13T12:00:00-07:00'
continuous-operating-limit:
mva: 160
emergency-operating-limits:
- duration-name: emergency
limit:
mva: 165
- duration-name: "load-shed"
limit:
mva: 170
reason: Free-form text reason.
application/json:
schema:
$ref: ../components/schemas/temporary-rating.yaml
$ref: ../../example-narratives/examples/seasonal-override-post.json
responses:
'204': *no-content
'304': *not-modified
Expand All @@ -122,6 +89,8 @@ put:
'406': *not-acceptable-empty
'413':
$ref: '../openapi-split.yaml#/components/responses/413-empty'
'415':
$ref: '../openapi-split.yaml#/components/responses/415-problem'
'422':
$ref: '../openapi-split.yaml#/components/responses/422-problem'
'429': *rate-limit-hit
Expand Down
Loading

0 comments on commit 94d6ba2

Please sign in to comment.