From 88b739092dd12613c8bd27dd33064084a5fc5f37 Mon Sep 17 00:00:00 2001
From: Antonio Varvara <115144160+varanto@users.noreply.github.com>
Date: Wed, 28 May 2025 16:35:42 +0200
Subject: [PATCH 01/11] Create IoT_Network_Optimization_UserStory_UseCase_1.md
---
.../IoT_Network_Optimization_UserStory_UseCase_1.md | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 documentation/API_documentation/IoT_Network_Optimization_UserStory_UseCase_1.md
diff --git a/documentation/API_documentation/IoT_Network_Optimization_UserStory_UseCase_1.md b/documentation/API_documentation/IoT_Network_Optimization_UserStory_UseCase_1.md
new file mode 100644
index 0000000..e187f88
--- /dev/null
+++ b/documentation/API_documentation/IoT_Network_Optimization_UserStory_UseCase_1.md
@@ -0,0 +1,11 @@
+
+| Item | Description | Support Qualifier |
+|----|----|----|
+|Summary|A Service Provider partners with a Telco Operator to deploy IoT devices (e.g., sensors, trackers) across the Telco’s nationwide cellular network. To ensure prolonged device battery life and operational efficiency, the Service Provider seeks to activate power-saving configurations for its IoT fleet during periods of low activity or based on predefined thresholds. The Service Provider’s management system invokes the IoT Network Optimization API to dynamically adjust network connectivity parameters. This includes optimizing data transmission intervals, reducing signal strength during idle phases, and scheduling sleep cycles for devices without disrupting critical service functionality. The API evaluates network conditions, device locations, and application requirements to apply energy-efficient settings while maintaining guaranteed quality-of-service levels. By leveraging the API, the Provider ensures IoT devices consume minimal power during operation, significantly extending battery lifetimes and reducing energy costs. The optimization accounts for both device-level energy savings and reduced overhead on the Telco’s network infrastructure (e.g., lower RAN utilization during sleep cycles). Clients benefit from uninterrupted service with no manual intervention, aligning sustainability goals with operational reliability.| M |
+|Roles, Actor(s) and scope|• Service Provider: role of IoT Network Optimization API consumer
API Provider: role of IoT Network Optimization API provider
• Operator Platform ([EdgeCloud/documentation/SupportingDocuments/Edge terminology/edge_terminology.md at main · camaraproject/EdgeCloud](https://github.com/camaraproject/EdgeCloud/blob/main/documentation/SupportingDocuments/Edge%20terminology/edge_terminology.md)): role of Service host
• End User: both Teclo Operator's subscribers and Service Provider customer, role of Service consumer
• Scope: Computing Services (OGW Taxonomy)| M |
+|NF Requirements|NA| O |
+|Pre-conditions|• The Service Provider has a fleet of IoT devices
• The IoT devices are connected to the Operator network.| M |
+|Begins when|The API Consumer invokes the IoT Network Optimization API to set power-saving features for a fleet of IoT devices with a specific configuration.| M |
+|Step 2|The API Provider returns a transaction identifier to check the status of the request. | M|
+|Step 3|The API Provider invokes a callback to the API Consumer to notifiy the final status of the requested operation. | M |
+|Post-conditions|The Service Provider devices can leverege an optimized network configuration to save power. | M |
From 304b2e1602e90fece567d427f46de2b6cdcd8046 Mon Sep 17 00:00:00 2001
From: Antonio Varvara <115144160+varanto@users.noreply.github.com>
Date: Mon, 16 Jun 2025 14:37:53 +0200
Subject: [PATCH 02/11] Create iot-network-optimization.yaml
---
.../iot-network-optimization.yaml | 794 ++++++++++++++++++
1 file changed, 794 insertions(+)
create mode 100644 code/API_definitions/iot-network-optimization.yaml
diff --git a/code/API_definitions/iot-network-optimization.yaml b/code/API_definitions/iot-network-optimization.yaml
new file mode 100644
index 0000000..ecc0eb8
--- /dev/null
+++ b/code/API_definitions/iot-network-optimization.yaml
@@ -0,0 +1,794 @@
+openapi: 3.0.3
+############################################################################
+# API info #
+############################################################################
+info:
+ title: IoT Network Optimization API
+ description: |
+ ## Overview
+ The IoT Network Optimization API provides the API Consumer with the capabilities
+ of activating IoT-specific features for a fleet of devices.
+ ## Introduction
+ The scenario a Service Provider that partners with a Telco Operator to deploy IoT
+ devices (e.g., sensors, trackers) across the Telco’s nationwide cellular network.
+ To ensure prolonged device battery life and operational efficiency, the Service
+ Provider seeks to activate power-saving configurations for its IoT fleet during
+ periods of low activity or based on predefined thresholds. The Service Provider’s
+ management system invokes the IoT Network Optimization API to dynamically adjust
+ network connectivity parameters. This includes optimizing data transmission
+ intervals, reducing signal strength during idle phases, and scheduling sleep cycles
+ for devices without disrupting critical service functionality. The API evaluates
+ network conditions, device locations, and application requirements to apply
+ energy-efficient settings while maintaining guaranteed quality-of-service levels.
+ By leveraging the API, the Provider ensures IoT devices consume minimal power
+ during operation, significantly extending battery lifetimes and reducing energy
+ costs. The optimization accounts for both device-level energy savings and reduced
+ overhead on the Telco’s network infrastructure (e.g., lower RAN utilization during
+ sleep cycles). Clients benefit from uninterrupted service with no manual
+ intervention, aligning sustainability goals with operational reliability.\
+ \
+ **Example use case and flow:**\
+ \
+ [**Service**](https://github.com/camaraproject/\
+ IoTNetworkOptimization/blob/main/documentation/API_documentation/\
+ IoT_Network_Optimization_UserStory_UseCase_1.md)\
+ \
+ **The main elements of the IoT Network Optimization API are:**\
+ \
+ **PowerSavingRequest:**
+ Provides to the API Producer the intention of a enabling or disabling power saving
+ features for a specific set of IoT devices.\
+ \
+ **PowerSavingResponse:**
+ Provides to the API Consumer the status of the power-saving feature activation
+ based on the related transaction.\
+
+ # Authorization and authentication
+ The "Camara Security and Interoperability Profile" provides details on how
+ an API consumer requests an access token. Please refer to Identify and
+ Consent Management
+ (https://github.com/camaraproject/IdentityAndConsentManagement/)
+ for the released version of the profile.\
+ \
+ The specific authorization flows to be used will be agreed upon during the
+ onboarding process, happening between the API consumer and the API
+ provider, taking into account the declared purpose for accessing the API,
+ whilst also being subject to the prevailing legal framework dictated by
+ local legislation.\
+ \
+ In cases where personal data is processed by the API and users can
+ exercise their rights through mechanisms such as opt-in and/or opt-out,
+ the use of three-legged access tokens is mandatory. This ensures that
+ the API remains in compliance with privacy regulations, upholding the
+ principles of transparency and user-centric privacy-by-design.
+ ## API Documentation
+ ## Details
+ The IoT Network Optimization API provides the API Consumer with the capability to
+ activate and manage IoT-specific network features for a fleet of connected devices.
+ The API enables optimized power consumption transmission by leveraging
+ network-level configurations tailored for IoT deployments.
+
+ The IoT API allows an IoT Service Provider to dynamically adjust network parameters
+ to optimize device performance and reduce operational overhead.
+ The IoT API Consumer (typically the IoT Service Provider or a third-party
+ management system) invokes the API with identifiers for the target IoT devices.
+ The API then applies the requested optimizations, such as enabling low-power modes
+ for battery-operated sensors.
+
+ By using the IoT Network Optimization API, Service Providers can ensure their IoT
+ deployments operate at peak efficiency extending device battery life and improving
+ overall service reliability.
+
+ The IoT Network Optimization API is an intent based API.
+ \
+ The IoT Network Optimization API supports the following Intent:
+ - Intent1: I would like to activate power-saving features for my IoT devices during a specified period.
+
+ The inputs for the above intent are:
+ - IoT devices (e.g., device identifiers like IPs or SIM phone number)
+ - power-saving desired status
+ - time frame (e.g., start/end timestamps)
+
+ The output for the above intent are:
+ - activation status (success/failure per device or group)
+ - transaction ID for tracking
+
+ The related endpoint is:
+ - Intent: /features/power-saving
+
+ ## Additional CAMARA error responses
+ The list of error codes in this API specification is not exhaustive.
+ Therefore the API specification may not document some non-mandatory error
+ statuses as indicated in `CAMARA API Design Guidelines`.
+
+ Please refer to [CAMARA_common.yaml]({link_to_release}/CAMARA_common.yaml)
+ for a complete list of error responses.
+
+ As a specific rule, error `501 - NOT_IMPLEMENTED` can be only a possible
+ error response if it is explicitly documented in the API.
+ ## FAQ's
+ (FAQs will be added in a later version of the documentation)
+ ## Release Notes
+ First draft for the IoT Network Optimization API.
+
+ version: wip
+ license:
+ name: Apache 2.0
+ url: https://www.apache.org/licenses/LICENSE-2.0.html
+ x-camara-commonalities: 0.5
+externalDocs:
+ description: Product documentation at Camara
+ url: https://github.com/camaraproject/TBD
+############################################################################
+# Servers #
+############################################################################
+servers:
+ - url: "{apiRoot}/iot-network-opt/vwip"
+ variables:
+ apiRoot:
+ default: http://localhost:9091
+ description: API root for the Energy Footprint Notification API
+security:
+ - notificationsBearerAuth: []
+tags:
+ - name: Power Saving
+ description: Enable/Disable power-saving features.
+############################################################################
+# Paths #
+############################################################################
+paths:
+ /features/power-saving:
+ post:
+ tags:
+ - Power Saving
+ summary: Activate or de-activate power-saving features for IoT devices
+ operationId: activatePowerSaving
+ parameters:
+ - $ref: '#/components/parameters/x-correlator'
+ security:
+ - oAuth2:
+ - 'iot-management:power-saving:write'
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/PowerSavingRequest'
+ responses:
+ "200":
+ description: Power-saving feature request sent successfully
+ headers:
+ x-correlator:
+ $ref: '#/components/headers/x-correlator'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/PowerSavingResponse'
+ "400":
+ $ref: "#/components/responses/Generic400"
+ "401":
+ $ref: "#/components/responses/Generic401"
+ "403":
+ $ref: "#/components/responses/Generic403"
+ "404":
+ $ref: "#/components/responses/Generic404"
+ "501":
+ $ref: "#/components/responses/Generic501"
+ callbacks:
+ onTransactionCompleted:
+ $ref: "#/components/callbacks/onTransactionCompleted"
+
+ /features/power-saving/transactions/{transactionId}:
+ get:
+ parameters:
+ - name: transactionId
+ in: path
+ required: true
+ schema:
+ $ref: '#/components/schemas/TransactionId'
+ - $ref: '#/components/parameters/x-correlator'
+ tags:
+ - Power Saving
+ summary: Get status of a transaction for power-saving features
+ operationId: getPowerSaving
+ security:
+ - oAuth2:
+ - 'iot-management:power-saving:read'
+ responses:
+ '200':
+ description: Power-saving features activated successfully
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/PowerSavingResponse'
+ "400":
+ $ref: "#/components/responses/Generic400"
+ "401":
+ $ref: "#/components/responses/Generic401"
+ "403":
+ $ref: "#/components/responses/Generic403"
+ "404":
+ $ref: "#/components/responses/Generic404"
+ "501":
+ $ref: "#/components/responses/Generic501"
+
+############################################################################
+# Components #
+############################################################################
+components:
+ securitySchemes:
+ oAuth2:
+ type: oauth2
+ description: This API uses OAuth 2
+ [More info](https://api.example.com/docs/auth)
+ flows:
+ clientCredentials:
+ tokenUrl: 'https://example.com/oauth/token'
+ scopes:
+ 'iot-management:power-saving:read':
+ Grants access to read-only data in the Power Saving resources
+ 'iot-management:power-saving:write':
+ Grants write access to the Power Saving resources
+ notificationsBearerAuth:
+ type: http
+ scheme: bearer
+ bearerFormat: "{$request.body#/sinkCredential.credentialType}"
+ parameters:
+ x-correlator:
+ name: x-correlator
+ in: header
+ description: Correlation id for the different services
+ schema:
+ $ref: "#/components/schemas/XCorrelator"
+ headers:
+ x-correlator:
+ description: Correlation id for the different services
+ schema:
+ $ref: "#/components/schemas/XCorrelator"
+ #########################################################################
+ # Events/Callbacks #
+ #########################################################################
+ callbacks:
+ onTransactionCompleted:
+ # when data is sent, it will be sent to the callback url provided
+ '{$request.body.notificationSink.sink}':
+ post:
+ summary: Provides back the result of the analysis on the energy
+ consumption
+ description: once the system has calculated the energy consumption of
+ the service, this information is provided back to the API Consumer
+ operationId: energyConsumptionNotification
+ parameters:
+ - $ref: '#/components/parameters/x-correlator'
+ security:
+ - notificationsBearerAuth: []
+ requestBody:
+ description: payload containing the calculated energy consumption
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CloudEventPowerSaving'
+ responses:
+ '202':
+ description: Your server implementation should return this HTTP
+ status code if the data was received successfully
+ headers:
+ x-correlator:
+ $ref: '#/components/headers/x-correlator'
+ '204':
+ description: Your server should return this HTTP status code if
+ no longer interested in further updates
+ headers:
+ x-correlator:
+ $ref: '#/components/headers/x-correlator'
+ ############################################################################
+ # Resources #
+ ############################################################################
+ schemas:
+ NotificationSink:
+ description: ""
+ type: object
+ required:
+ - sink
+ properties:
+ sink:
+ description: 'https callback address where the notification must be
+ POST-ed'
+ type: string
+ sinkCredentials:
+ description: Sink credential provides authorization information
+ necessary to enable delivery of events to a target
+ type: object
+ properties:
+ credentialtype:
+ type: string
+ description: Type of the credential - MUST be set to ACCESSTOKEN
+ for now
+ enum:
+ - "ACCESSTOKEN"
+ accessToken:
+ type: string
+ description: Access Token granting access to the POST operation to
+ create notification
+ accessTokenExpireUtc:
+ type: string
+ format: date-time
+ description: An absolute UTC instant at which the access token
+ shall be considered expired.
+ accessTokenType:
+ type: string
+ description: Type of access token - MUST be set to bearer for now
+ enum:
+ - "bearer"
+ PowerSavingRequest:
+ type: object
+ required:
+ - devices
+ - enabled
+ - notificationSink
+ properties:
+ devices:
+ type: array
+ items:
+ $ref: '#/components/schemas/Device'
+ description: Device IDs or group identifiers
+ enabled:
+ type: boolean
+ timePeriod:
+ required:
+ - startDate
+ properties:
+ startDate:
+ type: string
+ format: date-time
+ description: An instant of time, starting of the TimePeriod.
+ endDate:
+ type: string
+ format: date-time
+ description: An instant of time, ending of the TimePeriod.
+ If not included, then the period has no ending date.
+ notificationSink:
+ $ref: '#/components/schemas/NotificationSink'
+ DateTime:
+ type: string
+ format: date-time
+ description: |
+ Timestamp of when the occurrence happened. Must adhere to RFC 3339.
+ WARN: This optional field in CloudEvents specification is required in
+ CAMARA APIs implementation.
+ example: '2018-04-05T17:31:00Z'
+ Source:
+ type: string
+ format: uri-reference
+ minLength: 1
+ description: |
+ Identifies the context in which an event happened - be a non-empty
+ `URI-reference` like:
+ - URI with a DNS authority:
+ * https://github.com/cloudevents
+ * mailto:cncf-wg-serverless@lists.cncf.io
+ - Universally-unique URN with a UUID:
+ * urn:uuid:6e8bc430-9c3a-11d9-9669-0800200c9a66
+ - Application-specific identifier:
+ * /cloudevents/spec/pull/123
+ * 1-555-123-4567
+ example: "https://notificationSendServer12.supertelco.com"
+ CloudEvent:
+ description: The notification callback
+ required:
+ - id
+ - source
+ - specversion
+ - type
+ - time
+ properties:
+ id:
+ type: string
+ description: identifier of this event, that must be unique in the
+ source context.
+ minLength: 1
+ source:
+ $ref: '#/components/schemas/Source'
+ type:
+ type: string
+ description: 'type of event as defined in each CAMARA API'
+ example: 'org.camaraproject.iot.dta-status-changed-event'
+ minLength: 25
+ specversion:
+ type: string
+ description: Version of the specification to which this event conforms
+ (must be 1.0 if it conforms to cloudevents 1.0.2 version)
+ enum:
+ - "1.0"
+ datacontenttype:
+ type: string
+ description: 'media-type that describes the event payload encoding,
+ must be "application/json" for CAMARA APIs'
+ enum:
+ - application/json
+ data:
+ type: object
+ description: Event details payload described in each CAMARA API and
+ referenced by its type
+ time:
+ $ref: "#/components/schemas/DateTime"
+
+ CloudEventPowerSaving:
+ description: provides back the power saving operation result.
+ allOf:
+ - $ref: "#/components/schemas/CloudEvent"
+ properties:
+ data:
+ $ref: "#/components/schemas/PowerSavingResponse"
+
+ PowerSavingResponse:
+ type: object
+ properties:
+ activationStatus:
+ type: array
+ items:
+ $ref: '#/components/schemas/DeviceStatus'
+ transactionId:
+ type: string
+
+ DeviceStatus:
+ type: object
+ properties:
+ device:
+ $ref: '#/components/schemas/Device'
+ status:
+ type: string
+ enum: [in-progress, success, failed]
+
+ Device:
+ description: |
+ End-user equipment able to connect to a mobile network. Examples of
+ devices include smartphones or IoT sensors/actuators.
+ The developer can choose to provide the below specified device
+ identifiers:
+ * `ipv4Address`
+ * `ipv6Address`
+ * `phoneNumber`
+ * `networkAccessIdentifier`
+ NOTE1: the MNO might support only a subset of these options.
+ The API invoker can provide multiple identifiers to be compatible
+ across different MNOs. In this case the identifiers MUST belong to
+ the same device.
+ NOTE2: as for this Commonalities release, we are enforcing that the
+ networkAccessIdentifier is only part of the schema for
+ future-proofing, and CAMARA does not currently allow its use.
+ After the CAMARA meta-release work is concluded and the relevant
+ issues are resolved, its use will need to be explicitly documented
+ in the guidelines.
+ type: object
+ properties:
+ phoneNumber:
+ $ref: "#/components/schemas/PhoneNumber"
+ networkAccessIdentifier:
+ $ref: "#/components/schemas/NetworkAccessIdentifier"
+ ipv4Address:
+ $ref: "#/components/schemas/DeviceIpv4Addr"
+ ipv6Address:
+ $ref: "#/components/schemas/DeviceIpv6Address"
+ minProperties: 1
+ PhoneNumber:
+ description: A public identifier addressing a telephone subscription. In
+ mobile networks it corresponds to the MSISDN (Mobile Station
+ International Subscriber Directory Number). In order to be globally
+ unique it has to be formatted in international format, according to
+ E.164 standard, prefixed with '+'.
+ type: string
+ pattern: '^\+[1-9][0-9]{4,14}$'
+ example: "+123456789"
+ NetworkAccessIdentifier:
+ description: A public identifier addressing a subscription in a mobile
+ network. In 3GPP terminology, it corresponds to the GPSI formatted with
+ the External Identifier ({Local Identifier}@{Domain Identifier}).
+ Unlike the telephone number, the network access identifier is not
+ subjected to portability ruling in force, and is individually managed
+ by each operator.
+ type: string
+ example: "123456789@domain.com"
+ DeviceIpv4Addr:
+ type: object
+ description: |
+ The device should be identified by either the public (observed) IP
+ address and port as seen by the application server, or the private
+ (local) and any public (observed) IP addresses in use by the device
+ (this information can be obtained by various means, for example from
+ some DNS servers).
+ If the allocated and observed IP addresses are the same (i.e. NAT is not
+ in use) then the same address should be specified for both
+ publicAddress and privateAddress.
+ If NAT64 is in use, the device should be identified by its publicAddress
+ and publicPort, or separately by its allocated IPv6 address (field
+ ipv6Address of the Device object)
+ In all cases, publicAddress must be specified, along with at least one
+ of either privateAddress or publicPort, dependent upon which is known.
+ In general, mobile devices cannot be identified by their public IPv4
+ address alone.
+ properties:
+ publicAddress:
+ $ref: "#/components/schemas/SingleIpv4Addr"
+ privateAddress:
+ $ref: "#/components/schemas/SingleIpv4Addr"
+ publicPort:
+ $ref: "#/components/schemas/Port"
+ anyOf:
+ - required: [publicAddress, privateAddress]
+ - required: [publicAddress, publicPort]
+ example:
+ publicAddress: "84.125.93.10"
+ publicPort: 59765
+ SingleIpv4Addr:
+ description: A single IPv4 address with no subnet mask
+ type: string
+ format: ipv4
+ example: "84.125.93.10"
+ Port:
+ description: TCP or UDP port number
+ type: integer
+ minimum: 0
+ maximum: 65535
+ Protocol:
+ description: The protocol for the influeced flow. It can be specified and
+ it is identified by a string according to the column “Keyword” as defined
+ by IANA (https://www.iana.org/assignments/protocol-numbers/\
+ protocol-numbers.xhtml), e.g. UDP or TCP.
+ type: string
+ example: "TCP"
+ DeviceIpv6Address:
+ description: |
+ The device should be identified by the observed IPv6 address, or by any
+ single IPv6 address from within the subnet allocated to the device
+ (e.g. adding ::0 to the /64 prefix).
+ type: string
+ format: ipv6
+ example: 2001:db8:85a3:8d3:1319:8a2e:370:7344
+
+ TransactionId:
+ type: string
+ format: uuid
+ description: Transaction identifier allocated for enabling/disabling IoT features
+ XCorrelator:
+ type: string
+ pattern: ^[a-zA-Z0-9-_:;.\/<>{}]{0,256}$
+ example: "b4333c46-49c0-4f62-80d7-f0ef930f1c46"
+############################################################################
+# Responses #
+############################################################################
+ ErrorInfo:
+ description: error information
+ type: object
+ required:
+ - status
+ - code
+ - message
+ properties:
+ status:
+ type: integer
+ description: HTTP status code returned along with this error response
+ code:
+ type: string
+ description: Code given to this error
+ message:
+ type: string
+ description: Detailed error description
+ responses:
+ Generic400:
+ description: Bad Request
+ headers:
+ x-correlator:
+ $ref: "#/components/headers/x-correlator"
+ content:
+ application/json:
+ schema:
+ allOf:
+ - $ref: "#/components/schemas/ErrorInfo"
+ - type: object
+ properties:
+ status:
+ enum:
+ - 400
+ code:
+ enum:
+ - INVALID_ARGUMENT
+ - OUT_OF_RANGE
+ examples:
+ GENERIC_400_INVALID_ARGUMENT:
+ description: Invalid Argument. Generic Syntax Exception
+ value:
+ status: 400
+ code: INVALID_ARGUMENT
+ message: Client specified an invalid argument, request body or
+ query param.
+ GENERIC_400_OUT_OF_RANGE:
+ description: Out of Range. Specific Syntax Exception used when a
+ given field has has an unsupported value.
+ value:
+ status: 400
+ code: OUT_OF_RANGE
+ message: Client specified an invalid range.
+ Generic401:
+ description: Unauthorized
+ headers:
+ x-correlator:
+ $ref: "#/components/headers/x-correlator"
+ content:
+ application/json:
+ schema:
+ allOf:
+ - $ref: "#/components/schemas/ErrorInfo"
+ - type: object
+ properties:
+ status:
+ enum:
+ - 401
+ code:
+ enum:
+ - UNAUTHENTICATED
+ examples:
+ GENERIC_401_UNAUTHENTICATED:
+ description: Request cannot be authenticated and a new authentication
+ is required
+ value:
+ status: 401
+ code: UNAUTHENTICATED
+ message: Request not authenticated due to missing, invalid, or expired
+ credentials. A new authentication is required.
+ Generic403:
+ description: Forbidden
+ headers:
+ x-correlator:
+ $ref: "#/components/headers/x-correlator"
+ content:
+ application/json:
+ schema:
+ allOf:
+ - $ref: "#/components/schemas/ErrorInfo"
+ - type: object
+ properties:
+ status:
+ enum:
+ - 403
+ code:
+ enum:
+ - PERMISSION_DENIED
+ examples:
+ GENERIC_403_PERMISSION_DENIED:
+ description: Permission denied. OAuth2 token access does not have
+ the required scope or when the user fails operational security
+ value:
+ status: 403
+ code: PERMISSION_DENIED
+ message: Client does not have sufficient permissions to perform
+ this action.
+ Generic404:
+ description: Not found
+ headers:
+ x-correlator:
+ $ref: "#/components/headers/x-correlator"
+ content:
+ application/json:
+ schema:
+ allOf:
+ - $ref: "#/components/schemas/ErrorInfo"
+ - type: object
+ properties:
+ status:
+ enum:
+ - 404
+ code:
+ enum:
+ - NOT_FOUND
+ - UNKNOWN_APPLICATION_IDENTIFIER
+ examples:
+ GENERIC_404_NOT_FOUND:
+ description: Resource is not found
+ value:
+ status: 404
+ code: NOT_FOUND
+ message: The specified resource is not found.
+ GENERIC_404_IDENTIFIER_NOT_FOUND:
+ description: Application Identifier unknown
+ value:
+ status: 404
+ code: UNKNOWN_APPLICATION_IDENTIFIER
+ message: the target application is unknown.
+ Generic422:
+ description: Unprocessable Content
+ headers:
+ x-correlator:
+ $ref: "#/components/headers/x-correlator"
+ content:
+ application/json:
+ schema:
+ allOf:
+ - $ref: "#/components/schemas/ErrorInfo"
+ - type: object
+ properties:
+ status:
+ enum:
+ - 422
+ code:
+ enum:
+ - SERVICE_NOT_APPLICABLE
+ - MISSING_IDENTIFIER
+ examples:
+ GENERIC_422_SERVICE_NOT_APPLICABLE:
+ description: Service not applicable for the provided
+ identifier
+ value:
+ status: 422
+ code: SERVICE_NOT_APPLICABLE
+ message: The service is not available for the
+ provided identifier.
+ GENERIC_422_MISSING_IDENTIFIER:
+ description: the Application Identifier is not included in the
+ request
+ value:
+ status: 422
+ code: MISSING_IDENTIFIER
+ message: unspecified Application Identifier.
+ Generic429:
+ description: Too Many Requests
+ headers:
+ x-correlator:
+ $ref: "#/components/headers/x-correlator"
+ content:
+ application/json:
+ schema:
+ allOf:
+ - $ref: "#/components/schemas/ErrorInfo"
+ - type: object
+ properties:
+ status:
+ enum:
+ - 429
+ code:
+ enum:
+ - QUOTA_EXCEEDED
+ - TOO_MANY_REQUESTS
+ examples:
+ GENERIC_429_QUOTA_EXCEEDED:
+ description: Request is rejected due to exceeding a
+ business quota limit
+ value:
+ status: 429
+ code: QUOTA_EXCEEDED
+ message: Out of resource quota.
+ GENERIC_429_TOO_MANY_REQUESTS:
+ description: Access to the API has been temporarily
+ blocked due to rate or spike arrest limits being reached
+ value:
+ status: 429
+ code: TOO_MANY_REQUESTS
+ message: Rate limit reached.
+
+ Generic501:
+ description: Not Implemented
+ headers:
+ x-correlator:
+ $ref: "#/components/headers/x-correlator"
+ content:
+ application/json:
+ schema:
+ allOf:
+ - $ref: "#/components/schemas/ErrorInfo"
+ - type: object
+ properties:
+ status:
+ enum:
+ - 501
+ code:
+ enum:
+ - NOT_IMPLEMENTED
+ examples:
+ GENERIC_501_NOT_IMPLEMENTED:
+ description: Service not implemented. The use of this code
+ should be avoided as far as possible to get the objective
+ to reach aligned implementations
+ value:
+ status: 501
+ code: NOT_IMPLEMENTED
+ message: This functionality is not implemented yet.
From 51a199ab2814515ed25db68658fa52ae29d11658 Mon Sep 17 00:00:00 2001
From: Antonio Varvara <115144160+varanto@users.noreply.github.com>
Date: Mon, 23 Jun 2025 12:32:20 +0200
Subject: [PATCH 03/11] Update iot-network-optimization.yaml
---
.../iot-network-optimization.yaml | 90 ++++++++++---------
1 file changed, 48 insertions(+), 42 deletions(-)
diff --git a/code/API_definitions/iot-network-optimization.yaml b/code/API_definitions/iot-network-optimization.yaml
index ecc0eb8..c8ca60a 100644
--- a/code/API_definitions/iot-network-optimization.yaml
+++ b/code/API_definitions/iot-network-optimization.yaml
@@ -1,30 +1,34 @@
+---
openapi: 3.0.3
############################################################################
# API info #
############################################################################
info:
title: IoT Network Optimization API
- description: |
+ description: |
## Overview
- The IoT Network Optimization API provides the API Consumer with the capabilities
- of activating IoT-specific features for a fleet of devices.
+ The IoT Network Optimization API provides the API Consumer with the
+ capabilities of activating IoT-specific features for a fleet of devices.
## Introduction
- The scenario a Service Provider that partners with a Telco Operator to deploy IoT
- devices (e.g., sensors, trackers) across the Telco’s nationwide cellular network.
- To ensure prolonged device battery life and operational efficiency, the Service
- Provider seeks to activate power-saving configurations for its IoT fleet during
- periods of low activity or based on predefined thresholds. The Service Provider’s
- management system invokes the IoT Network Optimization API to dynamically adjust
- network connectivity parameters. This includes optimizing data transmission
- intervals, reducing signal strength during idle phases, and scheduling sleep cycles
- for devices without disrupting critical service functionality. The API evaluates
+ The scenario a Service Provider that partners with a Telco Operator to
+ deploy IoT devices (e.g., sensors, trackers) across the Telco’s nationwide
+ cellular network.
+ To ensure prolonged device battery life and operational efficiency, the
+ Service Provider seeks to activate power-saving configurations for its IoT
+ fleet during periods of low activity or based on predefined thresholds.
+ The Service Provider’s management system invokes the IoT Network
+ Optimization API to dynamically adjust network connectivity parameters.
+ This includes optimizing data transmission intervals, reducing signal
+ strength during idle phases, and scheduling sleep cycles for devices
+ without disrupting critical service functionality. The API evaluates
network conditions, device locations, and application requirements to apply
- energy-efficient settings while maintaining guaranteed quality-of-service levels.
- By leveraging the API, the Provider ensures IoT devices consume minimal power
- during operation, significantly extending battery lifetimes and reducing energy
- costs. The optimization accounts for both device-level energy savings and reduced
- overhead on the Telco’s network infrastructure (e.g., lower RAN utilization during
- sleep cycles). Clients benefit from uninterrupted service with no manual
+ energy-efficient settings while maintaining guaranteed quality-of-service
+ levels. By leveraging the API, the Provider ensures IoT devices consume
+ minimal power during operation, significantly extending battery lifetimes
+ and reducing energy costs. The optimization accounts for both device-level
+ energy savings and reduced overhead on the Telco’s network infrastructure
+ (e.g., lower RAN utilization during sleep cycles). Clients benefit from
+ uninterrupted service with no manual
intervention, aligning sustainability goals with operational reliability.\
\
**Example use case and flow:**\
@@ -36,12 +40,12 @@ info:
**The main elements of the IoT Network Optimization API are:**\
\
**PowerSavingRequest:**
- Provides to the API Producer the intention of a enabling or disabling power saving
- features for a specific set of IoT devices.\
+ Provides to the API Producer the intention of a enabling or disabling power
+ saving features for a specific set of IoT devices.\
\
**PowerSavingResponse:**
- Provides to the API Consumer the status of the power-saving feature activation
- based on the related transaction.\
+ Provides to the API Consumer the status of the power-saving feature
+ activation based on the related transaction.\
# Authorization and authentication
The "Camara Security and Interoperability Profile" provides details on how
@@ -63,26 +67,28 @@ info:
principles of transparency and user-centric privacy-by-design.
## API Documentation
## Details
- The IoT Network Optimization API provides the API Consumer with the capability to
- activate and manage IoT-specific network features for a fleet of connected devices.
- The API enables optimized power consumption transmission by leveraging
- network-level configurations tailored for IoT deployments.
+ The IoT Network Optimization API provides the API Consumer with the
+ capability to activate and manage IoT-specific network features for a fleet
+ of connected devices. The API enables optimized power consumption
+ transmission by leveraging network-level configurations tailored for IoT
+ deployments.
- The IoT API allows an IoT Service Provider to dynamically adjust network parameters
- to optimize device performance and reduce operational overhead.
+ The IoT API allows an IoT Service Provider to dynamically adjust network
+ parameters to optimize device performance and reduce operational overhead.
The IoT API Consumer (typically the IoT Service Provider or a third-party
- management system) invokes the API with identifiers for the target IoT devices.
- The API then applies the requested optimizations, such as enabling low-power modes
- for battery-operated sensors.
+ management system) invokes the API with identifiers for the target IoT
+ devices. The API then applies the requested optimizations, such as enabling
+ low-power modes for battery-operated sensors.
- By using the IoT Network Optimization API, Service Providers can ensure their IoT
- deployments operate at peak efficiency extending device battery life and improving
- overall service reliability.
+ By using the IoT Network Optimization API, Service Providers can ensure
+ their IoT deployments operate at peak efficiency extending device battery
+ life and improving overall service reliability.
The IoT Network Optimization API is an intent based API.
\
The IoT Network Optimization API supports the following Intent:
- - Intent1: I would like to activate power-saving features for my IoT devices during a specified period.
+ - Intent1: I would like to activate power-saving features for my IoT devices
+ during a specified period.
The inputs for the above intent are:
- IoT devices (e.g., device identifiers like IPs or SIM phone number)
@@ -195,7 +201,7 @@ paths:
- oAuth2:
- 'iot-management:power-saving:read'
responses:
- '200':
+ "200":
description: Power-saving features activated successfully
content:
application/json:
@@ -549,7 +555,8 @@ components:
TransactionId:
type: string
format: uuid
- description: Transaction identifier allocated for enabling/disabling IoT features
+ description: Transaction identifier allocated for enabling/disabling IoT
+ features
XCorrelator:
type: string
pattern: ^[a-zA-Z0-9-_:;.\/<>{}]{0,256}$
@@ -629,13 +636,13 @@ components:
- UNAUTHENTICATED
examples:
GENERIC_401_UNAUTHENTICATED:
- description: Request cannot be authenticated and a new authentication
- is required
+ description: Request cannot be authenticated and a new
+ authentication is required
value:
status: 401
code: UNAUTHENTICATED
- message: Request not authenticated due to missing, invalid, or expired
- credentials. A new authentication is required.
+ message: Request not authenticated due to missing, invalid, or
+ expired credentials. A new authentication is required.
Generic403:
description: Forbidden
headers:
@@ -764,7 +771,6 @@ components:
status: 429
code: TOO_MANY_REQUESTS
message: Rate limit reached.
-
Generic501:
description: Not Implemented
headers:
From e679e237e4c6d515d1eb7c0a76252d6c1a0db3db Mon Sep 17 00:00:00 2001
From: Antonio Varvara <115144160+varanto@users.noreply.github.com>
Date: Mon, 23 Jun 2025 12:58:10 +0200
Subject: [PATCH 04/11] Update iot-network-optimization.yaml
---
.../iot-network-optimization.yaml | 85 ++++++++++---------
1 file changed, 43 insertions(+), 42 deletions(-)
diff --git a/code/API_definitions/iot-network-optimization.yaml b/code/API_definitions/iot-network-optimization.yaml
index c8ca60a..68fd741 100644
--- a/code/API_definitions/iot-network-optimization.yaml
+++ b/code/API_definitions/iot-network-optimization.yaml
@@ -7,28 +7,28 @@ info:
title: IoT Network Optimization API
description: |
## Overview
- The IoT Network Optimization API provides the API Consumer with the
+ The IoT Network Optimization API provides the API Consumer with the
capabilities of activating IoT-specific features for a fleet of devices.
## Introduction
- The scenario a Service Provider that partners with a Telco Operator to
- deploy IoT devices (e.g., sensors, trackers) across the Telco’s nationwide
+ The scenario a Service Provider that partners with a Telco Operator to
+ deploy IoT devices (e.g., sensors, trackers) across the Telco’s nationwide
cellular network.
- To ensure prolonged device battery life and operational efficiency, the
- Service Provider seeks to activate power-saving configurations for its IoT
+ To ensure prolonged device battery life and operational efficiency, the
+ Service Provider seeks to activate power-saving configurations for its IoT
fleet during periods of low activity or based on predefined thresholds.
- The Service Provider’s management system invokes the IoT Network
+ The Service Provider’s management system invokes the IoT Network
Optimization API to dynamically adjust network connectivity parameters.
- This includes optimizing data transmission intervals, reducing signal
- strength during idle phases, and scheduling sleep cycles for devices
- without disrupting critical service functionality. The API evaluates
- network conditions, device locations, and application requirements to apply
- energy-efficient settings while maintaining guaranteed quality-of-service
- levels. By leveraging the API, the Provider ensures IoT devices consume
- minimal power during operation, significantly extending battery lifetimes
- and reducing energy costs. The optimization accounts for both device-level
- energy savings and reduced overhead on the Telco’s network infrastructure
+ This includes optimizing data transmission intervals, reducing signal
+ strength during idle phases, and scheduling sleep cycles for devices
+ without disrupting critical service functionality. The API evaluates
+ network conditions, device locations, and application requirements to apply
+ energy-efficient settings while maintaining guaranteed quality-of-service
+ levels. By leveraging the API, the Provider ensures IoT devices consume
+ minimal power during operation, significantly extending battery lifetimes
+ and reducing energy costs. The optimization accounts for both device-level
+ energy savings and reduced overhead on the Telco’s network infrastructure
(e.g., lower RAN utilization during sleep cycles). Clients benefit from
- uninterrupted service with no manual
+ uninterrupted service with no manual
intervention, aligning sustainability goals with operational reliability.\
\
**Example use case and flow:**\
@@ -40,13 +40,12 @@ info:
**The main elements of the IoT Network Optimization API are:**\
\
**PowerSavingRequest:**
- Provides to the API Producer the intention of a enabling or disabling power
+ Provides to the API Producer the intention of a enabling or disabling power
saving features for a specific set of IoT devices.\
\
**PowerSavingResponse:**
- Provides to the API Consumer the status of the power-saving feature
+ Provides to the API Consumer the status of the power-saving feature
activation based on the related transaction.\
-
# Authorization and authentication
The "Camara Security and Interoperability Profile" provides details on how
an API consumer requests an access token. Please refer to Identify and
@@ -68,40 +67,40 @@ info:
## API Documentation
## Details
The IoT Network Optimization API provides the API Consumer with the
- capability to activate and manage IoT-specific network features for a fleet
- of connected devices. The API enables optimized power consumption
+ capability to activate and manage IoT-specific network features for a fleet
+ of connected devices. The API enables optimized power consumption
transmission by leveraging network-level configurations tailored for IoT
deployments.
-
- The IoT API allows an IoT Service Provider to dynamically adjust network
+
+ The IoT API allows an IoT Service Provider to dynamically adjust network
parameters to optimize device performance and reduce operational overhead.
The IoT API Consumer (typically the IoT Service Provider or a third-party
- management system) invokes the API with identifiers for the target IoT
- devices. The API then applies the requested optimizations, such as enabling
+ management system) invokes the API with identifiers for the target IoT
+ devices. The API then applies the requested optimizations, such as enabling
low-power modes for battery-operated sensors.
-
- By using the IoT Network Optimization API, Service Providers can ensure
- their IoT deployments operate at peak efficiency extending device battery
+
+ By using the IoT Network Optimization API, Service Providers can ensure
+ their IoT deployments operate at peak efficiency extending device battery
life and improving overall service reliability.
The IoT Network Optimization API is an intent based API.
\
The IoT Network Optimization API supports the following Intent:
- - Intent1: I would like to activate power-saving features for my IoT devices
- during a specified period.
+ - Intent1: I would like to activate power-saving features for my IoT
+ devices during a specified period.
The inputs for the above intent are:
- IoT devices (e.g., device identifiers like IPs or SIM phone number)
- power-saving desired status
- time frame (e.g., start/end timestamps)
-
+
The output for the above intent are:
- activation status (success/failure per device or group)
- transaction ID for tracking
The related endpoint is:
- Intent: /features/power-saving
-
+
## Additional CAMARA error responses
The list of error codes in this API specification is not exhaustive.
Therefore the API specification may not document some non-mandatory error
@@ -116,7 +115,7 @@ info:
(FAQs will be added in a later version of the documentation)
## Release Notes
First draft for the IoT Network Optimization API.
-
+
version: wip
license:
name: Apache 2.0
@@ -217,7 +216,7 @@ paths:
$ref: "#/components/responses/Generic404"
"501":
$ref: "#/components/responses/Generic501"
-
+
############################################################################
# Components #
############################################################################
@@ -418,7 +417,7 @@ components:
referenced by its type
time:
$ref: "#/components/schemas/DateTime"
-
+
CloudEventPowerSaving:
description: provides back the power saving operation result.
allOf:
@@ -426,7 +425,7 @@ components:
properties:
data:
$ref: "#/components/schemas/PowerSavingResponse"
-
+
PowerSavingResponse:
type: object
properties:
@@ -445,7 +444,7 @@ components:
status:
type: string
enum: [in-progress, success, failed]
-
+
Device:
description: |
End-user equipment able to connect to a mobile network. Examples of
@@ -551,7 +550,7 @@ components:
type: string
format: ipv6
example: 2001:db8:85a3:8d3:1319:8a2e:370:7344
-
+
TransactionId:
type: string
format: uuid
@@ -636,13 +635,15 @@ components:
- UNAUTHENTICATED
examples:
GENERIC_401_UNAUTHENTICATED:
- description: Request cannot be authenticated and a new
- authentication is required
+ description: |
+ Request cannot be authenticated and a new authentication is
+ required
value:
status: 401
code: UNAUTHENTICATED
- message: Request not authenticated due to missing, invalid, or
- expired credentials. A new authentication is required.
+ message: |
+ Request not authenticated due to missing, invalid, or expired
+ credentials. A new authentication is required.
Generic403:
description: Forbidden
headers:
From 778d06d6cc8bc06538a6c7828f85c95da22e0537 Mon Sep 17 00:00:00 2001
From: Antonio Varvara <115144160+varanto@users.noreply.github.com>
Date: Mon, 23 Jun 2025 13:07:44 +0200
Subject: [PATCH 05/11] Update iot-network-optimization.yaml
---
code/API_definitions/iot-network-optimization.yaml | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/code/API_definitions/iot-network-optimization.yaml b/code/API_definitions/iot-network-optimization.yaml
index 68fd741..d8b5dcd 100644
--- a/code/API_definitions/iot-network-optimization.yaml
+++ b/code/API_definitions/iot-network-optimization.yaml
@@ -66,7 +66,7 @@ info:
principles of transparency and user-centric privacy-by-design.
## API Documentation
## Details
- The IoT Network Optimization API provides the API Consumer with the
+ The IoT Network Optimization API provides the API Consumer with the
capability to activate and manage IoT-specific network features for a fleet
of connected devices. The API enables optimized power consumption
transmission by leveraging network-level configurations tailored for IoT
@@ -82,7 +82,7 @@ info:
By using the IoT Network Optimization API, Service Providers can ensure
their IoT deployments operate at peak efficiency extending device battery
life and improving overall service reliability.
-
+
The IoT Network Optimization API is an intent based API.
\
The IoT Network Optimization API supports the following Intent:
@@ -198,7 +198,7 @@ paths:
operationId: getPowerSaving
security:
- oAuth2:
- - 'iot-management:power-saving:read'
+ - 'iot-management:power-saving:read'
responses:
"200":
description: Power-saving features activated successfully
@@ -416,7 +416,7 @@ components:
description: Event details payload described in each CAMARA API and
referenced by its type
time:
- $ref: "#/components/schemas/DateTime"
+ $ref: "#/components/schemas/DateTime"
CloudEventPowerSaving:
description: provides back the power saving operation result.
@@ -635,13 +635,13 @@ components:
- UNAUTHENTICATED
examples:
GENERIC_401_UNAUTHENTICATED:
- description: |
- Request cannot be authenticated and a new authentication is
+ description: |
+ Request cannot be authenticated and a new authentication is
required
value:
status: 401
code: UNAUTHENTICATED
- message: |
+ message: |
Request not authenticated due to missing, invalid, or expired
credentials. A new authentication is required.
Generic403:
From b47756a572e1ebe5f11d8cc5d0dd9e878cf3d71f Mon Sep 17 00:00:00 2001
From: Antonio Varvara <115144160+varanto@users.noreply.github.com>
Date: Mon, 23 Jun 2025 13:14:28 +0200
Subject: [PATCH 06/11] Update iot-network-optimization.yaml
---
code/API_definitions/iot-network-optimization.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/API_definitions/iot-network-optimization.yaml b/code/API_definitions/iot-network-optimization.yaml
index d8b5dcd..3e2ac21 100644
--- a/code/API_definitions/iot-network-optimization.yaml
+++ b/code/API_definitions/iot-network-optimization.yaml
@@ -416,7 +416,7 @@ components:
description: Event details payload described in each CAMARA API and
referenced by its type
time:
- $ref: "#/components/schemas/DateTime"
+ $ref: "#/components/schemas/DateTime"
CloudEventPowerSaving:
description: provides back the power saving operation result.
From 8fdfa7091b7055a65262cd58d3606527859667c0 Mon Sep 17 00:00:00 2001
From: Antonio Varvara <115144160+varanto@users.noreply.github.com>
Date: Mon, 23 Jun 2025 14:45:55 +0200
Subject: [PATCH 07/11] Update iot-network-optimization.yaml
---
code/API_definitions/iot-network-optimization.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/API_definitions/iot-network-optimization.yaml b/code/API_definitions/iot-network-optimization.yaml
index 3e2ac21..aab2242 100644
--- a/code/API_definitions/iot-network-optimization.yaml
+++ b/code/API_definitions/iot-network-optimization.yaml
@@ -123,7 +123,7 @@ info:
x-camara-commonalities: 0.5
externalDocs:
description: Product documentation at Camara
- url: https://github.com/camaraproject/TBD
+ url: https://github.com/camaraproject/IoTNetworkOptimization
############################################################################
# Servers #
############################################################################
From 99979f983071f3f0635b75e4fcd8a887d5d860bb Mon Sep 17 00:00:00 2001
From: Antonio Varvara <115144160+varanto@users.noreply.github.com>
Date: Mon, 30 Jun 2025 09:55:41 +0200
Subject: [PATCH 08/11] Create iot-network-optimization-power-saving.feature
---
...-network-optimization-power-saving.feature | 57 +++++++++++++++++++
1 file changed, 57 insertions(+)
create mode 100644 code/Test_definitions/iot-network-optimization-power-saving.feature
diff --git a/code/Test_definitions/iot-network-optimization-power-saving.feature b/code/Test_definitions/iot-network-optimization-power-saving.feature
new file mode 100644
index 0000000..0b0fffe
--- /dev/null
+++ b/code/Test_definitions/iot-network-optimization-power-saving.feature
@@ -0,0 +1,57 @@
+Feature: CAMARA IoT Network Optimization API - Operation power-saving
+# Input to be provided by the implementation to the tester
+#
+# Implementation indications:
+#
+# Testing assets:
+# * One or more IoT devices whose power saving features could be set.
+#
+ Background: Common power-saving feature setup
+ Given the path "/features/power-saving"
+ And the header "Content-Type" is set to "application/json"
+ And the header "Authorization" is set to a valid access token
+ And the header "x-correlator" complies with the schema at "#/components/schemas/XCorrelator"
+ And the request body is set by default to a request body compliant with the schema
+
+ # Happy path scenarios
+
+ # This first scenario serves as a minimum
+ @power_saving_feature_01_generic_success_scenario_one_device
+ Scenario: Common validations for any success scenario, just one device identifier is provided
+ # Valid testing default request body compliant with the schema
+ Given the request body property "$.devices" carries one valid device which is compliant with the OAS schema at "/components/schemas/Device"
+ And "$.notificationSink" is set to a proper value
+ And the request body is set to a valid request body
+ When the HTTP "POST" request is sent
+ Then the response status code is 200
+ And the response header "Content-Type" is "application/json"
+ And the response header "x-correlator" has same value as the request header "x-correlator"
+ # The response has to comply with the generic response schema which is part of the spec
+ And the response body complies with the OAS schema at "/components/schemas/PowerSavingRequest"
+ And "$.transactionId" is set to a proper value
+ # The received callback must be compliant and should carry the aspected values
+ And within a limited period of time I should receive a callback at "/components/schemas/NotificationSink/sink"
+ And the callback body is compliant with the OAS schema at "/components/callbacks/onTransactionCompleted" with "x-correlator" having the same value as the request header "x-correlator"
+ And the callback carries the information defined in "/components/schemas/CloudEventPowerSaving"
+ And "/components/schemas/CloudEventPowerSaving" in the callback should contain the parameter "$.transactionId" with the same value as in the 200 response of "/features/power-saving"
+ And "/components/schemas/CloudEventPowerSaving" in the callback should contain the parameter"$.activationStatus" set to the expected value
+
+ @power_saving_feature_02_more_devices
+ Scenario: multiple devices identifiers are provided
+ Given the request body property "$.devices" carries an array of valid devices which are compliant with the OAS schema at "/components/schemas/Device"
+ And "$.notificationSink" is set to a proper value
+ And the request body is set to a valid request body
+ When the HTTP "POST" request is sent
+ Then the response status code is 200
+ And the response header "Content-Type" is "application/json"
+ And the response header "x-correlator" has same value as the request header "x-correlator"
+ # The response has to comply with the generic response schema which is part of the spec
+ And the response body complies with the OAS schema at "/components/schemas/PowerSavingResponse"
+ And "$.transactionId" is set to a proper value
+ # The received callback must be compliant and should carry the aspected values
+ And within a limited period of time I should receive a callback at "/components/schemas/NotificationSink/sink"
+ And the callback body is compliant with the OAS schema at "/components/callbacks/onTransactionCompleted" with "x-correlator" having the same value as the request header "x-correlator"
+ And the callback carries the information defined in "/components/schemas/CloudEventPowerSaving"
+ And "/components/schemas/CloudEventPowerSaving" in the callback should contain the parameter "$.transactionId" with the same value as in the 200 response of "/features/power-saving"
+ And "/components/schemas/CloudEventPowerSaving" in the callback should contain the parameter"$.activationStatus"
+ And the parameter"$.activationStatus" should be set to the expected value as a list of status, one for each device
From e817c68ebf1e7f21f9cbea9fec2e003989aafc33 Mon Sep 17 00:00:00 2001
From: Antonio Varvara <115144160+varanto@users.noreply.github.com>
Date: Tue, 1 Jul 2025 09:38:06 +0200
Subject: [PATCH 09/11] Update iot-network-optimization-power-saving.feature
---
...-network-optimization-power-saving.feature | 52 ++++++++++++++++---
1 file changed, 46 insertions(+), 6 deletions(-)
diff --git a/code/Test_definitions/iot-network-optimization-power-saving.feature b/code/Test_definitions/iot-network-optimization-power-saving.feature
index 0b0fffe..6e8ae77 100644
--- a/code/Test_definitions/iot-network-optimization-power-saving.feature
+++ b/code/Test_definitions/iot-network-optimization-power-saving.feature
@@ -20,10 +20,11 @@ Feature: CAMARA IoT Network Optimization API - Operation power-saving
Scenario: Common validations for any success scenario, just one device identifier is provided
# Valid testing default request body compliant with the schema
Given the request body property "$.devices" carries one valid device which is compliant with the OAS schema at "/components/schemas/Device"
+ And "$.enabled" is set to true
And "$.notificationSink" is set to a proper value
- And the request body is set to a valid request body
When the HTTP "POST" request is sent
- Then the response status code is 200
+ Then the power saving settings will be activated for all the devices specified
+ And the response status code is 200
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has same value as the request header "x-correlator"
# The response has to comply with the generic response schema which is part of the spec
@@ -34,15 +35,18 @@ Feature: CAMARA IoT Network Optimization API - Operation power-saving
And the callback body is compliant with the OAS schema at "/components/callbacks/onTransactionCompleted" with "x-correlator" having the same value as the request header "x-correlator"
And the callback carries the information defined in "/components/schemas/CloudEventPowerSaving"
And "/components/schemas/CloudEventPowerSaving" in the callback should contain the parameter "$.transactionId" with the same value as in the 200 response of "/features/power-saving"
- And "/components/schemas/CloudEventPowerSaving" in the callback should contain the parameter"$.activationStatus" set to the expected value
+ And "/components/schemas/CloudEventPowerSaving" in the callback should contain the parameter "$.activationStatus" set to the expected value
+ And each ("$.activationStatus[*].device") that used multiple identifiers in the request body, must return only the identifier used by the network
+ # This scenario uses only mandatory parameters specifying a list of devices
@power_saving_feature_02_more_devices
- Scenario: multiple devices identifiers are provided
+ Scenario: multiple devices identifiers are provided with just mandatory parameters
Given the request body property "$.devices" carries an array of valid devices which are compliant with the OAS schema at "/components/schemas/Device"
+ And "$.enabled" is set to true
And "$.notificationSink" is set to a proper value
- And the request body is set to a valid request body
When the HTTP "POST" request is sent
- Then the response status code is 200
+ Then the power saving settings will be activated for all the devices specified
+ And the response status code is 200
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has same value as the request header "x-correlator"
# The response has to comply with the generic response schema which is part of the spec
@@ -55,3 +59,39 @@ Feature: CAMARA IoT Network Optimization API - Operation power-saving
And "/components/schemas/CloudEventPowerSaving" in the callback should contain the parameter "$.transactionId" with the same value as in the 200 response of "/features/power-saving"
And "/components/schemas/CloudEventPowerSaving" in the callback should contain the parameter"$.activationStatus"
And the parameter"$.activationStatus" should be set to the expected value as a list of status, one for each device
+ And each ("$.activationStatus[*].device") that used multiple identifiers in the request body, must return only the identifier used by the network
+
+ # This scenario uses also optional parameters with a list of devices
+ @power_saving_feature_03_optional_parameters
+ Scenario: multiple devices identifiers are provided with also optional parameters
+ Given the request body property "$.devices" carries an array of valid devices which are compliant with the OAS schema at "/components/schemas/Device"
+ And "$.enabled" is set to true
+ And "$.notificationSink" is set to a proper value
+ And "$.timePeriod" is set to a proper value
+ When the HTTP "POST" request is sent
+ Then the power saving settings will be activated for all the devices specified and according to the parameters specified (e.g., just in the selected time period)
+ And the response status code is 200
+ And the response header "Content-Type" is "application/json"
+ And the response header "x-correlator" has same value as the request header "x-correlator"
+ # The response has to comply with the generic response schema which is part of the spec
+ And the response body complies with the OAS schema at "/components/schemas/PowerSavingResponse"
+ And "$.transactionId" is set to a proper value
+ # The received callback must be compliant and should carry the aspected values
+ And within a limited period of time I should receive a callback at "/components/schemas/NotificationSink/sink"
+ And the callback body is compliant with the OAS schema at "/components/callbacks/onTransactionCompleted" with "x-correlator" having the same value as the request header "x-correlator"
+ And the callback carries the information defined in "/components/schemas/CloudEventPowerSaving"
+ And "/components/schemas/CloudEventPowerSaving" in the callback should contain the parameter "$.transactionId" with the same value as in the 200 response of "/features/power-saving"
+ And "/components/schemas/CloudEventPowerSaving" in the callback should contain the parameter"$.activationStatus"
+ And the parameter"$.activationStatus" should be set to the expected value as a list of status, one for each device
+ And each ("$.activationStatus[*].device") that used multiple identifiers in the request body, must return only the identifier used by the network
+
+ # This scenario shows how GET API works
+ @power_saving_feature_04_get
+ Scenario: Read transaction status
+ Given the request path property with the parameter "$.transactionId" set as per the response of the previous POST
+ When the HTTP "GET" request is sent
+ Then the response status code is 200
+ And the response header "Content-Type" is "application/json"
+ And the response header "x-correlator" has same value as the request header "x-correlator"
+ # The response has to comply with the generic response schema which is part of the spec
+ And the response body complies with the OAS schema at "/components/schemas/PowerSavingResponse" reporting the current status of the power saving activation for each device
From d06e0b94f28825051d78b84856fb11c709a688f6 Mon Sep 17 00:00:00 2001
From: Antonio Varvara <115144160+varanto@users.noreply.github.com>
Date: Tue, 1 Jul 2025 09:38:53 +0200
Subject: [PATCH 10/11] Update iot-network-optimization-power-saving.feature
---
.../iot-network-optimization-power-saving.feature | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/code/Test_definitions/iot-network-optimization-power-saving.feature b/code/Test_definitions/iot-network-optimization-power-saving.feature
index 6e8ae77..da858a4 100644
--- a/code/Test_definitions/iot-network-optimization-power-saving.feature
+++ b/code/Test_definitions/iot-network-optimization-power-saving.feature
@@ -24,7 +24,7 @@ Feature: CAMARA IoT Network Optimization API - Operation power-saving
And "$.notificationSink" is set to a proper value
When the HTTP "POST" request is sent
Then the power saving settings will be activated for all the devices specified
- And the response status code is 200
+ And the response status code is 200
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has same value as the request header "x-correlator"
# The response has to comply with the generic response schema which is part of the spec
@@ -46,7 +46,7 @@ Feature: CAMARA IoT Network Optimization API - Operation power-saving
And "$.notificationSink" is set to a proper value
When the HTTP "POST" request is sent
Then the power saving settings will be activated for all the devices specified
- And the response status code is 200
+ And the response status code is 200
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has same value as the request header "x-correlator"
# The response has to comply with the generic response schema which is part of the spec
From 705894774403b506a29012d267c227aafd04cc51 Mon Sep 17 00:00:00 2001
From: FabrizioMoggio <87469955+FabrizioMoggio@users.noreply.github.com>
Date: Tue, 1 Jul 2025 10:14:13 +0200
Subject: [PATCH 11/11] Update iot-network-optimization-power-saving.feature
added version wip
---
.../iot-network-optimization-power-saving.feature | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/Test_definitions/iot-network-optimization-power-saving.feature b/code/Test_definitions/iot-network-optimization-power-saving.feature
index da858a4..ceb1066 100644
--- a/code/Test_definitions/iot-network-optimization-power-saving.feature
+++ b/code/Test_definitions/iot-network-optimization-power-saving.feature
@@ -1,4 +1,4 @@
-Feature: CAMARA IoT Network Optimization API - Operation power-saving
+Feature: CAMARA IoT Network Optimization API - vwip - Operation power-saving
# Input to be provided by the implementation to the tester
#
# Implementation indications: