code: def apply_host_template(resource_root, name, cluster_name, host_ids, start_roles):
    
    host_refs = []
    for host_id in host_ids:
      host_refs.append(ApiHostRef(resource_root, host_id))
  
    params = {"startRoles" : start_roles}
    return call(resource_root.post,
        APPLY_HOST_TEMPLATE_PATH % (cluster_name, name),
        ApiCommand, data=host_refs, params=params, api_version=3)
docs: Apply a host template identified by name on the specified hosts and
    optionally start them.
    @param resource_root: The root Resource object.
    @param name: Host template name.
    @param cluster_name: Cluster name.
    @param host_ids: List of host ids.
    @param start_roles: Whether to start the created roles or not.
    @return: An ApiCommand object.
    @since: API v3