def add_filter(self, server_id, source_namespace, query,
                   query_language=DEFAULT_QUERY_LANGUAGE, owned=True,
                   filter_id=None, name=None):
        """
        Add a :term:`dynamic indication filter` to a WBEM server, by creating
        an indication filter instance (of CIM class "CIM_IndicationFilter") in
        the Interop namespace of the server.

        The `Name` property of the created filter instance can be set in one
        of two ways:

        * directly by specifying the `name` parameter.

          In this case, the `Name` property is set directly to the `name`
          parameter.

          This should be used in cases where the user needs to have control
          over the filter name (e.g. because a DMTF management profile
          requires a particular name), but it cannot be used for owned
          filters.

        * indirectly by specifying the `filter_id` parameter.

          In this case, the value of the `Name` property will be:

          ``"pywbemfilter:" {ownership} ":" {subscription_manager_id} ":"
          {filter_id} ":" {guid}``

          where
          ``{ownership}`` is ``"owned"`` or ``"permanent"`` dependent on
          whether the filter is owned or permmanent;
          ``{subscription_manager_id}`` is the subscription manager ID;
          ``{filter_id}`` is the filter ID; and
          ``{guid}`` is a globally unique identifier.

          This can be used for both owned and permanent filters.

        Owned indication filters are added or updated conditionally: If the
        indication filter instance to be added is already registered with
        this subscription manager and has the same property values, it is not
        created or modified. If it has the same path but different property
        values, it is modified to get the desired property values. If an
        instance with this path does not exist yet (the normal case), it is
        created.

        Permanent indication filters are created unconditionally, and it is
        up to the user to ensure that such an instance does not exist yet.

        Parameters:

          server_id (:term:`string`):
            The server ID of the WBEM server, returned by
            :meth:`~pywbem.WBEMSubscriptionManager.add_server`.

          source_namespace (:term:`string`):
            Source namespace of the indication filter.

          query (:term:`string`):
            Filter query in the specified query language.

          query_language (:term:`string`):
            Query language for the specified filter query.

            Examples: 'WQL', 'DMTF:CQL'.

          owned (:class:`py:bool`):
            Defines the ownership type of the created indication filter
            instance: If `True`, it will be owned. Otherwise, it will be
            permanent. See :ref:`WBEMSubscriptionManager` for details about
            these ownership types.

          filter_id (:term:`string`)
            A filter ID string that is used as a component in the value of the
            `Name` property of filter instances to help the user identify
            these instances in a WBEM server, or `None` if the `name`
            parameter is specified.

            The string must consist of printable characters, and must not
            contain the character ':' because that is the separator between
            components within the value of the `Name` property.

            There is no requirement that the filter ID be unique. This can be
            used to identify groups of filters by using the same value for
            multiple filters.

          name (:term:`string`)
            *New in pywbem 0.10.*

            The filter name to be used directly for the `Name` property of the
            filter instance, or `None` if the `filter_id` parameter is
            specified.

        Returns:

            :class:`~pywbem.CIMInstance`: The created indication filter
            instance.

        Raises:

            Exceptions raised by :class:`~pywbem.WBEMConnection`.
            ValueError: Incorrect input parameter values.
            TypeError: Incorrect input parameter types.
        """

        # server_id is validated in _create_...() method.

        if filter_id is None and name is None:
            raise ValueError("The filter_id and name parameters are both "
                             "None, but exactly one of them must be specified")
        if filter_id is not None:
            if name is not None:
                raise ValueError("The filter_id and name parameters are both "
                                 "specified, but only one of them must be "
                                 "specified")
            if not isinstance(filter_id, six.string_types):
                raise TypeError(
                    _format("Invalid type for filter ID: {0!A}", filter_id))
            if ':' in filter_id:
                raise ValueError(
                    _format("Filter ID contains ':': {0!A}", filter_id))

        filter_inst = self._create_filter(server_id, source_namespace, query,
                                          query_language, owned, filter_id,
                                          name)

        return filter_inst
Add a :term:`dynamic indication filter` to a WBEM server, by creating
        an indication filter instance (of CIM class "CIM_IndicationFilter") in
        the Interop namespace of the server.

        The `Name` property of the created filter instance can be set in one
        of two ways:

        * directly by specifying the `name` parameter.

          In this case, the `Name` property is set directly to the `name`
          parameter.

          This should be used in cases where the user needs to have control
          over the filter name (e.g. because a DMTF management profile
          requires a particular name), but it cannot be used for owned
          filters.

        * indirectly by specifying the `filter_id` parameter.

          In this case, the value of the `Name` property will be:

          ``"pywbemfilter:" {ownership} ":" {subscription_manager_id} ":"
          {filter_id} ":" {guid}``

          where
          ``{ownership}`` is ``"owned"`` or ``"permanent"`` dependent on
          whether the filter is owned or permmanent;
          ``{subscription_manager_id}`` is the subscription manager ID;
          ``{filter_id}`` is the filter ID; and
          ``{guid}`` is a globally unique identifier.

          This can be used for both owned and permanent filters.

        Owned indication filters are added or updated conditionally: If the
        indication filter instance to be added is already registered with
        this subscription manager and has the same property values, it is not
        created or modified. If it has the same path but different property
        values, it is modified to get the desired property values. If an
        instance with this path does not exist yet (the normal case), it is
        created.

        Permanent indication filters are created unconditionally, and it is
        up to the user to ensure that such an instance does not exist yet.

        Parameters:

          server_id (:term:`string`):
            The server ID of the WBEM server, returned by
            :meth:`~pywbem.WBEMSubscriptionManager.add_server`.

          source_namespace (:term:`string`):
            Source namespace of the indication filter.

          query (:term:`string`):
            Filter query in the specified query language.

          query_language (:term:`string`):
            Query language for the specified filter query.

            Examples: 'WQL', 'DMTF:CQL'.

          owned (:class:`py:bool`):
            Defines the ownership type of the created indication filter
            instance: If `True`, it will be owned. Otherwise, it will be
            permanent. See :ref:`WBEMSubscriptionManager` for details about
            these ownership types.

          filter_id (:term:`string`)
            A filter ID string that is used as a component in the value of the
            `Name` property of filter instances to help the user identify
            these instances in a WBEM server, or `None` if the `name`
            parameter is specified.

            The string must consist of printable characters, and must not
            contain the character ':' because that is the separator between
            components within the value of the `Name` property.

            There is no requirement that the filter ID be unique. This can be
            used to identify groups of filters by using the same value for
            multiple filters.

          name (:term:`string`)
            *New in pywbem 0.10.*

            The filter name to be used directly for the `Name` property of the
            filter instance, or `None` if the `filter_id` parameter is
            specified.

        Returns:

            :class:`~pywbem.CIMInstance`: The created indication filter
            instance.

        Raises:

            Exceptions raised by :class:`~pywbem.WBEMConnection`.
            ValueError: Incorrect input parameter values.
            TypeError: Incorrect input parameter types.