Commit a36001df authored by Yann Garcia's avatar Yann Garcia
Browse files

Add typing for AtsMec_QoSMeasurementAPI

parent e722c352
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -10,12 +10,7 @@ module AtsMec_QoSMeasurementAPI_TestCases {
  import from LibHttp_JsonTemplates all;
  import from LibHttp_TestSystem all;
  
  // LibMec/LibMec_ApplicationPackageLifecycleAndOperationGrantingAPI
  import from ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues all;
  import from ApplicationPackageLifecycleAndOperationGrantingAPI_Templates all;
  import from ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits all;

  // LibMec/EdgePlatformApplicationEnablementAPI
  import from EdgePlatformApplicationEnablementAPI_Templates all;
  // LibMec/QoSMeasurementAPI
  import from QoSMeasurementAPI_Templates all;

} // End of module AtsMec_QoSMeasurementAPI_TestCases
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ modules := ../LibCommon \
            ../LibMec/ApplicationMobilityServiceAPI \
            ../LibMec/IoTAPI \
            ../LibMec/FederationEnablementAPI \
            ../LibMec/AtsMec_QoSMeasurementAPI \
            ../LibMec/QoSMeasurementAPI \
            ../../titan-test-system-framework/ccsrc/Framework \
            ../../titan-test-system-framework/ccsrc/loggers \
            ../../titan-test-system-framework/ccsrc/Protocols/Http \
+19 −0
Original line number Diff line number Diff line
module QoSMeasurementAPI_Templates {
  
  // Lib QoSMeasurementAPI
  import from QoSMeasurementAPI_TypesAndValues all;

  template (omit) NotificationSubscriptionList m_notification_subscription_list(
                                                                                in template (value) LinkType p_resourceURL,
                                                                                in template (omit) Subscription p_subscription := omit
                                                                                ) := {
    subscription := p_subscription,
    resourceURL  := p_resourceURL
  } // End of template m_notification_subscription_list

  template (present) NotificationSubscriptionList mw_notification_subscription_list(
                                                                                    template (present) LinkType p_resourceURL := ?,
                                                                                    template Subscription p_subscription := *
                                                                                    ) := {
    subscription := p_subscription,
    resourceURL  := p_resourceURL
  } // End of template mw_notification_subscription_list

} // End of module QoSMeasurementAPI_Templates
+383 −1
Original line number Diff line number Diff line
module QoSMeasurementAPI_TypesAndValues {

  // JSON
  import from Json all;

  // LibMec
  import from LibMec_TypesAndValues all;

  /**
   * @desc This type contains a list of subscriptions
   * @param subscription The URI referring to the subscription
   * @param resourceURL Self-referring URL
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.1-1: Definition of type NotificationSubscriptionList
   */
  type record NotificationSubscriptionList {
    Subscription subscription optional,
    LinkType     resourceURL
  }

 /**
   * @desc This type represents a subscription to the notifications from QMS about QoS measurement
   * @param subscriptionType Shall be set to "QoSMeasureSubscription"
   * @param callbackReference URI exposed by the client on which to receive notifications via HTTP
   * @param requestTestNotification Set to TRUE by the service consumer to request a test notification via HTTP on the callbackReference URI
   * @param websockNotifConfig Provides details to negotiate and signal the use of a Websocket connection between the location server and the service consumer for notifications
   * @param _links Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests
   * @param users Address of user (e.g. 'sip' URI, 'tel' URI, 'acr'URI)
   * @param flowInfo The information of the measured flows
   * @param numberOfReports If not present, the subscription is active until it is actively terminated via HTTP DELETE
   * @param reportingInterval The reportingInterval determines the interval between two contiguous reports.
   * @param measuringPeriod It determines measuring frequency.
   * @param measuringArea Area constraint for the measuring task
   * @param measuringTime Time constraint for the measuring task
   * @param metricType The expected measuring result type
   * @param expiryDeadline The expiration time of the subscription determined by the QoS Measurement Subscribe Service
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.2-1: Definition of type QoSMeasureSubscription
   */
  type record QoSMeasureSubscription {
    Json.String        subscriptionType,
    Json.AnyURI        callbackReference optional,
    Json.Bool          requestTestNotification optional,
    WebsockNotifConfig websockNotifConfig optional,
    Links              links optional,
    Users              users optional,
    FlowInfos          flowInfo optional,
    Json.UInteger      numberOfReports optional,
    Json.UInteger      reportingInterval optional,
    Json.UInteger      measuringPeriod,
    MeasuringAreas     measuringArea optional,
    MeasuringTimes     measuringTime optional,
    MetricTypes        metricType,
    TimeStamp          expiryDeadline optional
  } with {
    variant (links) "name as '_links'";
  }
  type record of Json.AnyURI Users;

