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

Method RemoveIpFromNic

cloudstack/NicService.go:454–481  ·  view source on GitHub ↗

Removes secondary IP from the NIC.

(p *RemoveIpFromNicParams)

Source from the content-addressed store, hash-verified

452
453// Removes secondary IP from the NIC.
454func (s *NicService) RemoveIpFromNic(p *RemoveIpFromNicParams) (*RemoveIpFromNicResponse, error) {
455 resp, err := s.cs.newPostRequest("removeIpFromNic", p.toURLValues())
456 if err != nil {
457 return nil, err
458 }
459
460 var r RemoveIpFromNicResponse
461 if err := json.Unmarshal(resp, &r); err != nil {
462 return nil, err
463 }
464
465 // If we have a async client, we need to wait for the async result
466 if s.cs.async {
467 b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
468 if err != nil {
469 if err == AsyncTimeoutErr {
470 return &r, err
471 }
472 return nil, err
473 }
474
475 if err := json.Unmarshal(b, &r); err != nil {
476 return nil, err
477 }
478 }
479
480 return &r, nil
481}
482
483type RemoveIpFromNicResponse struct {
484 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