code: func (lb *loadBalancer) assignHostsToRule(lbRule *cloudstack.LoadBalancerRule, hostIDs []string) error {
  	p := lb.LoadBalancer.NewAssignToLoadBalancerRuleParams(lbRule.Id)
  	p.SetVirtualmachineids(hostIDs)
  
  	if _, err := lb.LoadBalancer.AssignToLoadBalancerRule(p); err != nil {
  		return fmt.Errorf("error assigning hosts to load balancer rule %v: %v", lbRule.Name, err)
  	}
  
  	return nil
  }
docs: // assignHostsToRule assigns hosts to a load balancer rule.