Removes a Guest OS from listing.
(p *RemoveGuestOsParams)
| 1604 | |
| 1605 | // Removes a Guest OS from listing. |
| 1606 | func (s *GuestOSService) RemoveGuestOs(p *RemoveGuestOsParams) (*RemoveGuestOsResponse, error) { |
| 1607 | resp, err := s.cs.newPostRequest("removeGuestOs", p.toURLValues()) |
| 1608 | if err != nil { |
| 1609 | return nil, err |
| 1610 | } |
| 1611 | |
| 1612 | var r RemoveGuestOsResponse |
| 1613 | if err := json.Unmarshal(resp, &r); err != nil { |
| 1614 | return nil, err |
| 1615 | } |
| 1616 | |
| 1617 | // If we have a async client, we need to wait for the async result |
| 1618 | if s.cs.async { |
| 1619 | b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) |
| 1620 | if err != nil { |
| 1621 | if err == AsyncTimeoutErr { |
| 1622 | return &r, err |
| 1623 | } |
| 1624 | return nil, err |
| 1625 | } |
| 1626 | |
| 1627 | if err := json.Unmarshal(b, &r); err != nil { |
| 1628 | return nil, err |
| 1629 | } |
| 1630 | } |
| 1631 | |
| 1632 | return &r, nil |
| 1633 | } |
| 1634 | |
| 1635 | type RemoveGuestOsResponse struct { |
| 1636 | Displaytext string `json:"displaytext"` |
nothing calls this directly
no test coverage detected