Update the default Ip of a VM Nic
(p *UpdateVmNicIpParams)
| 558 | |
| 559 | // Update the default Ip of a VM Nic |
| 560 | func (s *NicService) UpdateVmNicIp(p *UpdateVmNicIpParams) (*UpdateVmNicIpResponse, error) { |
| 561 | resp, err := s.cs.newPostRequest("updateVmNicIp", p.toURLValues()) |
| 562 | if err != nil { |
| 563 | return nil, err |
| 564 | } |
| 565 | |
| 566 | var r UpdateVmNicIpResponse |
| 567 | if err := json.Unmarshal(resp, &r); err != nil { |
| 568 | return nil, err |
| 569 | } |
| 570 | |
| 571 | // If we have a async client, we need to wait for the async result |
| 572 | if s.cs.async { |
| 573 | b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) |
| 574 | if err != nil { |
| 575 | if err == AsyncTimeoutErr { |
| 576 | return &r, err |
| 577 | } |
| 578 | return nil, err |
| 579 | } |
| 580 | |
| 581 | b, err = getRawValue(b) |
| 582 | if err != nil { |
| 583 | return nil, err |
| 584 | } |
| 585 | |
| 586 | if err := json.Unmarshal(b, &r); err != nil { |
| 587 | return nil, err |
| 588 | } |
| 589 | } |
| 590 | |
| 591 | return &r, nil |
| 592 | } |
| 593 | |
| 594 | type UpdateVmNicIpResponse struct { |
| 595 | Account string `json:"account"` |
nothing calls this directly
no test coverage detected