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 Env resource
  • Loading branch information
joaodaher committed Jul 1, 2019
commit c6a98db33ac8de2f3250046e863262c5cdb95b65
2 changes: 2 additions & 0 deletions tsuru/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from tsuru.models import (
App,
Deploy,
Env,
)
from tsuru.exceptions import (
DoesNotExist,
Expand All @@ -15,6 +16,7 @@
__all__ = (
'App',
'Deploy',
'Env',
'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
@@ -1,6 +1,8 @@
from tsuru.models.app import App
from tsuru.models.deploy import Deploy
from tsuru.models.env import Env
__all__ = (
'App',
'Deploy',
'Env',
)
17 changes: 17 additions & 0 deletions tsuru/models/env.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from tsuru.models.base import UnsupportedModelMixin, BaseModel


class Env(UnsupportedModelMixin, BaseModel):
_RESOURCE_NAME = 'env'

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

@property
def value(self):
return self._get('value')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we handle the **** if the value is not public?


@property
def public(self):
return self._get('public')