 /**
   * @desc This type represents a subscription to the notifications from QMS about QoS measurement
   * @param samplingRate he sampling rate determines the proportion of flows that meet the flowFilter to be measured
   * @param flowFilter Traffic flow filtering criteria
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.2-1: Definition of type QoSMeasureSubscription
   */
  type record FlowInfo {
    Json.UInteger samplingRate optional,
    FlowFilter flowFilter
  }
  type record of FlowInfo FlowInfos;

  /**
   * @desc Traffic flow filtering criteria
   * @param sourceIp Source address identity of measured flow
   * @param sourcePort Source port identity of measured flow
   * @param dstIp Destination address identity of measured flow
   * @param dstPort Destination port identity of measured flow
   * @param protocol Protocol number
   * @param dscp DSCP in the IPv4 header or Traffic Class in the IPv6 header
   * @param flowlabel Flow Label in the IPv6 header, applicable only if the flow is IPv6
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.2-1: Definition of type QoSMeasureSubscription
   */
  type record FlowFilter {
    Json.String   sourceIp optional,
    Ports         sourcePort optional,
    Json.String   dstIp optional,
    Ports         dstPort optional,
    Json.UInteger protocol optional,
    Json.UInteger dscp optional,
    Json.UInteger flowlabel optional
  }
  type record of FlowFilter FlowFilters;

  /**
   * @desc Area constraint for the measuring task. Traffic of users entering the area will be measured
   * @param areaInfo It describes the measured area
   * @param accessPointId The identity of the access point the user is currently on
   * @param zoneId The identity of the zone the user is currently within
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.2-1: Definition of type QoSMeasureSubscription
   */
  type record MeasuringArea {
    AreaInfo    areaInfo optional,
    Json.String accessPointId optional,
    Json.String zoneId optional
  }
  type record of MeasuringArea MeasuringAreas;

  /**
   * @desc Time constraint for the measuring task
   * @param startTime The format is a string representing the hour, and the minute in a day
   * @param endTime The format is a string representing the hour, and the minute in a day
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.2-1: Definition of type QoSMeasureSubscription
   */
  type record MeasuringTime {
    Json.String startTime,
    Json.String endTime
  }
  type record of MeasuringTime MeasuringTimes;

  /**
   * @desc This type represents QoS measuring result type
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.6.3-1: Enumeration MetricType
   */
 type enumerated MetricType {
    LATENCY,
    JITTER,
    THROUGHPUT,
    LOSS_RATE,
    ERROR_RATE
  }
  type record of MetricType MetricTypes;

  /**
   * @desc This type represents a subscription to the notifications from QMS about QoS events, e.g. some metrics regarding network performance has achieved the alarm threshold
   * @param subscriptionType Shall be set to "QoSEventSubscription"
   * @param callbackReference URI exposed by the client on which to receive notifications via HTTP
   * @param requestTestNotification Set to TRUE by the service consumer to request a test notification via HTTP on the callbackReference URI
   * @param websockNotifConfig Provides details to negotiate and signal the use of a Websocket connection between the location server and the service consumer for notifications 
   * @param links Hyperlink related to the resource
   * @param flowFilter Traffic flow filtering criteria. If the flowFilter field is included, at least one of its subfields shall be included
   * @param reportTrigger The trigger leading to the notification
   * @param reportingCtrl Provides parameters that ctrl the reporting
   * @param measuringPeriod It determines measuring frequency
   * @param monitoringArea Area constraint for the monitoring task
   * @param monitoringTime Time in a day for the monitoring task
   * @param expiryDeadline The expiration time of the subscription determined by the QoS Measurement Subscribe Service
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.3-1: Definition of type QoSEventSubscription
   */
  type record QoSEventSubscription {
    Json.String        subscriptionType,
    Json.AnyURI        callbackReference optional,
    Json.Bool          requestTestNotification optional,
    WebsockNotifConfig websockNotifConfig optional,
    Links              links optional,
    FlowFilters        flowFilter optional,
    ReportTriggers     reportTrigger optional,
    ReportingCtrl      reportingCtrl optional,
    Json.UInteger      measuringPeriod,
    MonitoringAreas    monitoringArea optional,
    MonitoringTimes    monitoringTime optional,
    TimeStamp          expiryDeadline optional
  } with {
    variant (links) "name as '_links'";
  }

