From dc8bdc3154f721145f7b558d6eb02790c39fb37a Mon Sep 17 00:00:00 2001 From: Hubert Przybysz Date: Mon, 29 Sep 2025 17:39:42 +0200 Subject: [PATCH 1/2] Add new error when network in wrong state --- .../dedicated-network-accesses.yaml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/code/API_definitions/dedicated-network-accesses.yaml b/code/API_definitions/dedicated-network-accesses.yaml index 68e44ce..fe79303 100644 --- a/code/API_definitions/dedicated-network-accesses.yaml +++ b/code/API_definitions/dedicated-network-accesses.yaml @@ -52,6 +52,10 @@ info: which is needed to query the status of the Device Access (GET /accesses/{accessId}) and to delete Access (DELETE accesses/{accessId}). + ## Error handling: + + - If the dedicated network identified by the networkId is in a wrong state when creating a device access, e.g. it is in the TERMINATED state, then the server will return an error with the `409 WRONG_STATE` error code. + # Querying one or more device accesses All available device accesses of the API consumer can be queried by performing a `GET` operation on the `/accesses` endpoint. The query can be filted for accesses to a specific network (networkId) or for certain devices. @@ -160,6 +164,8 @@ paths: $ref: "#/components/responses/Generic403" "404": $ref: "#/components/responses/Generic404" + "409": + $ref: "#/components/responses/Generic409" "422": $ref: "#/components/responses/Generic422" @@ -529,6 +535,53 @@ components: code: IDENTIFIER_NOT_FOUND message: Device identifier not found. + Generic409: + description: Conflict + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + status: + enum: + - 409 + code: + enum: + - ABORTED + - ALREADY_EXISTS + - CONFLICT + - WRONG_STATE + examples: + GENERIC_409_ABORTED: + description: Concurreny of processes of the same nature/scope + value: + status: 409 + code: ABORTED + message: Concurrency conflict. + GENERIC_409_ALREADY_EXISTS: + description: Trying to create an existing resource + value: + status: 409 + code: ALREADY_EXISTS + message: The resource that a client tried to create already exists. + GENERIC_409_CONFLICT: + description: Duplication of an existing resource + value: + status: 409 + code: CONFLICT + message: A specified resource duplicate entry found. + GENERIC_409_WRONG_STATE: + description: A resource referenced in the request is in a wrong state for the requested operation + value: + status: 409 + code: WRONG_STATE + message: A referenced resource is in a wrong state. + Generic410: description: Gone headers: From d93ab6781028cbb0ca0e53487ad972abe2f54819 Mon Sep 17 00:00:00 2001 From: Hubert Przybysz Date: Thu, 27 Nov 2025 09:20:43 +0100 Subject: [PATCH 2/2] Change to INCOMPATIBLE_STATE --- code/API_definitions/dedicated-network-accesses.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/API_definitions/dedicated-network-accesses.yaml b/code/API_definitions/dedicated-network-accesses.yaml index fe79303..74aaa07 100644 --- a/code/API_definitions/dedicated-network-accesses.yaml +++ b/code/API_definitions/dedicated-network-accesses.yaml @@ -54,7 +54,7 @@ info: ## Error handling: - - If the dedicated network identified by the networkId is in a wrong state when creating a device access, e.g. it is in the TERMINATED state, then the server will return an error with the `409 WRONG_STATE` error code. + - If the dedicated network identified by the networkId is in an incompatible state when creating a device access, e.g. it is in the TERMINATED state, then the server will return an error with the `409 INCOMPATIBLE_STATE` error code. # Querying one or more device accesses @@ -555,7 +555,7 @@ components: - ABORTED - ALREADY_EXISTS - CONFLICT - - WRONG_STATE + - INCOMPATIBLE_STATE examples: GENERIC_409_ABORTED: description: Concurreny of processes of the same nature/scope @@ -575,12 +575,12 @@ components: status: 409 code: CONFLICT message: A specified resource duplicate entry found. - GENERIC_409_WRONG_STATE: - description: A resource referenced in the request is in a wrong state for the requested operation + GENERIC_409_INCOMPATIBLE_STATE: + description: A resource referenced in the request is in an incompatible state for the requested operation value: status: 409 - code: WRONG_STATE - message: A referenced resource is in a wrong state. + code: INCOMPATIBLE_STATE + message: A referenced resource is in an incompatible state. Generic410: description: Gone