Package com.xebialabs.xlrelease.api.v1
Interface EnvironmentReservationApi
- All Superinterfaces:
ApiService
@Path("/api/v1/environments/reservations")
@Consumes("application/json")
@Produces("application/json")
public interface EnvironmentReservationApi
extends ApiService
-
Field Summary
Fields inherited from interface com.xebialabs.xlrelease.api.ApiService
DEFAULT_RESULTS_PER_PAGE, DEFAULT_RESULTS_PER_PAGE_STRING, DEPTH, ORDER_BY, PAGE, PAGE_IS_OFFSET, RESULTS_PER_PAGE, ROLE_IDS_DATA
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addApplication
(String environmentReservationId, String applicationId) Adds an application to an environment reservation.create
(EnvironmentReservation environmentReservation) Creates a new environment reservation.createReservation
(EnvironmentReservationForm environmentReservationForm) void
Deletes an environment reservation.Gets an environment reservation by id.getReservation
(String environmentReservationId) boolean
hasReservation
(String environmentId, String applicationId) Checks if given application has a reservation on a given environment at the current time.nearestComingReservation
(String environmentId, String applicationId) Checks if given application has a reservation on a given environment at the current time or in the future.search
(ReservationFilters filters) Searches environment reservations by filters.searchReservations
(ReservationFilters filters) default String
update
(EnvironmentReservation environmentReservation) Updates an existing environment reservation.updateReservation
(String environmentReservationId, EnvironmentReservationForm environmentReservationForm)
-
Method Details
-
serviceName
- Specified by:
serviceName
in interfaceApiService
-
createReservation
@POST EnvironmentReservationView createReservation(EnvironmentReservationForm environmentReservationForm) -
getReservation
@GET @Path("/{environmentReservationId:.*/EnvironmentReservation[^/]*}") EnvironmentReservationView getReservation(@PathParam("environmentReservationId") String environmentReservationId) -
updateReservation
@PUT @Path("/{environmentReservationId:.*/EnvironmentReservation[^/]*}") EnvironmentReservationView updateReservation(@PathParam("environmentReservationId") String environmentReservationId, EnvironmentReservationForm environmentReservationForm) -
searchReservations
@POST @Path("/search") List<EnvironmentReservationSearchView> searchReservations(ReservationFilters filters) -
delete
@DELETE @Path("/{environmentReservationId:.*/EnvironmentReservation[^/]*}") void delete(@PathParam("environmentReservationId") String environmentReservationId) Deletes an environment reservation.- Parameters:
environmentReservationId
- the environment reservation identifier
-
addApplication
@POST @Path("/{environmentReservationId:.*/EnvironmentReservation[^/]*}") void addApplication(@PathParam("environmentReservationId") String environmentReservationId, @QueryParam("applicationId") String applicationId) Adds an application to an environment reservation.- Parameters:
environmentReservationId
- the environment reservation identifierapplicationId
- the application identifier
-
create
Creates a new environment reservation.- Parameters:
environmentReservation
- anEnvironmentReservation
object describing the new environment reservation- Returns:
- created
EnvironmentReservation
object
-
getById
Gets an environment reservation by id.- Parameters:
environmentReservationId
- the environment reservation identifier- Returns:
- found
EnvironmentReservation
object
-
update
Updates an existing environment reservation.- Parameters:
environmentReservation
- anEnvironmentReservation
object describing the new properties of the environment reservation- Returns:
- updated
EnvironmentReservation
object
-
search
Searches environment reservations by filters.- Parameters:
filters
- anEnvironmentReservationFilters
object describing the search criteria- Returns:
- map of matching
EnvironmentReservation
lists grouped by environment IDs
-
hasReservation
Checks if given application has a reservation on a given environment at the current time.- Parameters:
environmentId
- the environment identifierapplicationId
- the application identifier- Returns:
- true if a reservation exists
-
nearestComingReservation
Checks if given application has a reservation on a given environment at the current time or in the future.- Parameters:
environmentId
- the environment identifierapplicationId
- the application identifier- Returns:
- Date of reservation start time. If reservation exists at the current time, then returned date will be less than or equal to now. If future reservation is found, then returned date will be start date of nearest future reservation If neither current nor future reservation found, return value is null
-