PSU API Questions

Running PSU 1.4.3 - installed via MSI as a service, running under a service account.

I have a few questions around the PSU API:

  1. Is it possible to expose the API on a different port than PSU itself? I see an API section in appsettings.json with a blank URL option, played around with that, but no luck. The documentation only mentions about making use of it if you’re running within a reverse proxy.

  2. I’m porting over a bunch of REST endpoints that we’ve been using on UDv2.9.4 to PSU 1.4.3. I have 3 endpoints that make use of 2 global variables defined in our previous script, outside of any endpoint - one global var being a queue, the other being a generic list.

It seems that in PSU, each endpoint has its own scope, so when I define global variables at the top of endpoints.ps1, none of the endpoints have access to global variables defined outside of the endpoints. Do the endpoints not have access to the parent scope in endpoints.ps1?

Is there any workaround for this? I tried using the Variables in Automation, but it seems that those are limited to strings.

  1. No. The entire webserver is running on a single port. You’d have to stand up another PSU instance.
  2. Not possible at the moment but happy to brainstorm here. The scope isn’t retained when creating those endpoints. Possibly something we could do. I’ll have to think about that. Is the queue populated by one endpoint and then read by another endpoint? What type of objects are you storing in each collection?

Is the queue populated by one endpoint and then read by another endpoint?

Correct.

What type of objects are you storing in each collection?

I’m passing PSCustomObjects through each collection.

This is a small piece of many API endpoints that I’m migrating into PSU from UD v2.9.4. If it’s not currently doable its not a huge problem, I can stick with these few endpoints running with UD v2.9.4.