diff --git a/iam/resource/provider.py b/iam/resource/provider.py index c7718e5..9dc5b08 100644 --- a/iam/resource/provider.py +++ b/iam/resource/provider.py @@ -72,3 +72,11 @@ def list_instance_by_policy(self, filter, page, **options): return: ListResult """ raise NotImplementedError() + + @abc.abstractmethod + def search_instance(self, filter, page, **options): + """ + 处理来自 iam 的 search_instance 请求 + return: ListResult + """ + raise NotImplementedError() diff --git a/tests/contrib/django/dispatcher/test_dispatchers.py b/tests/contrib/django/dispatcher/test_dispatchers.py index 766a576..9e92439 100644 --- a/tests/contrib/django/dispatcher/test_dispatchers.py +++ b/tests/contrib/django/dispatcher/test_dispatchers.py @@ -50,6 +50,9 @@ def fetch_instance_info(self, filter, **options): def list_instance_by_policy(self, filter, page, **options): return ListResult(results=[filter, page], count=100) + def search_instance(self, filter, page, **options): + return ListResult(results=[filter, page], count=100) + with pytest.raises(AuthInvalidOperation): dispatcher.register("type", "provider")