Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status should be available for GSLBRegionPoolEntry objects #132

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions dyn/tm/services/gslb.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ def __init__(self, zone, fqdn, region_code, address, *args, **kwargs):
self._address = address
self._label = self._weight = self._serve_mode = None
self._task_id = None
self._status = None

uri = '/GSLBRegionPoolEntry/{}/{}/{}/{}/'
self.uri = uri.format(self._zone, self._fqdn, self._region_code,
Expand Down Expand Up @@ -409,8 +410,17 @@ def to_json(self):
output['weight'] = self._weight
if self._serve_mode:
output['serve_mode'] = self._serve_mode
if self._status:
output['status'] = self._status
return output

@property
def status(self):
"""The current state of the pool entry. Will be one of 'unk', 'up',
or 'down'
"""
return self._status

def delete(self):
"""Delete this :class:`GSLBRegionPoolEntry` from the DynECT System"""
api_args = {}
Expand Down