Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Initial Version #2

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Add support to Lock resource
  • Loading branch information
joaodaher committed Jul 1, 2019
commit 30ca7cdd4541962d5e7fa50ec4fb671a531d9e3b
2 changes: 2 additions & 0 deletions tsuru/__init__.py
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
App,
Deploy,
Env,
Lock,
)
from tsuru.exceptions import (
DoesNotExist,
@@ -17,6 +18,7 @@
'App',
'Deploy',
'Env',
'Lock',
'DoesNotExist',
'UnexpectedDataFormat',
'UnsupportedModelException',
2 changes: 2 additions & 0 deletions tsuru/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from tsuru.models.app import App
from tsuru.models.deploy import Deploy
from tsuru.models.env import Env
from tsuru.models.lock import Lock
__all__ = (
'App',
'Deploy',
'Env',
'Lock',
)
22 changes: 22 additions & 0 deletions tsuru/models/lock.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from tsuru.models.base import UnsupportedModelMixin, BaseModel


class Lock(UnsupportedModelMixin, BaseModel):
_RESOURCE_NAME = 'locks'

@property
def locked(self):
return self._get('Locked')

@property
def reason(self):
return self._get('Reason')

@property
def owner(self):
return self._get('Owner')

@property
def acquire_date(self):
date_str = self._get('AcquireDate')
return self._parse_date(date_str=date_str)