Interface EnvironmentReservationApi

  • All Superinterfaces:
    ApiService

    @Path("/api/v1/environments/reservations")
    @Consumes("application/json")
    @Produces("application/json")
    public interface EnvironmentReservationApi
    extends ApiService
    • Method Detail

      • serviceName

        default java.lang.String serviceName()
        Specified by:
        serviceName in interface ApiService
      • getReservation

        @GET
        @Path("/{environmentReservationId:.*/EnvironmentReservation[^/]*}")
        EnvironmentReservationView getReservation​(@PathParam("environmentReservationId")
                                                  java.lang.String environmentReservationId)
      • updateReservation

        @PUT
        @Path("/{environmentReservationId:.*/EnvironmentReservation[^/]*}")
        EnvironmentReservationView updateReservation​(@PathParam("environmentReservationId")
                                                     java.lang.String environmentReservationId,
                                                     EnvironmentReservationForm environmentReservationForm)
      • delete

        @DELETE
        @Path("/{environmentReservationId:.*/EnvironmentReservation[^/]*}")
        void delete​(@PathParam("environmentReservationId")
                    java.lang.String environmentReservationId)
        Deletes an environment reservation.
        Parameters:
        environmentReservationId - the environment reservation identifier
      • addApplication

        @POST
        @Path("/{environmentReservationId:.*/EnvironmentReservation[^/]*}")
        void addApplication​(@PathParam("environmentReservationId")
                            java.lang.String environmentReservationId,
                            @QueryParam("applicationId")
                            java.lang.String applicationId)
        Adds an application to an environment reservation.
        Parameters:
        environmentReservationId - the environment reservation identifier
        applicationId - the application identifier
      • create

        EnvironmentReservation create​(EnvironmentReservation environmentReservation)
        Creates a new environment reservation.
        Parameters:
        environmentReservation - an EnvironmentReservation object describing the new environment reservation
        Returns:
        created EnvironmentReservation object
      • getById

        EnvironmentReservation getById​(java.lang.String environmentReservationId)
        Gets an environment reservation by id.
        Parameters:
        environmentReservationId - the environment reservation identifier
        Returns:
        found EnvironmentReservation object
      • update

        EnvironmentReservation update​(EnvironmentReservation environmentReservation)
        Updates an existing environment reservation.
        Parameters:
        environmentReservation - an EnvironmentReservation object describing the new properties of the environment reservation
        Returns:
        updated EnvironmentReservation object
      • search

        java.util.Map<java.lang.String,​java.util.List<EnvironmentReservation>> search​(ReservationFilters filters)
        Searches environment reservations by filters.
        Parameters:
        filters - an EnvironmentReservationFilters object describing the search criteria
        Returns:
        map of matching EnvironmentReservation lists grouped by environment IDs
      • hasReservation

        boolean hasReservation​(java.lang.String environmentId,
                               java.lang.String applicationId)
        Checks if given application has a reservation on a given environment at the current time.
        Parameters:
        environmentId - the environment identifier
        applicationId - the application identifier
        Returns:
        true if a reservation exists
      • nearestComingReservation

        java.util.Date nearestComingReservation​(java.lang.String environmentId,
                                                java.lang.String applicationId)
        Checks if given application has a reservation on a given environment at the current time or in the future.
        Parameters:
        environmentId - the environment identifier
        applicationId - 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