<reponame>JohannKT/cti-taxii-server

class Backend(object):

    def server_discovery(self):
        """
        Fill:

            Returns the discovery information (api_roots, etc) for this server

        Args:
                -none-

        Returns:
                discovery information

        """
        raise NotImplementedError()

    def get_collections(self, api_root):
        """
        Fill:

            implement the get_collections TAXII endpoint by obtaining the collection metadata
            for this api_root

        Args:

            api_root (str): the name of the api_root.

        Returns:

            metadata for all collections at this api root

        """
        raise NotImplementedError()

    def get_collection(self, api_root, collection_id):
        """
        Fill:

            implement the get_collection TAXII service by obtaining the collection metadata
            for collection

        Args:

            api_root (str): the name of the api_root.

            collection_id (str): the id of the collection

        Returns:

            collection metadata

        """
        raise NotImplementedError()

    def get_object_manifest(self, api_root, collection_id, filter_args, allowed_filters):
        """
        Fill:

            implement the get_object_manifest TAXII endpoint by obtaining the metadata
            for the selected objects

        Args:

            api_root (str): the name of the api_root.

            collection_id (str): the id of the collection

            filter_args (str):  query string from URL containing filter args

            allowed_filters (list):  STIX properties which are allowed in the filter for this endpoint

        Returns:

            metadata for the objects

        """
        raise NotImplementedError()

    def get_api_root_information(self, api_root):
        """
        Fill:

            implement the get_api_root_information TAXII endpoint by obtaining api_root metadata

        Args:

            api_root (str): the name of the api_root.

        Returns:

            metadata for the api root

        """
        raise NotImplementedError()

    def get_status(self, api_root, status_id):
        """
        Fill:

            implement the get_status TAXII endpoint by obtaining the status of an add_objects request

        Args:

            api_root (str): the name of the api_root.

            status_id (str): the id of the add_objects request

        Returns:

            status of the request (including):
                how many objects were successful saved
                how many objects failed to be saved
                how many objects are pending

        """
        raise NotImplementedError()

    def get_objects(self, api_root, collection_id, filter_args, allowed_filters):
        """
        Fill:

            implement the get_objects TAXII endpoint by obtaining the data from a collection

        Args:

            api_root (str): the name of the api_root.

            collection_id (str): the id of the collection

            filter_args (str):  query string from URL containing filter args

            allowed_filters (list):  STIX properties which are allowed in the filter for this endpoint

        Returns:

            data from the collection that satisfies the filter

        """
        raise NotImplementedError()

    def add_objects(self, api_root, collection_id, objs):
        """
        Fill:

            implement the add_objects TAXII endpoint by save data into a collection

        Args:

            api_root (str): the name of the api_root.

            collection_id (str): the id of the collection

            objs (list):  objects to insert into the collection

        Returns:

            status of the request (including):
                how many objects were successful saved
                how many objects failed to be saved
                how many objects are pending

        METADATA ABOUT EACH SUCCESSFUL OBJECT SAVED MUST BE AVAILABLE VIA THE get_object_manifest API CALL
        THIS CAN BE IMPLEMENTED AS A SEPARATE STORE, OTHERWISE IT NEEDS TO BE GENERATABLE DYNAMICALLY

        """
        raise NotImplementedError()

    def get_object(self, api_root, collection_id, object_id, filter_args, allowed_filters):
        """
        Fill:

            implement the get_object TAXII endpoint by obtaining the data from a collection related
            to the object_id

        Args:

            api_root (str): the name of the api_root.

            collection_id (str): the id of the collection

            object_id (str): the id of the requested object

            filter_args (str):  query string from URL containing filter args

            allowed_filters (list):  STIX properties which are allowed in the filter for this endpoint

        Returns:

            data from the collection that satisfies the filter

        """
        raise NotImplementedError()

