diff --git a/rest-api/resources/src/main/resources/openapi/deviceAsset/deviceAsset-scopeId-deviceId-_write.yaml b/rest-api/resources/src/main/resources/openapi/deviceAsset/deviceAsset-scopeId-deviceId-_write.yaml index 7cd1bccbef2..face1e97045 100644 --- a/rest-api/resources/src/main/resources/openapi/deviceAsset/deviceAsset-scopeId-deviceId-_write.yaml +++ b/rest-api/resources/src/main/resources/openapi/deviceAsset/deviceAsset-scopeId-deviceId-_write.yaml @@ -80,5 +80,7 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' diff --git a/rest-api/resources/src/main/resources/openapi/deviceAsset/deviceAsset-scopeId-deviceId.yaml b/rest-api/resources/src/main/resources/openapi/deviceAsset/deviceAsset-scopeId-deviceId.yaml index 3614142f48f..075bcf6256c 100644 --- a/rest-api/resources/src/main/resources/openapi/deviceAsset/deviceAsset-scopeId-deviceId.yaml +++ b/rest-api/resources/src/main/resources/openapi/deviceAsset/deviceAsset-scopeId-deviceId.yaml @@ -37,6 +37,8 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' post: diff --git a/rest-api/resources/src/main/resources/openapi/deviceBundle/deviceBundle-scopeId-deviceId-_start.yaml b/rest-api/resources/src/main/resources/openapi/deviceBundle/deviceBundle-scopeId-deviceId-_start.yaml index 36743c2e1d4..60deb8801f6 100644 --- a/rest-api/resources/src/main/resources/openapi/deviceBundle/deviceBundle-scopeId-deviceId-_start.yaml +++ b/rest-api/resources/src/main/resources/openapi/deviceBundle/deviceBundle-scopeId-deviceId-_start.yaml @@ -34,5 +34,7 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' diff --git a/rest-api/resources/src/main/resources/openapi/deviceBundle/deviceBundle-scopeId-deviceId-_stop.yaml b/rest-api/resources/src/main/resources/openapi/deviceBundle/deviceBundle-scopeId-deviceId-_stop.yaml index c857613e39f..af72f4524cc 100644 --- a/rest-api/resources/src/main/resources/openapi/deviceBundle/deviceBundle-scopeId-deviceId-_stop.yaml +++ b/rest-api/resources/src/main/resources/openapi/deviceBundle/deviceBundle-scopeId-deviceId-_stop.yaml @@ -34,5 +34,7 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' diff --git a/rest-api/resources/src/main/resources/openapi/deviceBundle/deviceBundle-scopeId-deviceId.yaml b/rest-api/resources/src/main/resources/openapi/deviceBundle/deviceBundle-scopeId-deviceId.yaml index b5a3a458af6..ac0b099240e 100644 --- a/rest-api/resources/src/main/resources/openapi/deviceBundle/deviceBundle-scopeId-deviceId.yaml +++ b/rest-api/resources/src/main/resources/openapi/deviceBundle/deviceBundle-scopeId-deviceId.yaml @@ -39,5 +39,7 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' diff --git a/rest-api/resources/src/main/resources/openapi/deviceCommand/deviceCommand-scopeId-deviceId-_execute.yaml b/rest-api/resources/src/main/resources/openapi/deviceCommand/deviceCommand-scopeId-deviceId-_execute.yaml index 22e2455aaf8..799695b6b70 100644 --- a/rest-api/resources/src/main/resources/openapi/deviceCommand/deviceCommand-scopeId-deviceId-_execute.yaml +++ b/rest-api/resources/src/main/resources/openapi/deviceCommand/deviceCommand-scopeId-deviceId-_execute.yaml @@ -62,5 +62,7 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' diff --git a/rest-api/resources/src/main/resources/openapi/deviceConfiguration/deviceConfiguration-scopeId-deviceId-componentId.yaml b/rest-api/resources/src/main/resources/openapi/deviceConfiguration/deviceConfiguration-scopeId-deviceId-componentId.yaml index b0f402aa9a4..d38057e0fcd 100644 --- a/rest-api/resources/src/main/resources/openapi/deviceConfiguration/deviceConfiguration-scopeId-deviceId-componentId.yaml +++ b/rest-api/resources/src/main/resources/openapi/deviceConfiguration/deviceConfiguration-scopeId-deviceId-componentId.yaml @@ -73,5 +73,7 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' diff --git a/rest-api/resources/src/main/resources/openapi/deviceConfiguration/deviceConfiguration-scopeId-deviceId.yaml b/rest-api/resources/src/main/resources/openapi/deviceConfiguration/deviceConfiguration-scopeId-deviceId.yaml index 5ae8227ca6a..284eea17a19 100644 --- a/rest-api/resources/src/main/resources/openapi/deviceConfiguration/deviceConfiguration-scopeId-deviceId.yaml +++ b/rest-api/resources/src/main/resources/openapi/deviceConfiguration/deviceConfiguration-scopeId-deviceId.yaml @@ -71,5 +71,7 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' diff --git a/rest-api/resources/src/main/resources/openapi/deviceInventory/deviceInventory-scopeId-deviceId.yaml b/rest-api/resources/src/main/resources/openapi/deviceInventory/deviceInventory-scopeId-deviceId.yaml index 0913029911a..11079dbef7b 100644 --- a/rest-api/resources/src/main/resources/openapi/deviceInventory/deviceInventory-scopeId-deviceId.yaml +++ b/rest-api/resources/src/main/resources/openapi/deviceInventory/deviceInventory-scopeId-deviceId.yaml @@ -257,5 +257,7 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' diff --git a/rest-api/resources/src/main/resources/openapi/deviceKeystore/deviceKeystore-scopeId-deviceId.yaml b/rest-api/resources/src/main/resources/openapi/deviceKeystore/deviceKeystore-scopeId-deviceId.yaml index b0e398a1a4c..2588a34a503 100644 --- a/rest-api/resources/src/main/resources/openapi/deviceKeystore/deviceKeystore-scopeId-deviceId.yaml +++ b/rest-api/resources/src/main/resources/openapi/deviceKeystore/deviceKeystore-scopeId-deviceId.yaml @@ -37,6 +37,8 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' /{scopeId}/devices/{deviceId}/keystore/items: @@ -74,6 +76,8 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' /{scopeId}/devices/{deviceId}/keystore/item: @@ -113,6 +117,8 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' delete: @@ -147,6 +153,8 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' /{scopeId}/devices/{deviceId}/keystore/items/certificateInfo: @@ -175,6 +183,8 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' /{scopeId}/devices/{deviceId}/keystore/items/certificateRaw: @@ -203,6 +213,8 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' /{scopeId}/devices/{deviceId}/keystore/items/keypair: @@ -231,6 +243,8 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' /{scopeId}/devices/{deviceId}/keystore/items/csr: @@ -263,5 +277,7 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' diff --git a/rest-api/resources/src/main/resources/openapi/deviceOperation/deviceOperation-scopeId-deviceId.yaml b/rest-api/resources/src/main/resources/openapi/deviceOperation/deviceOperation-scopeId-deviceId.yaml index 9be2005488d..02ebb6b6383 100644 --- a/rest-api/resources/src/main/resources/openapi/deviceOperation/deviceOperation-scopeId-deviceId.yaml +++ b/rest-api/resources/src/main/resources/openapi/deviceOperation/deviceOperation-scopeId-deviceId.yaml @@ -41,7 +41,5 @@ paths: $ref: '../openapi.yaml#/components/responses/unauthenticated' 403: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' - 409: - $ref: '../openapi.yaml#/components/responses/entityUniqueness' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' diff --git a/rest-api/resources/src/main/resources/openapi/devicePackage/devicePackage-scopeId-deviceId-_download.yaml b/rest-api/resources/src/main/resources/openapi/devicePackage/devicePackage-scopeId-deviceId-_download.yaml index 1d8fa19627f..9e7e58a0e08 100644 --- a/rest-api/resources/src/main/resources/openapi/devicePackage/devicePackage-scopeId-deviceId-_download.yaml +++ b/rest-api/resources/src/main/resources/openapi/devicePackage/devicePackage-scopeId-deviceId-_download.yaml @@ -77,5 +77,7 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' diff --git a/rest-api/resources/src/main/resources/openapi/devicePackage/devicePackage-scopeId-deviceId-_uninstall.yaml b/rest-api/resources/src/main/resources/openapi/devicePackage/devicePackage-scopeId-deviceId-_uninstall.yaml index 1ff65cf3b55..6f336387171 100644 --- a/rest-api/resources/src/main/resources/openapi/devicePackage/devicePackage-scopeId-deviceId-_uninstall.yaml +++ b/rest-api/resources/src/main/resources/openapi/devicePackage/devicePackage-scopeId-deviceId-_uninstall.yaml @@ -62,5 +62,7 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' diff --git a/rest-api/resources/src/main/resources/openapi/devicePackage/devicePackage-scopeId-deviceId.yaml b/rest-api/resources/src/main/resources/openapi/devicePackage/devicePackage-scopeId-deviceId.yaml index 6c18ad21cbe..407beff1241 100644 --- a/rest-api/resources/src/main/resources/openapi/devicePackage/devicePackage-scopeId-deviceId.yaml +++ b/rest-api/resources/src/main/resources/openapi/devicePackage/devicePackage-scopeId-deviceId.yaml @@ -37,5 +37,7 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' diff --git a/rest-api/resources/src/main/resources/openapi/deviceRequest/deviceRequest-scopeId-deviceId.yaml b/rest-api/resources/src/main/resources/openapi/deviceRequest/deviceRequest-scopeId-deviceId.yaml index 944e173ee44..70fd3e4090c 100644 --- a/rest-api/resources/src/main/resources/openapi/deviceRequest/deviceRequest-scopeId-deviceId.yaml +++ b/rest-api/resources/src/main/resources/openapi/deviceRequest/deviceRequest-scopeId-deviceId.yaml @@ -43,5 +43,7 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' diff --git a/rest-api/resources/src/main/resources/openapi/deviceSnapshot/deviceSnapshot-scopeId-deviceId-snapshotId-_rollback.yaml b/rest-api/resources/src/main/resources/openapi/deviceSnapshot/deviceSnapshot-scopeId-deviceId-snapshotId-_rollback.yaml index 7f169c9cf00..05e4466461a 100644 --- a/rest-api/resources/src/main/resources/openapi/deviceSnapshot/deviceSnapshot-scopeId-deviceId-snapshotId-_rollback.yaml +++ b/rest-api/resources/src/main/resources/openapi/deviceSnapshot/deviceSnapshot-scopeId-deviceId-snapshotId-_rollback.yaml @@ -34,5 +34,7 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' diff --git a/rest-api/resources/src/main/resources/openapi/deviceSnapshot/deviceSnapshot-scopeId-deviceId-snapshotId.yaml b/rest-api/resources/src/main/resources/openapi/deviceSnapshot/deviceSnapshot-scopeId-deviceId-snapshotId.yaml index 450894f48ca..4fd2ee9b59c 100644 --- a/rest-api/resources/src/main/resources/openapi/deviceSnapshot/deviceSnapshot-scopeId-deviceId-snapshotId.yaml +++ b/rest-api/resources/src/main/resources/openapi/deviceSnapshot/deviceSnapshot-scopeId-deviceId-snapshotId.yaml @@ -41,5 +41,7 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' diff --git a/rest-api/resources/src/main/resources/openapi/deviceSnapshot/deviceSnapshot-scopeId-deviceId.yaml b/rest-api/resources/src/main/resources/openapi/deviceSnapshot/deviceSnapshot-scopeId-deviceId.yaml index 151cb34adfc..3b538a8238c 100644 --- a/rest-api/resources/src/main/resources/openapi/deviceSnapshot/deviceSnapshot-scopeId-deviceId.yaml +++ b/rest-api/resources/src/main/resources/openapi/deviceSnapshot/deviceSnapshot-scopeId-deviceId.yaml @@ -40,5 +40,7 @@ paths: $ref: '../openapi.yaml#/components/responses/subjectUnauthorized' 404: $ref: '../openapi.yaml#/components/responses/entityNotFound' + 409: + $ref: '../openapi.yaml#/components/responses/conflictDeviceNotConnected' 500: $ref: '../openapi.yaml#/components/responses/kapuaError' diff --git a/rest-api/resources/src/main/resources/openapi/openapi.yaml b/rest-api/resources/src/main/resources/openapi/openapi.yaml index 437573b7a0c..cc4b14150a3 100644 --- a/rest-api/resources/src/main/resources/openapi/openapi.yaml +++ b/rest-api/resources/src/main/resources/openapi/openapi.yaml @@ -804,6 +804,20 @@ components: httpErrorCode: 403 message: "This operation can be performed only on the current logged User." kapuaErrorCode: "SELF_MANAGED_ONLY" + DeviceNotConnectedExceptionInfo: + description: The device is currently disconnected + allOf: + - $ref: '#/components/schemas/exceptionInfo' + - properties: + deviceId: + description: The id of the disconnected device + $ref: '#/components/schemas/kapuaId' + example: + type: "deviceNotConnectedExceptionInfo" + httpErrorCode: 409 + message: "The device 3243535747637285611 is not CONNECTED. Current device connection status is: null" + kapuaErrorCode: "DEVICE_NOT_CONNECTED" + deviceId: "LQNak9Yzkus" ### Other Base Entities ### kapuaListResult: description: A container for all the Entities List @@ -1294,6 +1308,15 @@ components: application/xml: schema: $ref: '#/components/schemas/entityUniquenessExceptionInfo' + conflictDeviceNotConnected: #409 response - device not connected + description: A conflict in the request - the device is disconnected and the request cannot be accomplished + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceNotConnectedExceptionInfo' + application/xml: + schema: + $ref: '#/components/schemas/DeviceNotConnectedExceptionInfo' # Security schemes securitySchemes: kapuaToken: