Question

Can we determine the services available for a workspace using FME Server API FMEServer.getWorkspaceParameters

  • 6 February 2018
  • 2 replies
  • 2 views

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


2 replies

Badge

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.

Badge

Sample code to get item per service:

static void Main(string[] 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