Interface IServer


@Path("/servers/{containerUid}") public interface IServer
API for managing the servers in a BlueMind installation. Server is the equivalent of Host in core_v1. Server are items living in an installation Container. The uid of the container is determined using the /etc/bm/mcast.id on your bluemind installation.
  • Method Details

    • create

      @PUT @Path("{uid}") TaskRef create(@PathParam("uid") String uid, Server srv) throws ServerFault
      Creates a new server in the database with the given uid. IServerHook implementations are invoked.
      Parameters:
      uid -
      srv -
      Throws:
      ServerFault
    • update

      @POST @Path("{uid}") TaskRef update(@PathParam("uid") String uid, Server srv) throws ServerFault
      Updates a server in the database with its uid. IServerHook implementations are invoked.
      Parameters:
      uid -
      srv -
      Throws:
      ServerFault
    • getComplete

      @GET @Path("{uid}/complete") ItemValue<Server> getComplete(@PathParam("uid") String uid) throws ServerFault
      Fetches a server object from the database with its uid.
      Parameters:
      uid -
      Returns:
      Throws:
      ServerFault
    • delete

      @DELETE @Path("{uid}") void delete(@PathParam("uid") String uid) throws ServerFault
      Deletes a server object in the database with its uid.
      Parameters:
      uid -
      Throws:
      ServerFault
    • allComplete

      @GET @Path("_complete") List<ItemValue<Server>> allComplete() throws ServerFault
      Enumerate all the servers in the installation container.
      Returns:
      Throws:
      ServerFault
    • submit

      @POST @Path("{uid}/submit_command") String submit(@PathParam("uid") String uid, String... argv) throws ServerFault
      Executes a command using bm-node on the server with the given uid. Returns a reference to the running command that must be used in subsequent getStatus calls.
      Parameters:
      uid -
      command -
      Returns:
      Throws:
      ServerFault
    • submitAndWait

      @POST @Path("{uid}/submit_command_and_wait") CommandStatus submitAndWait(@PathParam("uid") String uid, String... argv) throws ServerFault
      Executes a command using bm-node on the server with the given uid. Returns command execution output and exit code (CommandStatus).
      Parameters:
      uid -
      command -
      Returns:
      Throws:
      ServerFault
    • getStatus

      @GET @Path("{uid}/command_status") CommandStatus getStatus(@PathParam("uid") String uid, @QueryParam("ref") String commandRef) throws ServerFault
      Fetches the progress of a command running in bm-node
      Parameters:
      uid -
      commandRef -
      Returns:
      Throws:
      ServerFault
    • readFile

      @GET @Path("{uid}/fs/{path}") byte[] readFile(@PathParam("uid") String uid, @PathParam("path") String path) throws ServerFault
      Uses bm-node to read a file on a Server with its uid.
      Parameters:
      uid - the server uid
      path - the absolute filename to read
      Returns:
      the bytes in the file
      Throws:
      ServerFault
    • writeFile

      @PUT @Path("{uid}/fs/{path}") void writeFile(@PathParam("uid") String uid, @PathParam("path") String path, byte[] content) throws ServerFault
      Uses bm-node to write a file on a Server with its uid.
      Parameters:
      uid - the server uid
      path - the absolute filename to write
      content -
      Throws:
      ServerFault
    • assign

      @POST @Path("{domainUid}/assignments/{serverUid}/_assign") void assign(@PathParam("serverUid") String serverUid, @PathParam("domainUid") String domainUid, @QueryParam("tag") String tag) throws ServerFault
      Assigns a Server's tag to a domain. For example, when you assign your mail/imap Server to a domain blue-mind.net a mail partition will be created to hold this domain data. This method stores the newly made assignment in the database and IServerHook implementations will do all the system work.
      Parameters:
      serverUid -
      domainUid -
      tag -
      Throws:
      ServerFault
    • unassign

      @POST @Path("{domainUid}/assignments/{serverUid}/_unassign") void unassign(@PathParam("serverUid") String serverUid, @PathParam("domainUid") String domainUid, @QueryParam("tag") String tag) throws ServerFault
      Undo what assign does.
      Parameters:
      serverUid -
      domainUid -
      tag -
      Throws:
      ServerFault
    • getAssignments

      @GET @Path("{domainUid}/assignments") List<Assignment> getAssignments(@PathParam("domainUid") String domainUid) throws ServerFault
      Fetches all the server assignments in a domain container
      Parameters:
      domainUid -
      Returns:
      Throws:
      ServerFault
    • byAssignment

      @GET @Path("{domainUid}/byAssignment") List<String> byAssignment(@PathParam("domainUid") String domainUid, @QueryParam("tag") String tag) throws ServerFault
      Fetches all the servers in a domain container by its assignment
      Parameters:
      domainUid -
      assignment -
      Returns:
      Throws:
      ServerFault
    • setTags

      @POST @Path("{uid}/tags") TaskRef setTags(@PathParam("uid") String uid, List<String> tags) throws ServerFault
      tags server and return ref to Task (ITask
      Parameters:
      uid -
      tags -
      Returns:
      Throws:
      ServerFault
    • getServerAssignments

      @GET @Path("{uid}/serverAssignments") List<Assignment> getServerAssignments(@PathParam("uid") String uid) throws ServerFault
      Throws:
      ServerFault