storage/v2: reset

This commit is contained in:
Dan Bungert 2021-09-21 11:35:48 -06:00
parent f6c3eb8a43
commit f4e07e8aba
2 changed files with 8 additions and 0 deletions

View File

@ -246,6 +246,9 @@ class API:
class guided: class guided:
def POST(choice: GuidedChoice) -> StorageResponseV2: ... def POST(choice: GuidedChoice) -> StorageResponseV2: ...
class reset:
def POST() -> StorageResponseV2: ...
class reformat_disk: class reformat_disk:
def POST(disk_id: str) -> StorageResponseV2: ... def POST(disk_id: str) -> StorageResponseV2: ...

View File

@ -304,6 +304,11 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
async def v2_POST(self): async def v2_POST(self):
await self.configured() await self.configured()
async def v2_reset_POST(self) -> StorageResponseV2:
log.info("Resetting Filesystem model")
self.model.reset()
return await self.v2_GET()
async def v2_guided_POST(self, choice: GuidedChoice) -> StorageResponseV2: async def v2_guided_POST(self, choice: GuidedChoice) -> StorageResponseV2:
self.guided(choice) self.guided(choice)
return await self.v2_GET() return await self.v2_GET()