diff --git a/code/API_definitions/qod-api.yaml b/code/API_definitions/qod-api.yaml index 913031aa46..b0b31b0136 100644 --- a/code/API_definitions/qod-api.yaml +++ b/code/API_definitions/qod-api.yaml @@ -50,46 +50,53 @@ paths: schema: $ref: "#/components/schemas/SessionInfo" "400": - description: Invalid input + description: Invalid input for createSession operation content: application/json: schema: - $ref: "#/components/schemas/ErrorInfo" + $ref: "#/components/schemas/Error400" examples: Generic400: summary: Schema validation failed - value: - code: INVALID_INPUT + value: + status: 400 + code: INVALID_ARGUMENT message: "Schema validation failed at ..." MsisdnRequired: summary: msisdn is required as part of ueId - value: - code: INVALID_INPUT + value: + status: 400 + code: INVALID_ARGUMENT message: "Expected property is missing: ueId.msisdn" IPv4Required: summary: ipv4addr is required as part of ueId - value: - code: INVALID_INPUT + value: + status: 400 + code: INVALID_ARGUMENT message: "Expected property is missing: ueId.ipv4addr" IPRequired: summary: Some IP address is required as part of ueId - value: - code: INVALID_INPUT + value: + status: 400 + code: INVALID_ARGUMENT message: "Expected property is missing: ueId.ipv4addr or ueId.ipv6addr" UePortsRequired: summary: uePorts is required - value: - code: INVALID_INPUT + value: + status: 400 + code: INVALID_ARGUMENT message: "Expected property is missing: uePorts" QoSRequired: summary: qos is required - value: - code: INVALID_INPUT + value: + status: 400 + code: INVALID_ARGUMENT message: "Expected property is missing: qos" UePortsRangesNotAllowed: summary: Ranges at uePorts are not allowed - value: - code: INVALID_INPUT + value: + status: 400 + code: INVALID_ARGUMENT message: "Ranges not allowed: uePorts" "401": $ref: "#/components/responses/Generic401" @@ -100,19 +107,13 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ErrorInfo" + $ref: "#/components/schemas/Error409" example: + status: 409 code: CONFLICT message: "Another session is created for the same UE" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorInfo" - example: - code: INTERNAL - message: "Session could not be created" + $ref: "#/components/responses/Generic500" "503": $ref: "#/components/responses/Generic503" /sessions/{sessionId}: @@ -142,14 +143,7 @@ paths: "404": $ref: "#/components/responses/SessionNotFound404" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorInfo" - example: - code: INTERNAL - message: "Could not get session information" + $ref: "#/components/responses/Generic500" "503": $ref: "#/components/responses/Generic503" delete: @@ -174,14 +168,7 @@ paths: "404": $ref: "#/components/responses/SessionNotFound404" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorInfo" - example: - code: INTERNAL - message: "Session could not be deleted" + $ref: "#/components/responses/Generic500" "503": $ref: "#/components/responses/Generic503" /notifications: @@ -210,14 +197,7 @@ paths: "403": $ref: "#/components/responses/Generic403" "500": - description: Server error - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorInfo" - example: - code: INTERNAL - message: "Failed to handle notification" + $ref: "#/components/responses/Generic500" "503": $ref: "#/components/responses/Generic503" security: @@ -410,18 +390,6 @@ components: enum: - QOS_STATUS_CHANGED - ErrorInfo: - type: object - required: - - code - - message - properties: - code: - type: string - description: Code given to this error - message: - type: string - description: Detailed error description UeId: type: object minProperties: 1 @@ -490,61 +458,199 @@ components: required: - severity - description - - QosStatus: - type: string - enum: - - REQUESTED - - AVAILABLE - - UNAVAILABLE - description: | - * `REQUESTED` - QoS has been requested by creating a session - * `AVAILABLE` - The requested QoS has been provided by the network - * `UNAVAILABLE` - The requested QoS cannot be provided by the network due to some reason - + ErrorInfo: + 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 + Error400: + type: object + required: + - status + - code + - message + properties: + status: + type: integer + enum: + - 400 + code: + type: string + enum: + - INVALID_ARGUMENT + message: + type: string + Error401: + type: object + required: + - status + - code + - message + properties: + status: + type: integer + enum: + - 401 + code: + type: string + enum: + - UNAUTHENTICATED + message: + type: string + Error403: + type: object + required: + - status + - code + - message + properties: + status: + type: integer + enum: + - 403 + code: + type: string + enum: + - PERMISSION_DENIED + message: + type: string + Error404: + type: object + required: + - status + - code + - message + properties: + status: + type: integer + enum: + - 404 + code: + type: string + enum: + - NOT_FOUND + message: + type: string + Error409: + type: object + required: + - status + - code + - message + properties: + status: + type: integer + enum: + - 409 + code: + type: string + enum: + - CONFLICT + message: + type: string + Error500: + type: object + required: + - status + - code + - message + properties: + status: + type: integer + enum: + - 500 + code: + type: string + enum: + - INTERNAL + message: + type: string + Error503: + type: object + required: + - status + - code + - message + properties: + status: + type: integer + enum: + - 503 + code: + type: string + enum: + - UNAVAILABLE + message: + type: string responses: Generic400: description: Invalid input content: application/json: schema: - $ref: "#/components/schemas/ErrorInfo" + $ref: "#/components/schemas/Error400" example: - code: INVALID_INPUT + status: 400 + code: INVALID_ARGUMENT message: "Schema validation failed at ..." Generic401: description: Unauthorized content: application/json: schema: - $ref: "#/components/schemas/ErrorInfo" + $ref: "#/components/schemas/Error401" example: - code: UNAUTHORIZED + status: 401 + code: UNAUTHENTICATED message: "Authorization failed: ..." Generic403: description: Forbidden content: application/json: schema: - $ref: "#/components/schemas/ErrorInfo" + $ref: "#/components/schemas/Error403" example: - code: FORBIDDEN + status: 403 + code: PERMISSION_DENIED message: "Operation not allowed: ..." SessionNotFound404: description: Session not found content: application/json: schema: - $ref: "#/components/schemas/ErrorInfo" + $ref: "#/components/schemas/Error404" example: + status: 404 code: NOT_FOUND message: "Session Id does not exist" + Generic500: + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error500" + example: + status: 500 + code: INTERNAL + message: "Internal server error: ..." Generic503: description: Service unavailable content: application/json: schema: - $ref: "#/components/schemas/ErrorInfo" + $ref: "#/components/schemas/Error503" example: - code: SERVICE_UNAVAILABLE + status: 503 + code: UNAVAILABLE message: "Service unavailable"