Closed rickdesantis closed 9 years ago
Are you really using the following line (with the serverUri)?
CloudML cml = Factory.getInstance().getCloudML(serverUri)
The commands you are looking for are not yet implemented in the facade for interaction with remote models@runtime. Also the command "snapshot" creates a snapshot of a specific VM instance and doesn't return the list of components in the model.
Is this what you are looking for? (I mean to use the facade in order to interact with a remote models@runtime engine). For now I just added support for the "GetDeployment" command which returns a deployment model in JSON. This way you can load it using the JSONCodec and thus exploit all the features offered by CloudML to manipulate a model (e.g., retrieve only VMs, externalComponents, internalComponents etc.).
CloudMlCommand cmd2 = fcommand.getDeployment();
cml.fireAndWait(cmd2);
In both cases (remote or not) to retrieve the results from commands you have to implement an EventHandler and to register it in the facade:
CloudML cml= Factory.getInstance().getCloudML();
EventHandler eh=new EventHandler() {
@Override
public void handle(Event event) {
System.out.println(event);
}
@Override
public void handle(Message message) {
this.handle((Event) message);
}
@Override
public void handle(Data data) {
this.handle((Event) data);
}
@Override
public void handle(ComponentList componentList) {
this.handle((Event) componentList);
}
@Override
public void handle(ComponentData componentData) {
this.handle((Event) componentData);
}
@Override
public void handle(ComponentInstanceList componentInstanceList) {
this.handle((Event) componentInstanceList);
}
@Override
public void handle(ComponentInstanceData componentInstanceData) {
this.handle((Event) componentInstanceData);
}
};
cml.register(eh);
In the remote case, the result is a string that you need to handle. The message stating that a deployment is completed is:
!ack {fromPeer: org.cloudml.facade.commands.Deploy, status: completed}
Yes, I was looking for that getDeployment()
function and for some reason I mistook the two. Somebody else told me that the facade was incomplete, I was just testing it and reporting what I thought was a bug :). I'm well aware of the event handler mechanism, but it doesn't have anything to do with the reported case.
Thank you, I'll look into it. For now I'll just keep using the web socket client directly.
Yes thank you for the report :) I will close this comment only once all commands will be available in the RemoteFacade The new facade is now available in the maven repo
Using the CloudML facade, after a correct deploy of the model, using:
it doesn't return the actual deployment model or the list of instances via
where both of those commands return the error
The error occurs while using Amazon services.