Attempts Migration of a system virtual machine to the host specified.
(p *MigrateSystemVmParams)
| 1257 | |
| 1258 | // Attempts Migration of a system virtual machine to the host specified. |
| 1259 | func (s *SystemVMService) MigrateSystemVm(p *MigrateSystemVmParams) (*MigrateSystemVmResponse, error) { |
| 1260 | resp, err := s.cs.newPostRequest("migrateSystemVm", p.toURLValues()) |
| 1261 | if err != nil { |
| 1262 | return nil, err |
| 1263 | } |
| 1264 | |
| 1265 | var r MigrateSystemVmResponse |
| 1266 | if err := json.Unmarshal(resp, &r); err != nil { |
| 1267 | return nil, err |
| 1268 | } |
| 1269 | |
| 1270 | // If we have a async client, we need to wait for the async result |
| 1271 | if s.cs.async { |
| 1272 | b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) |
| 1273 | if err != nil { |
| 1274 | if err == AsyncTimeoutErr { |
| 1275 | return &r, err |
| 1276 | } |
| 1277 | return nil, err |
| 1278 | } |
| 1279 | |
| 1280 | b, err = getRawValue(b) |
| 1281 | if err != nil { |
| 1282 | return nil, err |
| 1283 | } |
| 1284 | |
| 1285 | if err := json.Unmarshal(b, &r); err != nil { |
| 1286 | return nil, err |
| 1287 | } |
| 1288 | } |
| 1289 | |
| 1290 | return &r, nil |
| 1291 | } |
| 1292 | |
| 1293 | type MigrateSystemVmResponse struct { |
| 1294 | Activeviewersessions int `json:"activeviewersessions"` |
nothing calls this directly
no test coverage detected