Skip to content

Commit 27088e1

Browse files
author
mhowes
committed
doc improvements, unicode support for IDs
1 parent a736484 commit 27088e1

File tree

3 files changed

+26
-13
lines changed

3 files changed

+26
-13
lines changed

docs/tm/services/dsf.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@ The following function is primarily a helper function which performs an API
1515

1616
.. autofunction:: dyn.tm.services.dsf.get_all_dsf_monitors
1717

18+
.. autofunction:: dyn.tm.services.dsf.get_all_notifiers
19+
20+
.. autofunction:: dyn.tm.services.dsf.get_all_records
21+
22+
.. autofunction:: dyn.tm.services.dsf.get_all_record_sets
23+
24+
.. autofunction:: dyn.tm.services.dsf.get_all_failover_chains
25+
26+
.. autofunction:: dyn.tm.services.dsf.get_all_response_pools
27+
28+
.. autofunction:: dyn.tm.services.dsf.get_all_rulesets
29+
30+
1831
Classes
1932
-------
2033
.. toctree::

docs/tm/services/dsf/dsf.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ dyn.tm System and how to edit some of the fields using the returned
804804
>>> #Now, lets create a Node object. This is used for attaching the service to a Node (or zone)
805805
>>> node = Node('example.com',fqdn = 'example.com.')
806806
>>>
807-
>>> Finally, we pass all of this in. upon command execution the service will have been created.
807+
>>> #Finally, we pass all of this in. upon command execution the service will have been created.
808808
>>>
809809
>>> dsf = TrafficDirector('Test_Service', rulesets=[ruleset], nodes=[node], notifiers=[notifier])
810810

@@ -831,7 +831,7 @@ Traffic Director SDK Caveats
831831
* Creating a fully populated service with prototypes leaves the prototypes unusable.
832832
CRUD capabilities can only be achieved by accessing data within the
833833
:class:`TrafficDirector` object.
834-
Accessors are `records`, `record_sets`, `failover_chains`, `response_pools`, `rulesets`
834+
Accessors are :param:`records`, :mod:`record_sets`, `failover_chains`, `response_pools`, `rulesets`
835835

836836
* Accessors like in the previous bullet point only work if the object is fully linked to the service.
837837
In other words, you can have a full response_pool, but if it does not belong to a ruleset, then it will
@@ -843,13 +843,13 @@ Traffic Director SDK Caveats
843843
This is becasue these record trees are built from the ruleset, and if one response pool belongs to multiple
844844
Rulesets, then its children will appear as many times as is exists as a ruleset member.
845845

846-
* :param refresh(): is your friend. When modifying child objects from a parent sometimes the parent doesn't know about
846+
* :param:`refresh()` is your friend. When modifying child objects from a parent sometimes the parent doesn't know about
847847
the changes. If you do a refresh() on the :class:`TrafficDirector` object it will pull down the latest data
848848
from the Dynect System.
849849

850-
* :param publish(): is run on the :class:`TrafficDirector` as a whole, even when run from a child object.
850+
* :param:`publish()` is run on the :class:`TrafficDirector` as a whole, even when run from a child object.
851851

852-
* :param implicitPublish: is non cascading. It is locally bound to the specific object, or child object.
852+
* :param:`implicitPublish` is non cascading. It is locally bound to the specific object, or child object.
853853

854854

855855

dyn/tm/services/dsf.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def get_all_dsf_monitors():
129129
def _checkType(service):
130130
if isinstance(service, TrafficDirector):
131131
_service_id = service.service_id
132-
elif type(service) is str:
132+
elif type(service) is str or type(service) is unicode:
133133
_service_id = service
134134
else:
135135
raise Exception('Value must be string, or TrafficDirector Object')
@@ -309,7 +309,7 @@ def add_to_record_set(self, record_set, service = None, publish = True):
309309
if isinstance(record_set, DSFRecordSet):
310310
_record_set_id = record_set._dsf_record_set_id
311311
_service_id = record_set._service_id
312-
elif type(record_set) is str:
312+
elif type(record_set) is str or type(record_set) is unicode:
313313
if service is None:
314314
raise Exception('When record_set as a string, you must provide the service_id as service=')
315315
_record_set_id = record_set
@@ -1549,7 +1549,7 @@ def add_to_failover_chain(self, failover_chain, service=None, publish=True):
15491549
if isinstance(failover_chain, DSFFailoverChain):
15501550
_dsf_record_set_failover_chain_id = failover_chain._dsf_record_set_failover_chain_id
15511551
_service_id = failover_chain._service_id
1552-
elif type(failover_chain) is str:
1552+
elif type(failover_chain) is str or type(failover_chain) is unicode:
15531553
if service is None:
15541554
raise Exception('If passing failover_chain as a string, you must provide the service_id as service=')
15551555
_dsf_record_set_failover_chain_id = failover_chain
@@ -1715,7 +1715,7 @@ def set_monitor(self, monitor):
17151715
"""
17161716
if isinstance(monitor, DSFMonitor):
17171717
_monitor_id = monitor._dsf_monitor_id
1718-
elif type(monitor) is str:
1718+
elif type(monitor) is str or type(monitor) is unicode:
17191719
_monitor_id = monitor
17201720
else:
17211721
raise Exception('Could not make sense of Monitor Type')
@@ -1919,7 +1919,7 @@ def add_to_response_pool(self, response_pool, service=None, publish=True):
19191919
if isinstance(response_pool, DSFResponsePool):
19201920
_response_pool_id = response_pool._dsf_response_pool_id
19211921
_service_id = response_pool._service_id
1922-
elif type(response_pool) is str:
1922+
elif type(response_pool) is str or type(response_pool) is unicode:
19231923
if service is None:
19241924
raise Exception('If passing response_pool as a string, you must provide the service_id as service=')
19251925
_response_pool_id = response_pool
@@ -2397,7 +2397,7 @@ def add_response_pool(self, response_pool, index=0, publish=True):
23972397
"""
23982398
if isinstance(response_pool, DSFResponsePool):
23992399
_response_pool_id = response_pool._dsf_response_pool_id
2400-
elif type(response_pool) is str:
2400+
elif type(response_pool) is str or type(response_pool) is unicode:
24012401
_response_pool_id = response_pool
24022402
else:
24032403
raise Exception('Could not make sense of Response Pool Type')
@@ -2426,7 +2426,7 @@ def remove_response_pool(self, response_pool, publish=True):
24262426
if isinstance(response_pool, DSFResponsePool):
24272427
_response_pool_id = response_pool._dsf_response_pool_id
24282428
_service_id = response_pool._service_id
2429-
elif type(response_pool) is str:
2429+
elif type(response_pool) is str or type(response_pool) is unicode:
24302430
_response_pool_id = response_pool
24312431
else:
24322432
raise Exception('Could not make sense of Response Pool Type')
@@ -2471,7 +2471,7 @@ def order_response_pools(self, pool_list, publish=True):
24712471
for list_item in pool_list:
24722472
if isinstance(list_item, DSFResponsePool):
24732473
_pool_list.append(list_item._dsf_response_pool_id)
2474-
elif type(list_item) is str:
2474+
elif type(list_item) is str or type(list_item) is unicode:
24752475
_pool_list.append(list_item)
24762476
api_args = dict()
24772477
api_args['response_pools'] = list()

0 commit comments

Comments
 (0)