When using mock services or the proxy recorder on an OPL, sometimes limiting the port range that is open to the mock service or proxy recorder is necessary. Every Mock Service uses its own port, so consider that defining a port range limits the number of Mock Services that you can create and run on a particular agent (ship).
Static Endpoints for Mock Services
Note: This behavior only applies to transaction based Mock Services on Docker-based agents.
If a transactional Mock Service is stopped and re-deployed on a Docker OPL, the same port number will be reused when possible. If the port is not available and taken by another process on the Agent host, the Mock Service finds a new port from the allowed port range of the Agent and uses that. In this case, the notification message indicates that the end point has changed.
Set a Custom Port Range
The following API lets you to limit the range of ports available on a specific agent (ship):
|Api Key||Identifies the user (--user 'id:secret' ). How to get the API Key?|
|Patch Body||"portRange" is the only parameter needed.|
|HarborId||Harbor ID of the private location. How to get Harbor ID?|
|ShipId||Ship ID of the agent within the private location. How to get Ship ID?|