MCPcopy Create free account
hub / github.com/apache/cloudstack-go / UpdateVmNicIp

Method UpdateVmNicIp

cloudstack/NicService.go:560–592  ·  view source on GitHub ↗

Update the default Ip of a VM Nic

(p *UpdateVmNicIpParams)

Source from the content-addressed store, hash-verified

558
559// Update the default Ip of a VM Nic
560func (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
594type UpdateVmNicIpResponse struct {
595 Account string `json:"account"`

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