Updates the information about Guest OS to Hypervisor specific name mapping
(p *UpdateGuestOsMappingParams)
| 2012 | |
| 2013 | // Updates the information about Guest OS to Hypervisor specific name mapping |
| 2014 | func (s *GuestOSService) UpdateGuestOsMapping(p *UpdateGuestOsMappingParams) (*UpdateGuestOsMappingResponse, error) { |
| 2015 | resp, err := s.cs.newPostRequest("updateGuestOsMapping", p.toURLValues()) |
| 2016 | if err != nil { |
| 2017 | return nil, err |
| 2018 | } |
| 2019 | |
| 2020 | var r UpdateGuestOsMappingResponse |
| 2021 | if err := json.Unmarshal(resp, &r); err != nil { |
| 2022 | return nil, err |
| 2023 | } |
| 2024 | |
| 2025 | // If we have a async client, we need to wait for the async result |
| 2026 | if s.cs.async { |
| 2027 | b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) |
| 2028 | if err != nil { |
| 2029 | if err == AsyncTimeoutErr { |
| 2030 | return &r, err |
| 2031 | } |
| 2032 | return nil, err |
| 2033 | } |
| 2034 | |
| 2035 | b, err = getRawValue(b) |
| 2036 | if err != nil { |
| 2037 | return nil, err |
| 2038 | } |
| 2039 | |
| 2040 | if err := json.Unmarshal(b, &r); err != nil { |
| 2041 | return nil, err |
| 2042 | } |
| 2043 | } |
| 2044 | |
| 2045 | return &r, nil |
| 2046 | } |
| 2047 | |
| 2048 | type UpdateGuestOsMappingResponse struct { |
| 2049 | Hypervisor string `json:"hypervisor"` |
nothing calls this directly
no test coverage detected