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

Commit

Permalink
Add support to Platform resource
Browse files Browse the repository at this point in the history
  • Loading branch information
joaodaher committed Jun 28, 2019
1 parent 25289e2 commit e930e0f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tsuru/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Lock,
Log,
Plan,
Platform,
)
from tsuru.exceptions import (
DoesNotExist,
Expand All @@ -23,6 +24,7 @@
'Lock',
'Log',
'Plan',
'Platform',
'DoesNotExist',
'UnexpectedDataFormat',
'UnsupportedModelException',
Expand Down
2 changes: 2 additions & 0 deletions tsuru/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

0 comments on commit e930e0f

Please sign in to comment.