Skip to content

Commit f833b39

Browse files
committed
Merge pull request #69 from Marchowes/TrafficDirector_Improvements
cleanup docs and docstrings.
2 parents c5b2067 + 39c333d commit f833b39

File tree

2 files changed

+33
-28
lines changed

2 files changed

+33
-28
lines changed

docs/tm/services/dsf/dsf.rst

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ objects from within a Python script. We'll stick to a simple :class:`DSFARecord`
107107

108108
Create DSF__Record
109109
^^^^^^^^^^^^^^^^^^
110-
We'll assume you already have a :class:`DSFRecordset` object called `record_set` in existence for this example.
110+
We'll assume you already have a :class:`DSFRecordset` object called :mod:`record_set` in existence for this example.
111111

112112
>>> from dyn.tm.services.dsf import DSFARecord
113113
>>> record = DSFARecord('10.1.1.1', label='TEST RECORD', weight=1, automation='auto', eligible=True)
@@ -123,8 +123,8 @@ To change the record IP address of the record we just created, we can use one of
123123
>>> record.address
124124
>>>'20.1.1.1'
125125

126-
Implicit publishing can be turned off for any object if that is undesirable, check `Modifying Traffic Director
127-
Service Properties` below for an example and explaination
126+
Implicit publishing can be turned off for any object if that is undesirable, check :mod:`Modifying Traffic Director
127+
Service Properties` below for an example and explanation
128128

129129
Get All DSF__Record
130130
^^^^^^^^^^^^^^^^^^
@@ -158,12 +158,12 @@ objects from within a Python script.
158158

159159
Create DSFRecordSet
160160
^^^^^^^^^^^^^^^^^^
161-
We'll assume you already have a :class:`DSFFailoverChain` object named `failover_chain` in existence for this example.
161+
We'll assume you already have a :class:`DSFFailoverChain` object named :mod:`failover_chain` in existence for this example.
162162

163163
>>> from dyn.tm.services.dsf import DSFRecordSet
164164
>>> #set up recordset for A records,
165165
>>> record_set = DSFRecordSet('A', label='Record_set_test', ttl=60)
166-
>>> #Now, we create this record_set by adding it to an existing failvoer_chain
166+
>>> #Now, we create this record_set by adding it to an existing failover_chain
167167
>>> record_set.add_to_failover_chain(failover_chain) #This is automatically published.
168168

169169
To make the record_set and its child A records in one create action:
@@ -177,7 +177,7 @@ To make the record_set and its child A records in one create action:
177177
>>> #Now, we create this record_set by adding it to an existing failover_chain
178178
>>> record_set.add_to_failover_chain(failover_chain) #This is automatically published.
179179

180-
As with all other DSF objects, the prototypes `record1` `record2` can't be used in CRUD operations. You must access these
180+
As with all other DSF objects, the prototypes :mod:`record1` :mod:`record2` can't be used in CRUD operations. You must access these
181181
objects within the record_set.
182182

183183
>>> record_set.records
@@ -192,8 +192,8 @@ To change the label for the above :class:`DSFRecordset`:
192192
>>> record_set.label.label
193193
>>>'New Name'
194194

195-
Implicit publishing can be turned off for any object if that is undesirable, check `Modifying Traffic Director
196-
Service Properties` below for an example and explaination
195+
Implicit publishing can be turned off for any object if that is undesirable, check :mod:`Modifying Traffic Director
196+
Service Properties` below for an example and explanation
197197

198198
Adding DSFMonitor to DSFRecordSet
199199
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -249,7 +249,7 @@ objects from within a Python script.
249249

250250
Create DSFFailoverChain
251251
^^^^^^^^^^^^^^^^^^^^^^^
252-
We'll assume you already have a :class:`DSFResponsePool` object named `response_pool` in existence for this example.
252+
We'll assume you already have a :class:`DSFResponsePool` object named :mod:`response_pool` in existence for this example.
253253

254254
>>> from dyn.tm.services.dsf import DSFFailoverChain
255255
>>> #set up failover_chain
@@ -285,8 +285,8 @@ To change the label for the above :class:`DSFFailoverChain`:
285285
>>> failover_chain.label
286286
>>>'New Name'
287287

288-
Implicit publishing can be turned off for any object if that is undesirable, check `Modifying Traffic Director
289-
Service Properties` below for an example and explaination
288+
Implicit publishing can be turned off for any object if that is undesirable, check :mod:`Modifying Traffic Director
289+
Service Properties` below for an example and explanation
290290

291291
Get All DSFFailoverChain
292292
^^^^^^^^^^^^^^^^^^
@@ -359,8 +359,8 @@ To change the label for the above :class:`DSFResponsePool`:
359359
>>> response_pool.label
360360
>>>'New Name'
361361

