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

Method GetHypervisorGuestOsNames

cloudstack/GuestOSService.go:2182–2214  ·  view source on GitHub ↗

Gets the guest OS names in the hypervisor

(p *GetHypervisorGuestOsNamesParams)

Source from the content-addressed store, hash-verified

2180
2181// Gets the guest OS names in the hypervisor
2182func (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
2216type GetHypervisorGuestOsNamesResponse struct {
2217 Guestoscount int `json:"guestoscount"`

Callers

nothing calls this directly

Calls 4

newRequestMethod · 0.80
GetAsyncJobResultMethod · 0.80
getRawValueFunction · 0.70
toURLValuesMethod · 0.45

Tested by

no test coverage detected