Skip to content

Commit

Permalink
minor:ResourceProvider添加search_instance抽象方法 (#48)
Browse files Browse the repository at this point in the history
* minor:ResourceProvider添加search_instance抽象方法
  • Loading branch information
Core authored Aug 18, 2021
1 parent b2734a0 commit c6255fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions iam/resource/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
3 changes: 3 additions & 0 deletions tests/contrib/django/dispatcher/test_dispatchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit c6255fe

Please sign in to comment.