  /**
   * @desc The trigger leading to the notification
   * @param metricType The monitoring metric type
   * @param upperThreshold Threshold which if crossed upward shall cause a notification
   * @param lowerThreshold Threshold which if crossed downward shall cause a notification
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.3-1: Definition of type QoSEventSubscription
   */
  type record ReportTrigger {
    MetricType    metricType,
    Json.UInteger upperThreshold optional,
    Json.UInteger lowerThreshold optional
  }
  type record length (1 .. infinity) of ReportTrigger ReportTriggers;

  /**
   * @desc Area constraint for the monitoring task
   * @param areaInfo It describes the measured area
   * @param accessPointId The identity of the access point the user is currently on
   * @param zoneId The identity of the zone the user is currently within
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.3-1: Definition of type QoSEventSubscription
   */
  type record MonitoringArea {
    AreaInfo    areaInfo optional,
    Json.String accessPointId optional,
    Json.String zoneId optional
  }
  type record of MonitoringArea MonitoringAreas;

  /**
   * @desc Time in a day for the monitoring task
   * @param startTime The format is a string representing the hour, and the minute in a day
   * @param endTime The format is a string representing the hour, and the minute in a day
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.3-1: Definition of type QoSEventSubscription
   */
  type record MonitoringTime {
    Json.String startTime,
    Json.String endTime
  }
  type record of MonitoringTime MonitoringTimes;

  /**
   * @desc This type represents a test notification from a location server to determine if the Websocket method is to be utilized for the location server to issue notifications for a subscription
   * @member notificationType Shall be set to "TestNotification"
   * @member links Object containing hyperlinks related to the resource
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.4.1-1: Attributes of the TestNotification
   */
  type record TestNotification {
    Json.String        notificationType,
    Links              links
  } with {
    variant (links) "name as '_links'";
  }

  /**
   * @desc This type represents a notification from QMS with regards to QoS measurement
   * @member notificationType Shall be set to "QoSMeasureNotification"
   * @member timeStamp Time stamp
   * @member subscriptionState It shall be absent if the related subscription has no numberOfReports attribute, and shall be present otherwise
   * @member qoSMeasureResult The QoS measuring result
   * @member links Object containing hyperlinks related to the resource
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.4.2-1: Attributes of the QoSMeasureNotification
   */
  type record QoSMeasureNotification {
    Json.String       notificationType,
    TimeStamp         timeStamp optional,
    SubscriptionState subscriptionState optional,
    QoSMeasureResults qoSMeasureResult optional,
    Links             links
  } with {
    variant (links) "name as '_links'";
  }

  /**
   * @desc It shall be absent if the related subscription has no numberOfReports attribute, and shall be present otherwise
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.4.2-1: Attributes of the QoSMeasureNotification
   */
  type enumerated SubscriptionState {
    ACTIVE,
    FINISHED
  }

  /**
   * @desc The QoS measuring result
   * @member user Address of user (e.g. 'sip' URI, 'tel' URI, 'acr' URI)
   * @member flow Flow information
   * @member measuringArea The area information for measurement reporting
   * @member measuringTime The time section for measurement reporting
   * @member latency The Unit is millisecond
   * @member jitter The Unit is millisecond
   * @member throughput The Unit is kbit/s
   * @member loss_rate The integer represents percent
   * @member error_rate The integer represents percent
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.4.2-1: Attributes of the QoSMeasureNotification
   */
  type record QoSMeasureResult {
    Json.AnyURI user optional,
    FlowFilter  flow,
    MeasuringArea measuringArea optional,
    MeasuringTime measuringTime optional,
    Json.UInteger latency optional,
    Json.UInteger jitter optional,
    Json.UInteger throughput optional,
    Json.UInteger loss_rate optional,
    Json.UInteger error_rate optional
  }
  type record of QoSMeasureResult QoSMeasureResults;

