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 Summary
Modifier and TypeMethodDescriptionEnumerate all the servers in the installation container.voidAssigns a Server's tag to a domain.byAssignment(String domainUid, String tag) Fetches all the servers in a domain container by its assignmentCreates a new server in the database with the given uid.voidDeletes a server object in the database with its uid.getAssignments(String domainUid) Fetches all the server assignments in a domain containergetComplete(String uid) Fetches a server object from the database with its uid.Fetches the progress of a command running in bm-nodebyte[]Uses bm-node to read a file on aServerwith its uid.tags server and return ref to Task (ITaskExecutes a command using bm-node on the server with the given uid.submitAndWait(String uid, String... argv) Executes a command using bm-node on the server with the given uid.voidUndo what assign does.Updates a server in the database with its uid.voidUses bm-node to write a file on aServerwith its uid.
-
Method Details
-
create
-
update
-
getComplete
-
delete
@DELETE @Path("{uid}") void delete(@PathParam("uid") String uid) throws net.bluemind.core.api.fault.ServerFault Deletes a server object in the database with its uid.- Parameters:
uid-- Throws:
net.bluemind.core.api.fault.ServerFault
-
allComplete
-
submit
@POST @Path("{uid}/submit_command") String submit(@PathParam("uid") String uid, String... argv) throws net.bluemind.core.api.fault.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 subsequentgetStatuscalls.- Parameters:
uid-command-- Returns:
- Throws:
net.bluemind.core.api.fault.ServerFault
-
submitAndWait
@POST @Path("{uid}/submit_command_and_wait") CommandStatus submitAndWait(@PathParam("uid") String uid, String... argv) throws net.bluemind.core.api.fault.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:
net.bluemind.core.api.fault.ServerFault
-
getStatus
@GET @Path("{uid}/command_status") CommandStatus getStatus(@PathParam("uid") String uid, @QueryParam("ref") String commandRef) throws net.bluemind.core.api.fault.ServerFault Fetches the progress of a command running in bm-node- Parameters:
uid-commandRef-- Returns:
- Throws:
net.bluemind.core.api.fault.ServerFault
-
readFile
@GET @Path("{uid}/fs/{path}") byte[] readFile(@PathParam("uid") String uid, @PathParam("path") String path) throws net.bluemind.core.api.fault.ServerFault Uses bm-node to read a file on aServerwith its uid.- Parameters:
uid- the server uidpath- the absolute filename to read- Returns:
- the bytes in the file
- Throws:
net.bluemind.core.api.fault.ServerFault
-
writeFile
@PUT @Path("{uid}/fs/{path}") void writeFile(@PathParam("uid") String uid, @PathParam("path") String path, byte[] content) throws net.bluemind.core.api.fault.ServerFault Uses bm-node to write a file on aServerwith its uid.- Parameters:
uid- the server uidpath- the absolute filename to writecontent-- Throws:
net.bluemind.core.api.fault.ServerFault
-
assign
@POST @Path("{domainUid}/assignments/{serverUid}/_assign") void assign(@PathParam("serverUid") String serverUid, @PathParam("domainUid") String domainUid, @QueryParam("tag") String tag) throws net.bluemind.core.api.fault.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:
net.bluemind.core.api.fault.ServerFault
-
unassign
@POST @Path("{domainUid}/assignments/{serverUid}/_unassign") void unassign(@PathParam("serverUid") String serverUid, @PathParam("domainUid") String domainUid, @QueryParam("tag") String tag) throws net.bluemind.core.api.fault.ServerFault Undo what assign does.- Parameters:
serverUid-domainUid-tag-- Throws:
net.bluemind.core.api.fault.ServerFault
-
getAssignments
@GET @Path("{domainUid}/assignments") List<Assignment> getAssignments(@PathParam("domainUid") String domainUid) throws net.bluemind.core.api.fault.ServerFault Fetches all the server assignments in a domain container- Parameters:
domainUid-- Returns:
- Throws:
net.bluemind.core.api.fault.ServerFault
-
byAssignment
@GET @Path("{domainUid}/byAssignment") List<String> byAssignment(@PathParam("domainUid") String domainUid, @QueryParam("tag") String tag) throws net.bluemind.core.api.fault.ServerFault Fetches all the servers in a domain container by its assignment- Parameters:
domainUid-assignment-- Returns:
- Throws:
net.bluemind.core.api.fault.ServerFault
-
setTags
-
getServerAssignments
@GET @Path("{uid}/serverAssignments") List<Assignment> getServerAssignments(@PathParam("uid") String uid) throws net.bluemind.core.api.fault.ServerFault - Throws:
net.bluemind.core.api.fault.ServerFault
-