362-
Implicit publishing can be turned off for any object if that is undesirable, check `Modifying Traffic Director
363-
Service Properties` below for an example and explaination
362+
Implicit publishing can be turned off for any object if that is undesirable, check :mod:`Modifying Traffic Director
363+
Service Properties` below for an example and explanation
364364

365365
Get All DSFResponsePool
366366
^^^^^^^^^^^^^^^^^^
@@ -493,8 +493,8 @@ To Delete your :class:`DSFRuleset`:
493493

494494
>>> ruleset.delete()
495495

496-
This will NOT delete child records, however any child response pools and childre that are not in other :class:`DSFRuleset`s
497-
may not be displayed in the :class:`TrafficDirector` object as it builds its trees from the Rulesets. see `Traffic Director SDK Caveats`
496+
This will NOT delete child records, however any child response pools and children that are not in other :class:`DSFRuleset`s
497+
may not be displayed in the :class:`TrafficDirector` object as it builds its trees from the Rulesets. see :mod:`Traffic Director SDK Caveats`
498498

499499

500500
DSFMonitor
@@ -635,7 +635,7 @@ The following shows the creation of the very most basic empty :class:`TrafficDir
635635
Adding a Ruleset to your Traffic Director Service
636636
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
637637
The TrafficDirector service has a cascading style of adding sub objects where the child object
638-
is added to the parent by either and `add_to_` function, or a create. This helps enforce
638+
is added to the parent by either and :mod:`add_to_` function, or a create. This helps enforce
639639
that children objects do not become orphaned.
640640

641641
>>> #Continuing from the example above.
@@ -678,7 +678,7 @@ Note, that modifying these values will immediately publish them. This can be tur
678678

679679
>>> #Now, say you don't want your update changes to be implicitly published. you can turn off implicit publishing for
680680
>>> #the service level changes.
681-
>>> #!!!WARNING!!!! changing the implict publish flag ONLY disables implicit publishing for this Object,
681+
>>> #!!!WARNING!!!! changing the implicit publish flag ONLY disables implicit publishing for this Object,
682682
>>> #not any of its children objects like Rulesets etc.
683683
>>>
684684
>>> td.label
@@ -831,25 +831,30 @@ 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 :param:`records`, :mod:`record_sets`, `failover_chains`, `response_pools`, `rulesets`
834+
Accessors are :mod:`records`, :mod:`record_sets`, :mod:`failover_chains`, :mod:`response_pools`, :mod:`rulesets`
835+
835836

836837
* Accessors like in the previous bullet point only work if the object is fully linked to the service.
837838
In other words, you can have a full response_pool, but if it does not belong to a ruleset, then it will
838839
not show up.
839-
To list all objects under the service, including orphands you must use `all_records`, `all_record_sets`,
840-
`all_failover_chains`, `all_response_pools`, `all_rulesets`
840+
To list all objects under the service, including orphands you must use :mod:`all_records`, :mod:`all_record_sets`,
841+
:mod:`all_failover_chains`, :mod:`all_response_pools`, :mod:`all_rulesets`
842+
841843

842-
* Some `records`, `record_sets`, `failover_chains`, `response_pools`, `rulesets` will appear multiple times.
843-
This is becasue these record trees are built from the ruleset, and if one response pool belongs to multiple
844+
* Some :mod:`records`, :mod:`record_sets`, :mod:`failover_chains`, :mod:`response_pools`, :mod:`rulesets` will appear multiple times.
845+
This is because these record trees are built from the ruleset, and if one response pool belongs to multiple
844846
Rulesets, then its children will appear as many times as is exists as a ruleset member.
845847

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

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

852-
* :param:`implicitPublish` is non cascading. It is locally bound to the specific object, or child object.
854+
* :mod:`publish()` is run on the :class:`TrafficDirector` as a whole, even when run from a child object.
855+
856+
857+
* :mod:`implicitPublish` is non cascading. It is locally bound to the specific object, or child object.
853858

854859

855860

dyn/tm/services/dsf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def get_all_dsf_services():
3737

3838

3939
def get_all_notifiers():
40-
""":return: A ``list`` of :class:`TrafficDirector` Services"""
40+
""":return: A ``list`` of :class:`DSFNotifier` Services"""
4141
uri = '/Notifier/'
4242
api_args = {'detail': 'Y'}
4343
response = DynectSession.get_session().execute(uri, 'GET', api_args)
@@ -49,7 +49,7 @@ def get_all_notifiers():
4949
def get_all_records(service):
5050
"""
5151
:param service: a dsf_id string, or :class:`TrafficDirector`
52-
:return: A ``list`` of DSF Record Types from the passed in `service`
52+
:return: A ``list`` of :class:`DSFRecord`s from the passed in `service`
5353
Warning! This query may take a long time to run with services with many records!
5454
"""
5555
_service_id = _checkType(service)

0 commit comments

Comments
 (0)