Last active
January 25, 2019 10:22
-
-
Save Nesousx/f6ce54fbe062a6bbd2603f2098c4ddda to your computer and use it in GitHub Desktop.
curl and ansible way to reboot a scaleway bare metal server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### CURL command to reboot a bare metal Scaleway Server | |
curl -H 'X-Auth-Token: {{ scw_token }}' -H 'Content-Type: application/json' https://cp-{{ scw_region }}.scaleway.com/servers/{{ scw_server }}/action --request POST --data '{"action":"reboot"}' | |
### Ansible version | |
- name: Reboot server via scaleway API | |
uri: | |
url: "https://cp-{{ scw_region }}.scaleway.com/servers/{{ scw_server }}/action" | |
validate_certs: yes | |
method: POST | |
body: | |
action: reboot | |
body_format: json | |
status_code: 200, 202 | |
headers: | |
Content-Type: "application/json" | |
X-Auth-Token: "{{ scw_token }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for sharing, I keep it as a backup, I'll try to do the same with the Scaleway ansible module:
https://docs.ansible.com/ansible/devel/modules/scaleway_compute_module.html#scaleway-compute-module