/upi
- URL:
/upi/avion
- Method:
POST
- Description: Creates a new flight.
- Request Body:
{ "forigin": "String", "flayover": "String", "fdestination": "String", "fdistance": "Double", "ffuel": "Double", "fcraft": "String", "fintime": "String", "fouttime": "String" }
- Response:
- Status Code:
200 OK
- Body:
"Flight Job Created"
- Status Code:
- URL:
/upi/avion/all
- Method:
GET
- Description: Retrieves all flights.
- Response:
- Status Code:
200 OK
if flights are found,404 Not Found
if no flights are found. - Body:
[ { "id": "Long", "forigin": "String", "flayover": "String", "fdestination": "String", "fdistance": "Double", "ffuel": "Double", "fcraft": "String", "fintime": "String", "fouttime": "String" } ]
- Status Code:
- URL:
/upi/avion/destination
- Method:
GET
- Description: Retrieves flights by destination.
- Query Parameter:
fdestination
(String) - The destination to search for flights. - Response:
- Status Code:
200 OK
if flights are found,404 Not Found
if no flights are found. - Body:
[ { "id": "Long", "forigin": "String", "flayover": "String", "fdestination": "String", "fdistance": "Double", "ffuel": "Double", "fcraft": "String", "fintime": "String", "fouttime": "String" } ]
- Status Code:
- URL:
/upi/avion/{fid}
- Method:
PUT
- Description: Updates an existing flight by ID.
- Path Parameter:
fid
(Long) - The ID of the flight to update. - Request Body:
{ "forigin": "String", "flayover": "String", "fdestination": "String", "fdistance": "Double", "ffuel": "Double", "fcraft": "String", "fintime": "String", "fouttime": "String" }
- Response:
- Status Code:
200 OK
if the flight is successfully updated,404 Not Found
if the flight is not found. - Body:
"Flight updated successfully"
or"Flight not found"
- Status Code:
- URL:
/upi/avion/{fid}
- Method:
DELETE
- Description: Deletes a flight by ID.
- Path Parameter:
fid
(Long) - The ID of the flight to delete. - Response:
- Status Code:
200 OK
if the flight is successfully deleted,404 Not Found
if the flight is not found. - Body:
"Flight deleted successfully"
or"Flight not found"
- Status Code:
curl -X POST "http://localhost:8080/upi/avion" -H "Content-Type: application/json" -d '{
"forigin": "New York",
"flayover": "London",
"fdestination": "Paris",
"fdistance": 5837.0,
"ffuel": 2500.0,
"fcraft": "Boeing 747",
"fintime": "10:00",
"fouttime": "14:00"
}'
curl -X GET "http://localhost:8080/upi/avion/all"
curl -X GET "http://localhost:8080/upi/avion/destination?fdestination=Paris"
curl -X PUT "http://localhost:8080/upi/avion/1" -H "Content-Type: application/json" -d '{
"forigin": "Los Angeles",
"flayover": "Chicago",
"fdestination": "Tokyo",
"fdistance": 8700.0,
"ffuel": 3000.0,
"fcraft": "Airbus A380",
"fintime": "15:00",
"fouttime": "20:00"
}'
curl -X DELETE "http://localhost:8080/upi/avion/1"