Skip to content

Commit

Permalink
Hycu-VMn-Archive-M.json
Browse files Browse the repository at this point in the history
Same as Hycu-VM-Archive-M.json template but we added an extra step in first place to retrieve the Hycu VM uuid with a GET command to the API. You just have to specify the VM name on "@vm_name" variable (you can use Opcon properties).
  • Loading branch information
PClem-Sma authored May 13, 2020
1 parent 2dd743f commit 9c43177
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions Hycu-VM-Archive/Hycu-VMn-Archive-M.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"templateid" : "Hycu-VMn-Archive-Month",
"steps" : [ {
"function" : "GET",
"url" : "[[myHycuServer]]/rest/v1.0/vms?filter=vmName%3D%3D@vm_name&pageSize=100&pageNumber=1&forceSync=false",
"request" : {
"headers" : [ {
"attribute" : "Authorization",
"value" : "Basic"
} ],
"body" : "{\r\n \"Accept\": \"application/json\"\r\n}",
"fileName" : null
},
"response" : {
"ignoreResult" : false,
"stepCompletionCode" : 200,
"responseDataCheck" : null,
"fileName" : null,
"variables" : [ {
"name" : "@vm_uuid",
"value" : "entities[0].uuid"
} ]
}
}, {
"function" : "POST",
"url" : "[[myHycuServer]]/rest/v1.0/vms/archive",
"request" : {
"headers" : [ {
"attribute" : "Authorization",
"value" : "Basic"
}, {
"attribute" : "vm_uuid",
"value" : "@vm_uuid"
} ],
"body" : "{\r\n \"archivingType\": \"MONTH\",\r\n \"vmUuid\": \"@vm_uuid\"\r\n}",
"fileName" : null
},
"response" : {
"ignoreResult" : false,
"stepCompletionCode" : 202,
"responseDataCheck" : null,
"fileName" : null,
"variables" : [ {
"name" : "@jobUuid",
"value" : "entities[0].jobUuid"
} ]
}
}, {
"function" : "GET",
"url" : "[[myHycuServer]]/rest/v1.0/jobs/@jobUuid",
"request" : {
"headers" : [ {
"attribute" : "Authorization",
"value" : "Basic"
}, {
"attribute" : "Content-Type",
"value" : "application/json"
}, {
"attribute" : "jobUuid",
"value" : "@jobUuid"
} ],
"body" : null,
"fileName" : null
},
"response" : {
"ignoreResult" : false,
"stepCompletionCode" : 200,
"responseDataCheck" : {
"goodFin" : "OK/WARNING",
"badFin" : "ERROR/FATAL/ABORTED",
"attributeToCheck" : "entities[0].status",
"poll" : true,
"pollDelay" : 10,
"pollInterval" : 20,
"pollMaxTime" : 240
},
"fileName" : null,
"variables" : [ ]
}
} ],
"variables" : [ {
"name" : "@User",
"value" : "[[HycuUser]]"
}, {
"name" : "@Password",
"value" : "[[HycuPwd]]"
}, {
"name" : "@vm_name",
"value" : "??????"
} ],
"properties" : [ ]
}

0 comments on commit 9c43177

Please sign in to comment.