def apply_host_template(resource_root, name, cluster_name, host_ids, start_roles):
    '\n  Apply a host template identified by name on the specified hosts and\n  optionally start them.\n  @param resource_root: The root Resource object.\n  @param name: Host template name.\n  @param cluster_name: Cluster name.\n  @param host_ids: List of host ids.\n  @param start_roles: Whether to start the created roles or not.\n  @return: An ApiCommand object.\n  @since: API v3\n  '
    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)
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
def apply_host_template(resource_root, name, cluster_name, host_ids, start_roles):
    '\n  Apply a host template identified by name on the specified hosts and\n  optionally start them.\n  @param resource_root: The root Resource object.\n  @param name: Host template name.\n  @param cluster_name: Cluster name.\n  @param host_ids: List of host ids.\n  @param start_roles: Whether to start the created roles or not.\n  @return: An ApiCommand object.\n  @since: API v3\n  '
    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)