Beispiel #1
0
    def delete_project_by_name(self, project_name) -> Status:
        """
        Delete the registered project by project name .

        :param project_name: the project name
        :return: Status.OK if the project is successfully deleted, Status.ERROR if the project does not exist otherwise.
        """
        request = metadata_service_pb2.NameRequest(name=project_name)
        response = self.metadata_store_stub.deleteProjectByName(request)
        return _unwrap_delete_response(response)
Beispiel #2
0
 def get_project_by_name(self, project_name) -> Optional[ProjectMeta]:
     """
     get a specific project in metadata store by project name
     :param project_name: the project name
     :return: A single :py:class:`ai_flow.meta.project.ProjectMeta` object if the project exists,
              Otherwise, returns None if the project does not exist.
     """
     request = metadata_service_pb2.NameRequest(name=project_name)
     response = self.metadata_store_stub.getProjectByName(request)
     return _unwrap_project_response(response)
Beispiel #3
0
    def delete_model_relation_by_name(self, model_name) -> Status:
        """
        Delete the registered model by model name .

        :param model_name: the model name
        :return: Status.OK if the model is successfully deleted, Status.ERROR if the model does not exist otherwise.
        """
        request = metadata_service_pb2.NameRequest(name=model_name)
        response = self.metadata_store_stub.deleteModelRelationByName(request)
        return _unwrap_delete_response(response)
Beispiel #4
0
    def delete_dataset_by_name(self, dataset_name) -> Status:
        """
        Delete the registered dataset by dataset name .

        :param dataset_name: the dataset name
        :return: Status.OK if the dataset is successfully deleted, Status.ERROR if the dataset does not exist otherwise.
        """
        request = metadata_service_pb2.NameRequest(name=dataset_name)
        response = self.metadata_store_stub.deleteDatasetByName(request)
        return _unwrap_delete_response(response)
Beispiel #5
0
    def get_artifact_by_name(self, artifact_name) -> Optional[ArtifactMeta]:
        """
        get a specific artifact in metadata store by artifact name.

        :param artifact_name: the artifact name
        :return: A single :py:class:`ai_flow.meta.artifact_meta.ArtifactMeta` object
                 if the artifact exists, Otherwise, returns None if the artifact does not exist.
        """
        request = metadata_service_pb2.NameRequest(name=artifact_name)
        response = self.metadata_store_stub.getArtifactByName(request)
        return _unwrap_artifact_response(response)
Beispiel #6
0
    def get_dataset_by_name(self, dataset_name) -> Optional[DatasetMeta]:
        """
        get a specific dataset in metadata store by dataset name.

        :param dataset_name: the dataset name
        :return: A single :py:class:`ai_flow.meta.dataset_meta.DatasetMeta` object if the dataset exists,,
                 Otherwise, returns None if the dataset does not exist.
        """
        request = metadata_service_pb2.NameRequest(name=dataset_name)
        response = self.metadata_store_stub.getDatasetByName(request)
        return _unwrap_dataset_response(response)
Beispiel #7
0
    def get_model_by_name(self, model_name) -> Optional[ModelMeta]:
        """
        get a specific model in metadata store by model name.

        :param model_name: Name of registered model
        :return: A single :py:class:`ai_flow.meta.model_meta.ModelMeta` object if the model relation exists,
        Otherwise, returns None if the model relation does not exist.
        """
        request = metadata_service_pb2.NameRequest(name=model_name)
        response = self.metadata_store_stub.getModelByName(request)
        return _unwrap_model_response(response)