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

Method DeleteIso

cloudstack/ISOService.go:682–709  ·  view source on GitHub ↗

Deletes an ISO file.

(p *DeleteIsoParams)

Source from the content-addressed store, hash-verified

680
681// Deletes an ISO file.
682func (s *ISOService) DeleteIso(p *DeleteIsoParams) (*DeleteIsoResponse, error) {
683 resp, err := s.cs.newPostRequest("deleteIso", p.toURLValues())
684 if err != nil {
685 return nil, err
686 }
687
688 var r DeleteIsoResponse
689 if err := json.Unmarshal(resp, &r); err != nil {
690 return nil, err
691 }
692
693 // If we have a async client, we need to wait for the async result
694 if s.cs.async {
695 b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
696 if err != nil {
697 if err == AsyncTimeoutErr {
698 return &r, err
699 }
700 return nil, err
701 }
702
703 if err := json.Unmarshal(b, &r); err != nil {
704 return nil, err
705 }
706 }
707
708 return &r, nil
709}
710
711type DeleteIsoResponse struct {
712 Displaytext string `json:"displaytext"`

Callers

nothing calls this directly

Calls 3

newPostRequestMethod · 0.80
GetAsyncJobResultMethod · 0.80
toURLValuesMethod · 0.45

Tested by

no test coverage detected