Skip to content

Commit

Permalink
PullRequest: 26 chore: fmt
Browse files Browse the repository at this point in the history
Merge branch fmt of [email protected]:oceanbase/OBShell-SDK-Python.git into master
https://code.alipay.com/oceanbase/OBShell-SDK-Python/pull_requests/26

Signed-off-by: 阿绿 <[email protected]>


* chore: fmt
  • Loading branch information
Junkrat77 committed Oct 16, 2024
1 parent df3438b commit 0e3732e
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions obshell/model/ob.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ def from_dict(cls, data: dict):
def __str__(self) -> str:
return model_str(self)


class CdbObBackupTask:

def __init__(self, data: dict):
self.tenant_id = data.get("tenant_id")
self.task_id = data.get("task_id")
Expand Down Expand Up @@ -68,36 +69,38 @@ def __init__(self, data: dict):
self.result = data.get("result")
self.comment = data.get("comment")
self.path = data.get("path")

@classmethod
def from_dict(cls, data: dict):
return CdbObBackupTask(data)

def __str__(self) -> str:
return model_str(self)


class CdbObBackupResponse:

def __init__(self, data: dict):
if data.get("statuses"):
self.statuses = [CdbObBackupTask.from_dict(task) for task in data.get('statuses', [])]
self.statuses = [CdbObBackupTask.from_dict(
task) for task in data.get('statuses', [])]
if data.get("status"):
self.status = data.get("status")

@classmethod
def from_dict(cls, data: dict):
return cls(data)

def __str__(self) -> str:
return model_str(self)

class RestoreOverview:


class RestoreOverview:

def __init__(self, data: dict):
self.tenant_id = data.get("tenant_id")
self.job_id = data.get("job_id")
self.restore_tenant_name = data.get("restore_tenant_name")
self.restore_tenant_name = data.get("restore_tenant_name")
self.restore_tenant_id = data.get("restore_tenant_id")
self.backup_tenant_name = data.get("backup_tenant_name")
self.backup_tenant_id = data.get("backup_tenant_id")
Expand Down Expand Up @@ -126,11 +129,10 @@ def __init__(self, data: dict):
self.finish_ls_count = data.get("finish_ls_count")
self.comment = data.get("comment")
self.finish_timestamp = data.get("finish_timestamp")

@classmethod
def from_dict(cls, data: dict):
return RestoreOverview(data)

def __str__(self) -> str:
return model_str(self)

0 comments on commit 0e3732e

Please sign in to comment.