Code Block |
---|
curl -X PUT 'https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2486/virtualappliances/2990/virtualmachines/19454/state' \
-k --verbose \
-H 'Accept: application/vnd.abiquo.acceptedrequest+json; version=5.0' \
-H 'Content-Type: application/vnd.abiquo.virtualmachinestate+json; version=5.0' \
-d '{"state": "OFF", "gracefulShutdown": true}' \
-u user:password | jq . |
Code Block |
---|
{
"taskId": "d62be542-f34c-4fed-b9f8-6443f2db4cc1",
"userId": "10",
"type": "SHUTDOWN",
"ownerId": "19454",
"state": "FINISHED_SUCCESSFULLY",
"creationTimestamp": 1596040226,
"timestamp": 1596040226,
"jobs": {
"links": [],
"collection": [
{
"id": "d62be542-f34c-4fed-b9f8-6443f2db4cc1.2cd94a0c-179d-4506-a71d-fabaf29a4d43",
"parentTaskId": "d62be542-f34c-4fed-b9f8-6443f2db4cc1",
"type": "SHUTDOWN",
"description": "Shutdown task's shutdown on virtual machine with id 19454",
"state": "DONE",
|
"rel":"self",
"rollbackState": "UNKNOWN",
"creationTimestamp": 1596040226,
"timestamp": 1596040226,
"links": []
}
]
},
"links": [
{
"rel": "self",
"href": "https:// |
38testingnardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/ |
5520017638812ddf4a37240af81ee5f5d1e53454c
38testingnardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/ |
552001763 {rel"acknowledge "application/vnd.abiquo.virtualmachine+json", |
38testingnardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/ |
552001763/tasks/8812ddf4-a372-40af-81ee-5f5d1e53454c/action/ack
cloudadmin
"type": "application/vnd.abiquo.user+json", |
38testingnardo40.bcn.abiquo.com:443/api/admin/enterprises/ |
7417
5e57c34d5dcb482bbe0fa78931f4abd0
"type": "application/vnd.abiquo.virtualmachine+json", |
38testingnardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/ |
552001763
, "taskId"8812ddf4-a372-40af-81ee-5f5d1e53454c",
"userId":"17",
"type":"SHUTDOWN",
"ownerId":"1763",
"state":"FINISHED_UNSUCCESSFULLY",
"creationTimestamp":1458647896,
"timestamp":1458647897,
"jobs":{
"links":[
],
"collection":[
{
"links":[
],
"id":"8812ddf4-a372-40af-81ee-5f5d1e53454c.191e44d9-74fa-453a-b7e0-596237618fcf",
"parentTaskId":"8812ddf4-a372-40af-81ee-5f5d1e53454c",
"type":"SHUTDOWN",
To reset a VM using the API, use a POST request to the reset action link. If you are using a test environment, you may wish to add the --insecure option. cURL: Code Block |
---|
curl -X POST 'https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2486/virtualappliances/2990/virtualmachines/19454/action/reset' \
-k --verbose \
-H 'Accept: application/vnd.abiquo.acceptedrequest+json; version=5.0' \
-u user:password | jq . |
Success status code: 202 Request payload: --none-- Response payload: Code Block |
---|
{
"message": "You can keep track of the progress in the link",
"links": [
{
"descriptiontitle":"Shutdown task's shutdown on virtual machine with id 1763",
"status",
"staterel": "FAILEDstatus",
"rollbackState"type":"ROLLBACK_DONE",
"application/vnd.abiquo.task+json",
"creationTimestamphref":1458647896,
"timestamp":1458647897
"https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2486/virtualappliances/2990/virtualmachines/19454/tasks/edec6cf1-8874-451d-a4c0-57f4c24da371"
}
]
} } |
|