Support the ability to start/stop moto server mode through code
See original GitHub issueFeature Request: Make the server module into a package that can be importable and controlled directly.
Use Case:
Spinning up 2 different mock_s3
instances. One with the default aws address and one with a custom DNS endpoint_url
passed into boto3.
I have only been able to run 2 separate mocks of the same service via the standalone server with different ports. It would be helpful if moto had a way to programmatically start/stop the standalone server mode natively with python. Currently the only way I have nicely been able to accomplish this is by starting the server in a subprocess.
def _moto_server_process(service, host, port):
cmd = ['moto_server', service, '-p', str(port), '-H', host]
return subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Non-Python SDK's / Server Mode - Moto: Mock AWS Services
Moto has a stand-alone server mode. This allows you to use Moto with any of the official AWS SDK's. Installation . Install...
Read more >ESP8266 Relay Module - Control AC Appliances (Web Server)
Learn how to use Relay Module with ESP8266 NodeMCU to control AC household appliances using Arduino IDE. You'll also build a web server...
Read more >How can I programmatically stop/start a windows service on a ...
I have this coded in my project but I have been running in debug mode stepping through it to find why it won't...
Read more >Moto Documentation - Read the Docs
See Non-Python SDK's / Server Mode for more information. ... of docker-compose configuration that runs Moto server in a separate service.
Read more >WT4070/90 Wearable Terminal User Guide | VisionID
network without written permission from Motorola. ... Scanning Bar Codes . ... not in suspend mode, press the Power button to place the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
btw I created this: https://gist.github.com/thehesiod/2e4094a1db1190f7e122e7043f1973a0
Moto 3.0.6 now includes a way to start the MotoServer programmatically. See the documentation here: http://docs.getmoto.org/en/latest/docs/server_mode.html#start-within-python
It is still in beta while we collect feedback, so if you find any bugs or improvements, feel free to open a new issue!