-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refactor/implemet-crud-handlers-for-manager' of https:/…
…/github.com/lablup/backend.ai into refactor/implemet-crud-handlers-for-manager
- Loading branch information
Showing
4 changed files
with
289 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import uuid | ||
from typing import ( | ||
Protocol, | ||
Sequence, | ||
) | ||
|
||
from aiohttp import web | ||
|
||
from .types import ( | ||
CreatedResponseModel, | ||
Keypair, | ||
NoContentResponseModel, | ||
UserIdentity, | ||
VFolderCreateRequestModel, | ||
VFolderCreateRequirements, | ||
VFolderCreateResponseModel, | ||
VFolderDeleteRequestModel, | ||
VFolderList, | ||
VFolderListRequestModel, | ||
VFolderListResponseModel, | ||
VFolderMetadata, | ||
VFolderRenameRequestModel, | ||
) | ||
|
||
|
||
class VFolderHandlerProtocol(Protocol): | ||
async def create_vfolder( | ||
self, request: web.Request, params: VFolderCreateRequestModel | ||
) -> VFolderCreateResponseModel: ... | ||
|
||
async def list_vfolders( | ||
self, request: web.Request, params: VFolderListRequestModel | ||
) -> VFolderListResponseModel: ... | ||
|
||
async def rename_vfodler( | ||
self, request: web.Request, params: VFolderRenameRequestModel | ||
) -> CreatedResponseModel: ... | ||
|
||
async def delete_vfolder( | ||
self, request: web.Request, params: VFolderDeleteRequestModel | ||
) -> NoContentResponseModel: ... | ||
|
||
|
||
class VFolderServiceProtocol(Protocol): | ||
async def create_vfolder_in_personal( | ||
self, | ||
user_identity: UserIdentity, | ||
keypair: Keypair, | ||
vfolder_create_requirements: VFolderCreateRequirements, | ||
) -> VFolderMetadata: ... | ||
|
||
async def create_vfolder_in_group( | ||
self, | ||
user_identity: UserIdentity, | ||
keypair: Keypair, | ||
vfolder_create_requirements: VFolderCreateRequirements, | ||
) -> VFolderMetadata: ... | ||
|
||
async def get_vfolders(self, user_identity: UserIdentity) -> VFolderList: ... | ||
|
||
async def rename_vfolder( | ||
self, user_identity: UserIdentity, vfolder_id: uuid.UUID, new_name: str | ||
) -> None: ... | ||
|
||
async def delete_vfolder( | ||
self, | ||
vfolder_id: uuid.UUID, | ||
user_identity: UserIdentity, | ||
allowed_vfolder_types: Sequence[str], | ||
keypair: Keypair, | ||
) -> None: ... |
Oops, something went wrong.