File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -888,6 +888,25 @@ async def reset(self, force=False):
888888 lambda : len (self .machines ) == 0
889889 )
890890
891+ async def create_storage_pool (self , name , provider_type , attributes = "" ):
892+ """Create or define a storage pool.
893+
894+ :param str name: a pool name
895+ :param str provider_type: provider type (defaults to "kubernetes" for
896+ Kubernetes models)
897+ :param str attributes: attributes for configuration as space-separated pairs,
898+ e.g. tags, size, path, etc.
899+ :return:
900+ """
901+ _attrs = [splt .split ("=" ) for splt in attributes .split ()]
902+
903+ storage_facade = client .StorageFacade .from_connection (self .connection )
904+ return await storage_facade .CreatePool (pools = [client .StoragePool (
905+ name = name ,
906+ provider = provider_type ,
907+ attrs = dict (_attrs )
908+ )])
909+
891910 async def remove_application (self , app_name , block_until_done = False ):
892911 """Removes the given application from the model.
893912
Original file line number Diff line number Diff line change @@ -43,9 +43,11 @@ def user(username):
4343def application (app_name ):
4444 return _prefix ('application-' , app_name )
4545
46+
4647def storage (app_name ):
4748 return _prefix ('storage-' , app_name )
4849
50+
4951def unit (unit_name ):
5052 return _prefix ('unit-' , unit_name .replace ('/' , '-' ))
5153
You can’t perform that action at this time.
0 commit comments