Removes secondary IP from the NIC.
(p *RemoveIpFromNicParams)
| 452 | |
| 453 | // Removes secondary IP from the NIC. |
| 454 | func (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 | |
| 483 | type RemoveIpFromNicResponse struct { |
| 484 | Displaytext string `json:"displaytext"` |
nothing calls this directly
no test coverage detected