INDEX

getServices(DOMString service_name, Function callback)

Get all the provided service objects having the service_name.

Service names are not unique in Spaceify edge and this method can be used to get the services of all the applications or spacelets implementing the service. The services are in an object having unique_names of the applications or spacelets as keys. For each unique_name there is one service object.

The Security model dictates which services are available to the caller of this method. If the service is not in the permitted list an error is returned.

Parameter Description
service_name Service name of an application or a spacelet.
callback User defined callback function that is called after the response is available.

After the response is available the callback function is called with two arguments: callback(err, data).

Argument Type Desription
err JSON Object An error_object or null if no error occured.
data JSON Object A JSON object containing service objects by application or spacelet unique names.
{
unique_name: service_object,
unique_name: service_object,
...
}

Example, get all provided "spaceify.org/services/polarnight" services.

{
"aurora": {
          service_name: "spaceify.org/services/polarnight",
          service_type: "open",
          port: "32782",
          securePort:: "32783",
          ip: "172.17..0.3",
          unique_name: "aurora",
          type: "sandboxed",
          },
"borealis": {
          service_name: "spaceify.org/services/polarnight",
          service_type: "open",
          port: "32791",
          securePort:: "32792",
          ip: "172.17..0.7",
          unique_name: "borealis",
          type: "sandboxed",
          }
}
Close
copyright © Spaceify.org 2014