@Tom-Elliott
I have finaly have it, it’s 14 with Fog 1.5.10. Task is send without error but no Wake Up… I’m using the powershell fog API, I have changed it to be able to send a task with ID 14… Can someone help me?
function Send-FogImage {
# .ExternalHelp FogApi-help.xml
[CmdletBinding(DefaultParameterSetName='now')]
[Alias('Push-FogImage','Deploy-FogImage')]
param (
[Parameter(ParameterSetName='now')]
[Parameter(ParameterSetName='schedule')]
$hostId,
$taskTypeID,
[Parameter(ParameterSetName='schedule')]
[datetime]$StartAtTime
)
process {
$fogHost = Get-FogHost -hostID $hostId;
$currentImage = $fogHost.imageName;
$fogImages = Get-FogImages;
$fogImage = ($fogImages | Where-Object name -match $currentImage)
if ($taskTypeID -eq ""){
$taskTypeID = 1
}
if ($PSCmdlet.ParameterSetName -eq 'now') {
"No Time was specified, queuing the task to start now" | out-host;
if ($taskTypeID -ne 1) {
"Creating Task for fog host of id $($hostID) named $($fogHost.name)" | Out-Host;
$jsonData = "{`"taskTypeID`": `"$($taskTypeID)`", `"shutdown`":`"0`",`"other2`":`"0`",`"other4`":`"0`",`"isActive`":`"1`" }";
}else{
"Creating Deploy Task for fog host of id $($hostID) named $($fogHost.name) taskID $($taskTypeID)" | Out-Host;
"Will deploy the assigned image $($fogImage.name) - $($fogImage.id) which will install the os $($fogImage.osname)" | Out-host;
$jsonData = "{`"taskTypeID`": `"$($taskTypeID)`", `"shutdown`":`"0`",`"other2`":`"0`",`"other4`":`"1`",`"isActive`":`"1`" }";
}
} else {
"Start time of $($StartAtTime) specified, scheduling the task to start at that time" | out-host;
$scheduleTime = Get-FogSecsSinceEpoch -scheduleDate $StartAtTime
$runTime = get-date $StartAtTime -Format "yyyy-M-d HH:MM"
$jsonData = @"
{
"name":"Deploy Task",
"type":"S",
"taskTypeID":"$($taskTypeID)",
"runTime":"$runTime",
"scheduleTime":"$scheduleTime",
"isGroupTask":"0",
"hostID":"$($hostId)",
"shutdown":"0",
"other2":"0",
"other4":"1",
"isActive":"1"
}
"@
}
return New-FogObject -type objecttasktype -coreTaskObject host -jsonData $jsonData -IDofObject "$hostId";
}
}