// You should always use this function to get a new UpdatePhysicalNetworkParams instance,
// as then you are sure you have configured all required params
774594
func (s *NetworkService) NewUpdatePhysicalNetworkParams(id string) *UpdatePhysicalNetworkParams {
	p := &UpdatePhysicalNetworkParams{}
	p.p = make(map[string]interface{})
	p.p["id"] = id
	return p
}
1132039
func (*Service) UpdatePhysicalHost(c context.Context, req *crimson.UpdatePhysicalHostRequest) (*crimson.PhysicalHost, error) {
	return updatePhysicalHost(c, req.Host, req.UpdateMask)
}
500606
func (s *VirtualMachineService) NewUpdateDefaultNicForVirtualMachineParams(nicid string, virtualmachineid string) *UpdateDefaultNicForVirtualMachineParams {
	p := &UpdateDefaultNicForVirtualMachineParams{}
	p.p = make(map[string]interface{})
	p.p["nicid"] = nicid
	p.p["virtualmachineid"] = virtualmachineid
	return p
}
709158
func (m *networkMechanismManager) UpdateNetwork(context *NetworkManagerContext) (err error) {
	network := new(NetworkManagerContext)

	update := func(fn func() error) error {
		return m.BaseMechanismManager.Update(
			NetworkModel, network, fn,
		)
	}

	pre := func(port NetworkPort) error {
		networkContext, err := m.updateNetworkContext(port)
		if err != nil {
			return err
		}

		err = m.do(func(nlmech NetworkMechanism) error {
			return nlmech.UpdateNetworkPreCommit(networkContext)
		})

		if err != nil {
			log.ErrorLog("network/UPDATE_NETWORK_PRECOMMIT",
				"Failed to parse ")
		}

		return err
	}

	post := func(port NetworkPort) error {
		networkContext, err := m.updateNetworkContext(port)
		if err != nil {
			return err
		}

		err = m.do(func(nlmech NetworkMechanism) error {
			return nlmech.UpdateNetworkPostCommit(networkContext)
		})

		if err != nil {
			log.ErrorLog("network/UPDATE_NETWORK_POSTCOMMIT",
				"Failed to update network configuration: ", err)
		}

		return err
	}

	return update(func() error {
		_, err := m.LinkDriver()
		if err != nil {
			return err
		}

		_, err = m.Driver()
		if err != nil && len(network.Ports) != 0 {
			log.ErrorLog("network/UPDATE_NETWORK",
				"Driver not found, but ports need to be updated")
			return ErrNetworkNotInitialized
		}

		for _, port := range context.Ports {
			// Get previous port coniguration
			port = network.Port(port.Port)
			blank := NetworkPort{}

			// Skip blank ports
			if port == blank {
				continue
			}

			// Precommit changes
			if err := pre(port); err != nil {
				log.ErrorLog("network/UPDATE_NETWORK",
					"Network update pre-commit failed: ", err)
				return err
			}
		}

		// Set new driver
		err = m.SetDriver(context.Driver)
		if err != nil {
			return err
		}

		// Update driver configuration
		network.Driver = context.Driver

		for _, port := range context.Ports {
			if err := post(port); err != nil {
				log.ErrorLog("network/UPDATE_NETWORK",
					"Network update post-commit failed: ", err)
				return err
			}

			// Update port configuration
			network.SetPort(port)
		}

		return nil
	})
}
1286173
func (s *NetworkACLService) UpdateNetworkACLList(p *UpdateNetworkACLListParams) (*UpdateNetworkACLListResponse, error) {
	resp, err := s.cs.newRequest("updateNetworkACLList", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r UpdateNetworkACLListResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			if err == AsyncTimeoutErr {
				return &r, err
			}
			return nil, err
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}

	return &r, nil
}
1354081
func (s *VPNService) NewUpdateVpnConnectionParams(id string) *UpdateVpnConnectionParams {
	p := &UpdateVpnConnectionParams{}
	p.p = make(map[string]interface{})
	p.p["id"] = id
	return p
}
684444
func (c *networkPolicies) Update(networkPolicy *v1beta1.NetworkPolicy) (result *v1beta1.NetworkPolicy, err error) {
	result = &v1beta1.NetworkPolicy{}
	err = c.client.Put().
		Namespace(c.ns).
		Resource("networkpolicies").
		Name(networkPolicy.Name).
		Body(networkPolicy).
		Do().
		Into(result)
	return
}
841503
func (d *Daemon) UpdateNetworkPolicy(e *endpoint.Endpoint, policy *policy.L4Policy,
	labelsMap, deniedIngressIdentities, deniedEgressIdentities cache.IdentityCache, proxyWaitGroup *completion.WaitGroup) (error, revert.RevertFunc) {
	if d.l7Proxy == nil {
		return fmt.Errorf("can't update network policy, proxy disabled"), nil
	}
	err, revertFunc := d.l7Proxy.UpdateNetworkPolicy(e, policy, e.GetIngressPolicyEnabledLocked(), e.GetEgressPolicyEnabledLocked(),
		labelsMap, deniedIngressIdentities, deniedEgressIdentities, proxyWaitGroup)
	return err, revert.RevertFunc(revertFunc)
}
903334
func validatePhysicalHostForCreation(h *crimson.PhysicalHost) error {
	switch {
	case h == nil:
		return status.Error(codes.InvalidArgument, "physical host specification is required")
	case h.Name == "":
		return status.Error(codes.InvalidArgument, "hostname is required and must be non-empty")
	case h.Vlan != 0:
		return status.Error(codes.InvalidArgument, "VLAN must not be specified, use IP address instead")
	case h.Machine == "":
		return status.Error(codes.InvalidArgument, "machine is required and must be non-empty")
	case h.Nic == "":
		return status.Error(codes.InvalidArgument, "NIC is required and must be non-empty")
	case h.MacAddress != "":
		return status.Error(codes.InvalidArgument, "MAC address must not be specified, use NIC instead")
	case h.Os == "":
		return status.Error(codes.InvalidArgument, "operating system is required and must be non-empty")
	case h.VmSlots < 0:
		return status.Error(codes.InvalidArgument, "VM slots must be non-negative")
	default:
		_, err := common.ParseIPv4(h.Ipv4)
		if err != nil {
			return status.Errorf(codes.InvalidArgument, "invalid IPv4 address %q", h.Ipv4)
		}
		return nil
	}
}
199545
func (s *NetworkService) NewRestartNetworkParams(id string) *RestartNetworkParams {
	p := &RestartNetworkParams{}
	p.p = make(map[string]interface{})
	p.p["id"] = id
	return p
}
704277
func (s *NetworkService) UpdateNetworkServiceProvider(p *UpdateNetworkServiceProviderParams) (*UpdateNetworkServiceProviderResponse, error) {
	resp, err := s.cs.newRequest("updateNetworkServiceProvider", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r UpdateNetworkServiceProviderResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			if err == AsyncTimeoutErr {
				return &r, err
			}
			return nil, err
		}

		b, err = getRawValue(b)
		if err != nil {
			return nil, err
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}

	return &r, nil
}
730626
func (s *UsageService) NewUpdateTrafficTypeParams(id string) *UpdateTrafficTypeParams {
	p := &UpdateTrafficTypeParams{}
	p.p = make(map[string]interface{})
	p.p["id"] = id
	return p
}
690047
func (s *AddressService) NewUpdateIpAddressParams(id string) *UpdateIpAddressParams {
	p := &UpdateIpAddressParams{}
	p.p = make(map[string]interface{})
	p.p["id"] = id
	return p
}
885853
func (s *NetworkOfferingService) NewDeleteNetworkOfferingParams(id string) *DeleteNetworkOfferingParams {
	p := &DeleteNetworkOfferingParams{}
	p.p = make(map[string]interface{})
	p.p["id"] = id
	return p
}
294933
func (d *namespacedResourcesDeleter) updateNamespaceStatusFunc(namespace *v1.Namespace) (*v1.Namespace, error) {
	if namespace.DeletionTimestamp.IsZero() || namespace.Status.Phase == v1.NamespaceTerminating {
		return namespace, nil
	}
	newNamespace := v1.Namespace{}
	newNamespace.ObjectMeta = namespace.ObjectMeta
	newNamespace.Status = namespace.Status
	newNamespace.Status.Phase = v1.NamespaceTerminating
	return d.nsClient.UpdateStatus(&newNamespace)
}
95683
func (s *NetworkACLService) NewUpdateNetworkACLListParams(id string) *UpdateNetworkACLListParams {
	p := &UpdateNetworkACLListParams{}
	p.p = make(map[string]interface{})
	p.p["id"] = id
	return p
}
677426
func (s *NetworkService) DeletePhysicalNetwork(p *DeletePhysicalNetworkParams) (*DeletePhysicalNetworkResponse, error) {
	resp, err := s.cs.newRequest("deletePhysicalNetwork", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r DeletePhysicalNetworkResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			if err == AsyncTimeoutErr {
				return &r, err
			}
			return nil, err
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}

	return &r, nil
}