Gets the guest OS names in the hypervisor
(p *GetHypervisorGuestOsNamesParams)
| 2180 | |
| 2181 | // Gets the guest OS names in the hypervisor |
| 2182 | func (s *GuestOSService) GetHypervisorGuestOsNames(p *GetHypervisorGuestOsNamesParams) (*GetHypervisorGuestOsNamesResponse, error) { |
| 2183 | resp, err := s.cs.newRequest("getHypervisorGuestOsNames", p.toURLValues()) |
| 2184 | if err != nil { |
| 2185 | return nil, err |
| 2186 | } |
| 2187 | |
| 2188 | var r GetHypervisorGuestOsNamesResponse |
| 2189 | if err := json.Unmarshal(resp, &r); err != nil { |
| 2190 | return nil, err |
| 2191 | } |
| 2192 | |
| 2193 | // If we have a async client, we need to wait for the async result |
| 2194 | if s.cs.async { |
| 2195 | b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) |
| 2196 | if err != nil { |
| 2197 | if err == AsyncTimeoutErr { |
| 2198 | return &r, err |
| 2199 | } |
| 2200 | return nil, err |
| 2201 | } |
| 2202 | |
| 2203 | b, err = getRawValue(b) |
| 2204 | if err != nil { |
| 2205 | return nil, err |
| 2206 | } |
| 2207 | |
| 2208 | if err := json.Unmarshal(b, &r); err != nil { |
| 2209 | return nil, err |
| 2210 | } |
| 2211 | } |
| 2212 | |
| 2213 | return &r, nil |
| 2214 | } |
| 2215 | |
| 2216 | type GetHypervisorGuestOsNamesResponse struct { |
| 2217 | Guestoscount int `json:"guestoscount"` |
nothing calls this directly
no test coverage detected