Upload security , position and portfolio through WEB calls

Hello there ,

I would like to know if we can upload security , position , timeseries and portfolio info through web calls.
If its possible , kindly give pointers on how to achieve it.

~Shyam

This is normally achieved within a Java client by starting up a remote proxy, such as RemoteSecurityMaster. This class then has the methods necessary to call the server.

SecurityMaster sm = new RemoteSecurityMaster(serverUri)

The running components on a standard OpenGamma server can be found at the URI http://my.server/jax/components , and this includes the URI of a specific master.

Awesome !!!
I am sooo adding OG team to my chrismas greeting card sent list.

~Shyam

Wow…this really made coding easy…

Hello guys,

Can you elaborate a little more on how can I add or upload a new portfolio and position through the web calls ?

Thanks,
Piyush

If you run up a server and go to /jax/components, you will see the available components that you can call. If you click on the URL, you get basic details about the method that is called in the server. So, the config master tells you the class name “com.opengamma.master.config.impl.DataConfigMasterResource” and the method name “add”. If you go to the source code and load the class then you will find the object that is passed in and returned.

The input is either passed in by query parameters or as the body of the HTTP request. For example, the add method is

  @POST
  @Path("configs")
  public Response add(@Context UriInfo uriInfo, ConfigDocument request) {
    ConfigDocument<?> result = getConfigMaster().add(request);
    URI createdUri = DataConfigResource.uriVersion(uriInfo.getBaseUri(), result.getUniqueId(), result.getType());
    return responseCreatedFudge(createdUri, result);
  }

In this case, the method is defined to take in the ConfigDocument directly, so it is received as part of the POST body.

The message itself is passed as Fudge, which may be encoded in binary, JSON or XML.

If you are using Java as the client, then you simply use RemoteConfigMaster to connect up, and everything is taken care of. Otherwise, you have to build the message (Fudge binary, Fudge XML or Fudge JSON) to send yourself.