• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Question Event Manager - Create DB when domain created

D

Deleted member 190513

Guest
Hello,

I'm trying to automate the creation of a database whenever a domain is created, but I cannot seam to get it to work. I'm missing the part where I fetch the subscriber for which the new domain is created.
.
I'm running this line:
plesk bin database -c ${NEW_DOMAIN_NAME} -domain ${HOW-TO-GET-SUBSCRIBER} -type mysql -server localhost

As you can see, I don't know how to get the subscriber. I've been looking at every article I can get my hands on. How do I do this?
 
Hello,
You don't need domain subscriber for this command actually as -domain parameter expects domain name to be specified. So for creating database try running:
Code:
plesk bin database -c 'db_name' -domain ${NEW_DOMAIN_NAME} -type mysql -server localhost
 
Hello,
You don't need domain subscriber for this command actually as -domain parameter expects domain name to be specified. So for creating database try running:
Code:
plesk bin database -c 'db_name' -domain ${NEW_DOMAIN_NAME} -type mysql -server localhost

Thank you for the suggestion, but I've already tried that - and it doesn't seam to work. See the images below.

2019-05-23 09-48-11.png err2.png
 
Sorry, this example will work for Default domain (the first domain added to a subscription) created event only.
For additional domains you will have to retrieve default domain (webspace) name, for example using API: you can get webspace ID first and then webspace name.
 
Back
Top