  /**
   * @desc This type represents a notification from QMS with regards to QoS event
   * @member notificationType Shall be set to "QoSEventNotification""
   * @member timeStamp Time stamp
   * @member subscriptionState It shall be absent if the related subscription has no numberOfReports attribute, and shall be present otherwise
   * @member qoSMeasureResult The QoS measuring result
   * @member links Object containing hyperlinks related to the resource
   * @member flow Flow information
   * @member metricType The monitoring metric type
   * @member qosEvent The reporting event
   * @member measuringArea The area information for event reporting
   * @member  
   * @member  
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.4.3-1: Attributes of the QoSEventNotification
   */
  type record QoSEventNotification {
    Json.String       notificationType,
    TimeStamp         timeStamp optional,
    SubscriptionState subscriptionState optional,
    Json.AnyURI       user optional,
    FlowFilters       flow,
    MetricType        metricType,
    QoSEvent          qosEvent,
    MeasuringArea     measuringArea optional,
    Links             links
  } with {
    variant (links) "name as '_links'";
  }

  /**
   * @desc This type represents the parameters that describe an area
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.6.4-1: Enumeration QoSEvent
   */
  type enumerated AreaInfo {
    CIRCLE,
    POLYGON
  }

  /**
   * @desc This type represents the geographical location of a point
   * @param latitude Location latitude, expressed in the range -90° to +90°
   * @param longitude Location longitude, expressed in the range -180° to +180°
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.5.4-1: Attributes of type Point
   */
  type record Point {
    Json.Number latitude,
    Json.Number longitude
  }

  /**
   * @desc This type represents the parameters that control the report times and frequency
   * @param minimumInterval Location latitude, expressed in the range -90° to +90°
   * @param maximumFrequency Maximum frequency (in seconds) of notifications per subscription
   * @param maximumCount Maximum number of notifications
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.5.6-1: Attributes of type ReportingCtrl
   */
  type record ReportingCtrl {
    Json.UInteger minimumInterval optional,
    Json.UInteger maximumFrequency optional,
    Json.UInteger maximumCount optional
  }

  /**
   * @desc It shall be absent if the related subscription has no numberOfReports attribute, and shall be present otherwise
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.6.4-1: Enumeration QoSEvent
   */
  type enumerated QoSEvent {
    ABOVE_UPPER_THRESHOLD,
    BELOW_LOWER_THRESHOLD
  }

  /**
   * @desc The service consumer's subscriptions
   * @member href The URI referring to the subscription
   * @member subscriptionType Type of the subscription
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) 6.3.1 Type: NotificationSubscriptionList
   */
  type record Subscription {
    Json.AnyURI href,
    Json.String subscriptionType
  }

  /**
   * @desc This type represents a type of link
   * @member href URI referring to a resource
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.6.2 Type: LinkType
   */
  type record LinkType {
    Json.AnyURI href
  }

  /**
   * @desc Hyperlink related to the resource
   * @member subscription URI identifying the subscription for the test notification
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.4.1-1: Attributes of the TestNotification
   */
  type record Links {
    LinkType subscription
  }

  /**
   * @desc This type represents configuration for the delivery of subscription notifications over Websockets
   * @member websocketUri Set by location server to indicate to the service consumer the Websocket URI to be used for delivering notifications
   * @member requestWebsocketUri Set to true by the service consumer to indicate that Websocket delivery is requested
   * @see ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.5.2 Type: WebsockNotifConfig
   */
  type record WebsockNotifConfig {
    Json.AnyURI websocketUri optional,
    Json.Bool   requestWebsocketUri optional
  }

  type record of Json.UInteger Ports;
} with {
  encode "JSON"
} // End of module QoSMeasurementAPI_TypesAndValues