def apply_host_template(self, host_ids, start_roles):
    """
    Apply a host template identified by name on the specified hosts and
    optionally start them.
    @param host_ids: List of host ids.
    @param start_roles: Whether to start the created roles or not.
    @return: An ApiCommand object.
    """
    return apply_host_template(self._get_resource_root(), self.name, self.clusterRef.clusterName, host_ids, start_roles)