Skip to main content

Hi All,

Is it possible to retrieve the services available to a workspace via a call to FMEServer.getWorkspaceParameters or similar?

 

For example, I can get a list of repositories and then their workspaces - this works fine.

I need to know what services are then available (e.g. Job Submitter, Data Download etc).

 

Regards,

Simon

I don't kow for the FME Server API but you can use REST API version 2 to achieve this:

http://<yourfmeserver>/fmerest/v2/apidoc/#!/repositories/services_get_50

I don't know if there is a call for this in version 3.


Sample code to get item per service:

static void Main(stringn] args)
{
    IFMEServerSession session = Safe.FMEServer.API.FMEServer.CreateServerSession();
    IFMEServerConnectionInfo info = session.CreateServerConnectionInfo("fmeserver", 7071, "user", "password");
    Dictionary<string, string> directives = new Dictionary<string, string>();
    session.Init(info, directives);

    IFMERepositoryManager repositoryMgr = session.GetRepositoryManager();

    foreach (IFMEService service in repositoryMgr.GetServices(null))
    {
        Console.WriteLine(service.Name);
        foreach (IFMEItem item in service.GetRegisteredItems(null))
        {
            Console.WriteLine(string.Format("\t{0} - {1} - {2}", item.Type, item.RepositoryName, item.Name));
        }
    }
}

Reply