camaraproject / QualityOnDemand

Repository to describe, develop, document and test the QualityOnDemand API family
https://wiki.camaraproject.org/x/zwOeAQ
Apache License 2.0
37 stars 60 forks source link

Consolidated issue for duration, extentDuration, startedAt, expiredAt, maxDuration and their formats (to be updated) #291

Closed hdamker closed 2 weeks ago

hdamker commented 2 months ago

Problem description

A placeholder for the consolidation of the following existing issues

Possible evolution

Alternative solution

tbd

Additional context

jlurien commented 1 month ago

Proposal:

For creation, duration is made required. Maximum and default are deprecated, relying on the QoS Profile API for any limit.

            duration:
              description: |
                Requested session duration in seconds. Value may be explicitly limited for the QoS profile, as specified in the [Qos Profile API](TBC). Implementations can grant the requested session duration or set a different duration, based on network policies or conditions. 
              type: integer
              format: int32
              minimum: 1
              example: 3600
          required:
            - duration
        maxDuration:
          description: |
            The maximum time period that this profile can be deployed.
            Overall session duration must not exceed this value. This includes the initial requested duration plus any extensions.

So the new logic for the extendQosSessionDuration operations is

      summary: "Extend the duration of an active session"
      description: |
        Extend the overall session duration of an active QoS session. If this operation is executed successfully, the new duration of the target session will be the previous duration plus the additionally requested duration.
        The overall duration of the QoS session, including the additional extended duration, shall not exceed the maximum duration limit fixed for the QoS Profile. If the current duration plus the value of `requestedAdditionalDuration` exceeds the maximum limit, the new overall duration shall be capped to the maximum value allowed.
        An example: For a QoS profile limited to a `maxDuration` of 50,000 seconds, a QoD session was originally created with duration 30,000 seconds. Before the session expires, the developer requests to extend the session by another 30,000 seconds:
        - Previous duration: 30,000 seconds
        - Requested additional duration: 30,000 seconds 
        - New overall session duration: 50,000 seconds (the maximum allowed)

Session info changes:

            duration:
              description: |
                Session duration in seconds. Implementations can grant the requested session duration or set a different duration, based on network policies or conditions. 
                - When `qosStatus` is "REQUESTED", the value is the duration to be scheduled, granted by the implementation.
                - When `qosStatus` is AVAILABLE", the value is the overall duration since `startedAt. When the session is extended, the value is the new overall duration of the session. 
                - When `qosStatus` is "UNAVAILABLE", the value is the overall effective duration since `startedAt` until the session was terminated.
              type: integer
              format: int32
              minimum: 1
              example: 3600
            startedAt:
              description: Date and time when the QoS status became "AVAILABLE". Not to be returned when `qosStatus` is "REQUESTED". Format must follow RFC 3339 and must indicate time zone (UTC or local).
              type: string
              format: date-time
              example: "2024-06-01T12:00:00Z"
            expiresAt:
              description: |
                Date and time of the QoS session expiration. Format must follow RFC 3339 and must indicate time zone (UTC or local).
                - When `qosStatus` is "AVAILABLE", it is the limit time when the session is scheduled to finnish, if not terminated by other means.
                - When `qosStatus` is "UNAVAILABLE", it is the time when the session was terminated.
                - Not to be returned when `qosStatus` is "REQUESTED".
                When the session is extended, the value` is the new expiration time of the session.
              type: string
              format: date-time
              example: "2024-06-01T13:00:00Z"

The originally requested session duration is not part of the SessionInfo object. We may discuss if this is necessary or convenient.

jlurien commented 1 month ago

PR #296 created with proposal above, so changes can be seen altogether: