MCPcopy Index your code
hub / github.com/apache/cloudstack-go / UpdateGuestOsMapping

Method UpdateGuestOsMapping

cloudstack/GuestOSService.go:2014–2046  ·  view source on GitHub ↗

Updates the information about Guest OS to Hypervisor specific name mapping

(p *UpdateGuestOsMappingParams)

Source from the content-addressed store, hash-verified

2012
2013// Updates the information about Guest OS to Hypervisor specific name mapping
2014func (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
2048type UpdateGuestOsMappingResponse struct {
2049 Hypervisor string `json:"hypervisor"`

Callers

nothing calls this directly

Calls 4

newPostRequestMethod · 0.80
GetAsyncJobResultMethod · 0.80
getRawValueFunction · 0.70
toURLValuesMethod · 0.45

Tested by

no test coverage detected