code: func (lb *loadBalancer) createLoadBalancerRule(lbRuleName string, port v1.ServicePort) (*cloudstack.LoadBalancerRule, error) {
  	p := lb.LoadBalancer.NewCreateLoadBalancerRuleParams(
  		lb.algorithm,
  		lbRuleName,
  		int(port.NodePort),
  		int(port.Port),
  	)
  
  	p.SetNetworkid(lb.networkID)
  	p.SetPublicipid(lb.ipAddrID)
  
  	switch port.Protocol {
  	case v1.ProtocolTCP:
  		p.SetProtocol("TCP")
  	case v1.ProtocolUDP:
  		p.SetProtocol("UDP")
  	default:
  		return nil, fmt.Errorf("unsupported load balancer protocol: %v", port.Protocol)
  	}
  
  	// Do not create corresponding firewall rule.
  	p.SetOpenfirewall(false)
  
  	// Create a new load balancer rule.
  	r, err := lb.LoadBalancer.CreateLoadBalancerRule(p)
  	if err != nil {
  		return nil, fmt.Errorf("error creating load balancer rule %v: %v", lbRuleName, err)
  	}
  
  	lbRule := &cloudstack.LoadBalancerRule{
  		Id:          r.Id,
  		Algorithm:   r.Algorithm,
  		Cidrlist:    r.Cidrlist,
  		Name:        r.Name,
  		Networkid:   r.Networkid,
  		Privateport: r.Privateport,
  		Publicport:  r.Publicport,
  		Publicip:    r.Publicip,
  		Publicipid:  r.Publicipid,
  	}
  
  	return lbRule, nil
  }
docs: // createLoadBalancerRule creates a new load balancer rule and returns it's ID.