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

Method ExtractIso

cloudstack/ISOService.go:1123–1155  ·  view source on GitHub ↗

Extracts an ISO

(p *ExtractIsoParams)

Source from the content-addressed store, hash-verified

1121
1122// Extracts an ISO
1123func (s *ISOService) ExtractIso(p *ExtractIsoParams) (*ExtractIsoResponse, error) {
1124 resp, err := s.cs.newPostRequest("extractIso", p.toURLValues())
1125 if err != nil {
1126 return nil, err
1127 }
1128
1129 var r ExtractIsoResponse
1130 if err := json.Unmarshal(resp, &r); err != nil {
1131 return nil, err
1132 }
1133
1134 // If we have a async client, we need to wait for the async result
1135 if s.cs.async {
1136 b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
1137 if err != nil {
1138 if err == AsyncTimeoutErr {
1139 return &r, err
1140 }
1141 return nil, err
1142 }
1143
1144 b, err = getRawValue(b)
1145 if err != nil {
1146 return nil, err
1147 }
1148
1149 if err := json.Unmarshal(b, &r); err != nil {
1150 return nil, err
1151 }
1152 }
1153
1154 return &r, nil
1155}
1156
1157type ExtractIsoResponse struct {
1158 Accountid string `json:"accountid"`

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