Question

Programmatically retrieve a list of the Web Connections that a workspace uses


Badge

Hi Folks -

 

I would like to use the FME Server API to get a list of the Web Connections that a workspace uses. I see that there is an endpoint for GET /repositories/< repository >/items/< item >/parameters , but this doesn't provide details regarding the Web Connections configured for the workspace.  

I currently have a query like:

http://domain.com/fmerest/v3/repositories/repo_name/items/workspace_name.fmw/parameters

... and wondering how to change this to get the Web Connection details as well.

 

In the implementation notes of the endpoint above I see the info below, but I am not sure how to use the create a query using the "Sub-type: Web Connection Parameter"

 

Sub-type: Web Connection Parameter

parameter {

connectionTypes (array[string]): Connection types of this published parameter,

defaultValue (string): Default value of the published parameter,

description (string): A human-readable description of the published parameter,

excludeConnectionTypes (array[string]): Connection types to exclude for this published parameter,

model (string) = ['list', 'string', 'object' or 'objectList']: Data type, always 'string',

name (string): Unique name of the published parameter,

optional (boolean): Whether the parameter is optional or not,

type (string) = ['NAMED_CONNECTION']: Web connection published parameter type

}

 

Any help is greatly appreciated. Thanks!


5 replies

Userlevel 1
Badge +12

Hi,

 

I am afraid there is no single endpoint to do this. To find out the connections is use you need to pull apart many environments to get an accurate representation of it. That include automations, workspace paramaters, schedules, transformer parameters etc.

 

If it is just parameters in the workspace you are looking at then it is just a call to:

 

URL/fmerest/v3/repositories/<repo>/items/<workspace> and jsonfragmentor with json["parameters"][*], Reject Features which produce no Fragments: No and Flatten.

 

The look for type = NAMED_CONNECTION or NAMED_DB_CONNECTION

 

Please realise this certainly does not tell you all the connections used in the workspace! And that the defaultvalue mentioned is just that, a default, and not what the user may choose

 

But its not impossible to do the full scale scenario. We have been building an audit process that pulls lots of the rest responses and then provides a lot of raw data and the relationship between them. It is getting bigger and bigger as there are so many relationships in FME Server and we are providing some of the outputs to clients to show how we can understand their system and security, and maintain those environments for their needs. So if that sounds like a option then sing out.

 

Thanks,

Todd

 

Badge

Thanks @Todd Davis​ . Unfortunately there are no NAMED_CONNECTION items in the response so I don't have anything to parse. Will keep digging! Cheers

Badge +2

Hiya,

We have an arcgis online username that is getting locked out due to too many invalid logins. We think it might be in an FME workspace on FME Server and want to try track it down. is there a programmatic way to do this?

Thanks.

Userlevel 1
Badge +12

Hiya,

We have an arcgis online username that is getting locked out due to too many invalid logins. We think it might be in an FME workspace on FME Server and want to try track it down. is there a programmatic way to do this?

Thanks.

By the sounds of it, you think it is in hardcoded username/password in a workspace that then it meant to create a token? You can iterate through the repos, download each workspace and extract all the transformer and reader/writer details. If it somewhere else, then the calls and processes will depend on where it is.

 

It won't be an ArcGIS Online connection in the Web Connections, as these are only refreshing an Oauth2 token, and so won't be re-authenticating.

 

 

 

 

Badge +2

By the sounds of it, you think it is in hardcoded username/password in a workspace that then it meant to create a token? You can iterate through the repos, download each workspace and extract all the transformer and reader/writer details. If it somewhere else, then the calls and processes will depend on where it is.

 

It won't be an ArcGIS Online connection in the Web Connections, as these are only refreshing an Oauth2 token, and so won't be re-authenticating.

 

 

 

 

ok cool, I'll take a look at reading the fmw's.

thanks.

Reply