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 Platform resource
  • Loading branch information
joaodaher committed Jul 1, 2019
commit e76609f05cf511ae6b22a562b121e92273506665
2 changes: 2 additions & 0 deletions tsuru/__init__.py
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
Lock,
Log,
Plan,
Platform,
)
from tsuru.exceptions import (
DoesNotExist,
@@ -23,6 +24,7 @@
'Lock',
'Log',
'Plan',
'Platform',
'DoesNotExist',
'UnexpectedDataFormat',
'UnsupportedModelException',
2 changes: 2 additions & 0 deletions tsuru/models/__init__.py
Original file line number Diff line number Diff line change
@@ -4,11 +4,13 @@
from tsuru.models.lock import Lock
from tsuru.models.log import Log
from tsuru.models.plan import Plan
from tsuru.models.platform import Platform
__all__ = (
'App',
'Deploy',
'Env',
'Lock',
'Log',
'Plan',
'Platform',
)
14 changes: 14 additions & 0 deletions tsuru/models/platform.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from tsuru.models.base import BaseModel


class Platform(BaseModel):
_RESOURCE_NAME = 'platforms'
_PK_FIELD = 'Name'

@property
def name(self):
return self._get('Name')

@property
def is_enabled(self):
return not self._get('Disabled')