diff --git a/code/API_definitions/connectivity-insights-subscriptions.yaml b/code/API_definitions/connectivity-insights-subscriptions.yaml index 2b48291..17e8bca 100644 --- a/code/API_definitions/connectivity-insights-subscriptions.yaml +++ b/code/API_definitions/connectivity-insights-subscriptions.yaml @@ -746,6 +746,25 @@ components: Set to `true` by API consumer if consumer wants to get an event as soon as the subscription is created and current situation reflects event request. + monitoringTimeOffset: + type: string + format: duration + maxLength: 20 + description: | + This is an optional input parameter. A positive duration can be + provided to request predictive data for the subscription. + The value represents an offset from the current evaluation time to the + future point in time for which network performance is assessed. + If no value is provided, the current date and time is used and network + data for the monitoring data aggregation is used to check network + performance against the application profile defined. + It must follow ISO 8601 Durations. + Examples: + - PT10S = 10 seconds ahead + - PT1M = 1 minute ahead + - PT5M = 5 minutes ahead + - PT10M = 10 minutes ahead + example: "PT10S" SinkCredential: type: object description: | @@ -872,6 +891,7 @@ components: example: "https://notificationSendServer12.supertelco.com" CloudEvent: description: The Cloud-Event used for the callback. + type: object required: - id - source diff --git a/code/API_definitions/connectivity-insights.yaml b/code/API_definitions/connectivity-insights.yaml index 38c9cce..ff1648f 100644 --- a/code/API_definitions/connectivity-insights.yaml +++ b/code/API_definitions/connectivity-insights.yaml @@ -422,6 +422,7 @@ components: DeviceResponseBody: description: | The optional device identifier to include in the response + type: object properties: device: description: | diff --git a/code/Test_definitions/connectivity-insights-subscriptions.feature b/code/Test_definitions/connectivity-insights-subscriptions.feature index 8c5f820..e5c1e01 100644 --- a/code/Test_definitions/connectivity-insights-subscriptions.feature +++ b/code/Test_definitions/connectivity-insights-subscriptions.feature @@ -137,6 +137,25 @@ Feature: CAMARA Connectivity Insights Subscriptions API, vwip - Operations for S And notification body complies with the OAS schema at "/components/schemas/EventNetworkQuality" And type="org.camaraproject.connectivity-insights-subscriptions.v0.network-quality" + @connectivity_insights_subscriptions_32_create_subscription_with_monitoring_time_offset + Scenario: Create subscription with monitoringTimeOffset for predictive data + Given that subscriptions are created synchronously + And a valid subscription request body with network quality event type + And the request body property "$.config.monitoringTimeOffset" is set to "PT5M" + When the request "createSubscription" is sent + Then the response code is 201 + And the response header "Content-Type" is "application/json" + And the response body complies with the OAS schema at "/components/schemas/Subscription" + + @connectivity_insights_subscriptions_33_create_subscription_without_monitoring_time_offset + Scenario: Create subscription without monitoringTimeOffset defaults to current time + Given that subscriptions are created synchronously + And a valid subscription request body with network quality event type + And the request body property "$.config.monitoringTimeOffset" is not provided + When the request "createSubscription" is sent + Then the response code is 201 + And the response body complies with the OAS schema at "/components/schemas/Subscription" + ############### Error response scenarios ########################### # 400 Error Scenarios @@ -199,6 +218,16 @@ Feature: CAMARA Connectivity Insights Subscriptions API, vwip - Operations for S And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text + @connectivity_insights_subscriptions_34_invalid_monitoring_time_offset + Scenario: Create subscription with invalid monitoringTimeOffset format + Given a valid subscription request body with network quality event type + And the request body property "$.config.monitoringTimeOffset" is set to "INVALID_DURATION" + When the request "createSubscription" is sent + Then the response code is 400 + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_ARGUMENT" + And the response property "$.message" contains a user friendly text + # 401 Error Scenarios @connectivity_insights_subscriptions_19_no_authorization_header