import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.servers.actions(server_id="sv_LYV8DZAQq5QoE", data={
"type": latitudesh_python_sdk.CreateServerActionServersType.ACTIONS,
"attributes": {
"action": latitudesh_python_sdk.CreateServerActionAction.REBOOT,
},
})
# Handle response
print(res)
{
"data": {
"id": "act_V0DgYxxN9Ed4A",
"type": "actions",
"attributes": {
"status": "Rebooting device"
}
},
"meta": {}
}
Performs an action on a given server:
power_on
power_off
reboot
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.servers.actions(server_id="sv_LYV8DZAQq5QoE", data={
"type": latitudesh_python_sdk.CreateServerActionServersType.ACTIONS,
"attributes": {
"action": latitudesh_python_sdk.CreateServerActionAction.REBOOT,
},
})
# Handle response
print(res)
{
"data": {
"id": "act_V0DgYxxN9Ed4A",
"type": "actions",
"attributes": {
"status": "Rebooting device"
}
},
"meta": {}
}
Show child attributes
Was this page helpful?