Skip to content

Commit 86c987a

Browse files
authored
refactor: update StorageDomain.py
1 parent 74e4c49 commit 86c987a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

naas_python/domains/storage/StorageDomain.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self, adaptor: IStorageAdaptor, storage_provider_adaptors : Mapping
1818
self.storage_provider_adaptors : Mapping[str, IStorageProviderAdaptor] = storage_provider_adaptors
1919

2020
############### API ###############
21-
def create_workspace_storage(self,
21+
def create(self,
2222
workspace_id: str,
2323
storage_name: Storage.__fields__['name'],
2424
) -> dict:
@@ -28,7 +28,7 @@ def create_workspace_storage(self,
2828
)
2929
return response
3030

31-
def delete_workspace_storage(self,
31+
def delete(self,
3232
workspace_id: str,
3333
storage_name: Storage.__fields__['name']
3434
) -> dict:
@@ -38,15 +38,15 @@ def delete_workspace_storage(self,
3838
)
3939
return response
4040

41-
def list_workspace_storage(self,
41+
def list(self,
4242
workspace_id: str,
4343
) -> dict:
4444
response = self.adaptor.list_workspace_storage(
4545
workspace_id=workspace_id,
4646
)
4747
return response
4848

49-
def list_workspace_storage_object(self,
49+
def list_objects(self,
5050
workspace_id: str,
5151
storage_name: Storage.__fields__['name'],
5252
storage_prefix: Object.__fields__['prefix'],
@@ -58,7 +58,7 @@ def list_workspace_storage_object(self,
5858
)
5959
return response
6060

61-
def delete_workspace_storage_object(self,
61+
def delete_object(self,
6262
workspace_id: str,
6363
storage_name: Storage.__fields__['name'],
6464
object_name: Object.__fields__['name'],
@@ -70,7 +70,7 @@ def delete_workspace_storage_object(self,
7070
)
7171
return response
7272

73-
def create_workspace_storage_credentials(self,
73+
def create_credentials(self,
7474
workspace_id: str,
7575
storage_name: Storage.__fields__['name'],
7676
) -> dict:
@@ -96,7 +96,7 @@ def __get_storage_provider_adaptor(self,
9696
return self.storage_provider_adaptors[storage_provider_id]
9797

9898

99-
def post_workspace_storage_object(self,
99+
def post_object(self,
100100
workspace_id: str,
101101
storage_name: Storage.__fields__['name'],
102102
src_file: str,
@@ -117,7 +117,7 @@ def post_workspace_storage_object(self,
117117
response = storage_provider.post_workspace_storage_object(workspace_id=workspace_id, storage_name=storage_name, src_file=src_file, dst_file=dst_file)
118118
return response
119119

120-
def get_workspace_storage_object(self,
120+
def get_object(self,
121121
workspace_id: str,
122122
storage_name: Storage.__fields__['name'],
123123
src_file: str,
@@ -136,4 +136,4 @@ def get_workspace_storage_object(self,
136136
storage_provider.save_naas_credentials(workspace_id, storage_name, credentials)
137137

138138
response = storage_provider.get_workspace_storage_object(workspace_id=workspace_id, storage_name=storage_name, src_file=src_file, dst_file=dst_file)
139-
return response
139+
return response

0 commit comments

Comments
 (0)