class Backend(object):

    def server_discovery(self):
        """
        Fill:

            Returns the discovery information (api_roots, etc) for this server

        Args:
                -none-

        Returns:
                discovery information

        """
        raise NotImplementedError()

    def get_collections(self, api_root):
        """
        Fill:

            implement the get_collections TAXII endpoint by obtaining the collection metadata
            for this api_root

        Args:

            api_root (str): the name of the api_root.

        Returns:

            metadata for all collections at this api root

        """
        raise NotImplementedError()

    def get_collection(self, api_root, collection_id):
        """
        Fill:

            implement the get_collection TAXII service by obtaining the collection metadata
            for collection

        Args:

            api_root (str): the name of the api_root.

            collection_id (str): the id of the collection

        Returns:

            collection metadata

        """
        raise NotImplementedError()

    def get_object_manifest(self, api_root, collection_id, filter_args, allowed_filters):
        """
        Fill:

            implement the get_object_manifest TAXII endpoint by obtaining the metadata
            for the selected objects

        Args:

            api_root (str): the name of the api_root.

            collection_id (str): the id of the collection

            filter_args (str):  query string from URL containing filter args

            allowed_filters (list):  STIX properties which are allowed in the filter for this endpoint

        Returns:

            metadata for the objects

        """
        raise NotImplementedError()

    def get_api_root_information(self, api_root):
        """
        Fill:

            implement the get_api_root_information TAXII endpoint by obtaining api_root metadata

        Args:

            api_root (str): the name of the api_root.

        Returns:

            metadata for the api root

        """
        raise NotImplementedError()

    def get_status(self, api_root, status_id):
        """
        Fill:

            implement the get_status TAXII endpoint by obtaining the status of an add_objects request

        Args:

            api_root (str): the name of the api_root.

            status_id (str): the id of the add_objects request

        Returns:

            status of the request (including):
                how many objects were successful saved
                how many objects failed to be saved
                how many objects are pending

        """
        raise NotImplementedError()

    def get_objects(self, api_root, collection_id, filter_args, allowed_filters):
        """
        Fill:

            implement the get_objects TAXII endpoint by obtaining the data from a collection

        Args:

            api_root (str): the name of the api_root.

            collection_id (str): the id of the collection

            filter_args (str):  query string from URL containing filter args

            allowed_filters (list):  STIX properties which are allowed in the filter for this endpoint

        Returns:

            data from the collection that satisfies the filter

        """
        raise NotImplementedError()

    def add_objects(self, api_root, collection_id, objs):
        """
        Fill:

            implement the add_objects TAXII endpoint by save data into a collection

        Args:

            api_root (str): the name of the api_root.

            collection_id (str): the id of the collection

            objs (list):  objects to insert into the collection

        Returns:

            status of the request (including):
                how many objects were successful saved
                how many objects failed to be saved
                how many objects are pending

        METADATA ABOUT EACH SUCCESSFUL OBJECT SAVED MUST BE AVAILABLE VIA THE get_object_manifest API CALL
        THIS CAN BE IMPLEMENTED AS A SEPARATE STORE, OTHERWISE IT NEEDS TO BE GENERATABLE DYNAMICALLY

        """
        raise NotImplementedError()

    def get_object(self, api_root, collection_id, object_id, filter_args, allowed_filters):
        """
        Fill:

            implement the get_object TAXII endpoint by obtaining the data from a collection related
            to the object_id

        Args:

            api_root (str): the name of the api_root.

            collection_id (str): the id of the collection

            object_id (str): the id of the requested object

            filter_args (str):  query string from URL containing filter args

            allowed_filters (list):  STIX properties which are allowed in the filter for this endpoint

        Returns:

            data from the collection that satisfies the filter

        """
        raise NotImplementedError()
Fill:              Returns the discovery information (api_roots, etc) for this server          Args:                 -none-          Returns:                 discovery information Fill:              implement the get_collections TAXII endpoint by obtaining the collection metadata             for this api_root          Args:              api_root (str): the name of the api_root.          Returns:              metadata for all collections at this api root Fill:              implement the get_collection TAXII service by obtaining the collection metadata             for collection          Args:              api_root (str): the name of the api_root.              collection_id (str): the id of the collection          Returns:              collection metadata Fill:              implement the get_object_manifest TAXII endpoint by obtaining the metadata             for the selected objects          Args:              api_root (str): the name of the api_root.              collection_id (str): the id of the collection              filter_args (str):  query string from URL containing filter args              allowed_filters (list):  STIX properties which are allowed in the filter for this endpoint          Returns:              metadata for the objects Fill:              implement the get_api_root_information TAXII endpoint by obtaining api_root metadata          Args:              api_root (str): the name of the api_root.          Returns:              metadata for the api root Fill:              implement the get_status TAXII endpoint by obtaining the status of an add_objects request          Args:              api_root (str): the name of the api_root.              status_id (str): the id of the add_objects request          Returns:              status of the request (including):                 how many objects were successful saved                 how many objects failed to be saved                 how many objects are pending Fill:              implement the get_objects TAXII endpoint by obtaining the data from a collection          Args:              api_root (str): the name of the api_root.              collection_id (str): the id of the collection              filter_args (str):  query string from URL containing filter args              allowed_filters (list):  STIX properties which are allowed in the filter for this endpoint          Returns:              data from the collection that satisfies the filter Fill:              implement the add_objects TAXII endpoint by save data into a collection          Args:              api_root (str): the name of the api_root.              collection_id (str): the id of the collection              objs (list):  objects to insert into the collection          Returns:              status of the request (including):                 how many objects were successful saved                 how many objects failed to be saved                 how many objects are pending          METADATA ABOUT EACH SUCCESSFUL OBJECT SAVED MUST BE AVAILABLE VIA THE get_object_manifest API CALL         THIS CAN BE IMPLEMENTED AS A SEPARATE STORE, OTHERWISE IT NEEDS TO BE GENERATABLE DYNAMICALLY Fill:              implement the get_object TAXII endpoint by obtaining the data from a collection related             to the object_id          Args:              api_root (str): the name of the api_root.              collection_id (str): the id of the collection              object_id (str): the id of the requested object              filter_args (str):  query string from URL containing filter args              allowed_filters (list):  STIX properties which are allowed in the filter for this endpoint          Returns:              data from the collection that satisfies the filter