Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small PHP script to reboot your server on a different node #23

Open
finalwebsites opened this issue Aug 20, 2019 · 4 comments
Open

Small PHP script to reboot your server on a different node #23

finalwebsites opened this issue Aug 20, 2019 · 4 comments

Comments

@finalwebsites
Copy link

Hi,
I had some issues with CPU steal recently and wrote this script to restart a server on a different host node.
https://gist.github.com/finalwebsites/162e168b3539b12005141113277b5edd

Any suggestions what I can do better?
Maybe you like to share it somewhere?
If you like I can create a complete tutorial (if the information qualifies to get a credit :))

@Darep
Copy link
Member

Darep commented Aug 20, 2019

Thanks @finalwebsites! Looks good to me! I've been actually thinking that you could dumb down upcloud-php-api to something like only curl, like in your script, would make things simpler :) But just an idea...

"avoid_host" is they way to go when you want to solve issues like that! 👍

@finalwebsites
Copy link
Author

@Darep actually I didn't checked the current PHP API wrapper :)
Curl is great to do stuff quickly, but without a class you need to write the same stuff over and over again.
Must say the docs for the PHP API is much better than the regular API docs.
If I find the time I will write an example for the PHP API as well. It's only the startup parameter which is not included in the wrapper class.

@Darep
Copy link
Member

Darep commented Aug 20, 2019

Thanks! Sounds good! 😊 Yeah, I was thinking about a light wrapper around curl() or guzzle. The wrapper would add the headers for you and you give it the path like /server and then the body as array()-structure. But just an idea for now 😄

@Darep
Copy link
Member

Darep commented Aug 20, 2019

And let me know how it goes with the example! Would be nice to have an example like that in this repo, so happy to help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants