Skip to content

Commit bc8fe4c

Browse files
committed
added doc for add/drop collection convenience methods, explicit requirement to provide valid workspace and project if no account defaults are present. Fixed faulty handling of user constructed query of complex conditions
1 parent c56201d commit bc8fe4c

18 files changed

Lines changed: 262 additions & 13 deletions

MANIFEST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ examples/get_schema.py
2828
examples/defrevs.py
2929
examples/add_tcrs.py
3030
examples/updtag.py
31+
examples/addtags.py

build_dist.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
'get_schedulable_artifacts.py',
4040
'add_tcrs.py',
4141
'defrevs.py',
42-
'updtag.py'
42+
'updtag.py',
43+
'addtags.py'
4344
]
4445
DOC_FILES = ['doc/Makefile',
4546
'doc/source/conf.py',
614 Bytes
Binary file not shown.
7.09 KB
Binary file not shown.

doc/build/html/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: bc481c91bc67b7eba85aa1ce56db2b8a
3+
config: 62325dc5575a032c598ed35259d4cf4f
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

doc/build/html/_sources/interface.txt

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,10 @@ Rally
273273

274274
either in this specific order or as keyword arguments.
275275

276+
You must either have default workspace and project values set up for your account
277+
OR
278+
you must provide workspace and project values that are valid and accessible for your account.
279+
276280
You can optionally specify the following as keyword arguments:
277281
* apikey
278282
* workspace
@@ -298,7 +302,7 @@ Rally
298302
Using isolated_workspace=True provides performance benefits for a subscription
299303
with many workspaces, but it also means you cannot change the workspace you
300304
are working within a single instance of a Rally class, nor can you provide
301-
a workspace keyword argument to a get, create, update or delete methods that
305+
a workspace keyword argument to the get, create, update or delete methods that
302306
differs from the workspace identified at instantiation time.
303307
For subscriptions with a small to moderate number of workspaces (up to a few dozen),
304308
the performance savings will be relatively minor when using isolated_workspace=True
@@ -662,6 +666,42 @@ pyral.Rally instance convenience methods
662666
Rank the target_artifact at the bottom of the list of ranked Artifacts
663667
that the target_artifact exists in.
664668

669+
pyral.Rally experimental convenience methods
670+
--------------------------------------------
671+
672+
.. method:: addCollectionItems(target_item, collection_items)
673+
674+
Given a target_item and a homogenous list of items whose type appears as a One to Many relationship
675+
in the target item, add the collection_items to the corresponding attribute in the target_item.
676+
677+
::
678+
679+
...
680+
milestones = [milestone_1, milestone_2, milestone_3]
681+
story = rally.get('story', 'US123')
682+
rally.addCollectionItems(story, milestones)
683+
684+
.. warning::
685+
686+
This method only works when the collection attribute on the target_item is Modifiable.
687+
Consult the AgileCentral WSAPI documentation for the target_item attributes to see whether
688+
the attribute of interest has a notation of 'Collection Modifiable yes'. If there is no
689+
'Colletion Modifiable' notation or the value for that is 'no', then use of this method
690+
should not be attempted.
691+
At this time, the AgileCentral WSAPI schema endpoint does not include information about
692+
'Collection Modifiable' for any of the attributes, you'll have to consult the documentation.
693+
694+
.. method:: dropCollectionItems(target_item, collection_items)
695+
696+
Given a target_item and a homogenous list of items whose type appears as a One to Many relationship
697+
in the target item, delete the collection_items to the corresponding attribute in the target_item
698+
from the current collection contents for the target_item.
699+
700+
.. warning::
701+
702+
See note above for the 'addCollectionItems' method. The restrictions there are also applicable
703+
to this method.
704+
665705

666706
RallyRESTResponse
667707
=================

doc/build/html/genindex.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ <h2 id="A">A</h2>
177177
<dt><a href="interface.html#addAttachments">addAttachments()</a>
178178
</dt>
179179

180+
181+
<dt><a href="interface.html#addCollectionItems">addCollectionItems()</a>
182+
</dt>
183+
180184
</dl></td>
181185
</tr></table>
182186

@@ -197,16 +201,20 @@ <h2 id="D">D</h2>
197201
<dt><a href="interface.html#delete">delete()</a>
198202
</dt>
199203

200-
</dl></td>
201-
<td style="width: 33%" valign="top"><dl>
202204

203205
<dt><a href="interface.html#details">details()</a>
204206
</dt>
205207

208+
</dl></td>
209+
<td style="width: 33%" valign="top"><dl>
206210

207211
<dt><a href="interface.html#disableLogging">disableLogging()</a>
208212
</dt>
209213

214+
215+
<dt><a href="interface.html#dropCollectionItems">dropCollectionItems()</a>
216+
</dt>
217+
210218
</dl></td>
211219
</tr></table>
212220

doc/build/html/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ <h1>Python toolkit for the Rally REST API<a class="headerlink" href="#python-too
170170
<li class="toctree-l1"><a class="reference internal" href="interface.html#rally">Rally</a><ul>
171171
<li class="toctree-l2"><a class="reference internal" href="interface.html#core-rest-methods-and-crud-aliases">Core REST methods and CRUD aliases</a></li>
172172
<li class="toctree-l2"><a class="reference internal" href="interface.html#pyral-rally-instance-convenience-methods">pyral.Rally instance convenience methods</a></li>
173+
<li class="toctree-l2"><a class="reference internal" href="interface.html#pyral-rally-experimental-convenience-methods">pyral.Rally experimental convenience methods</a></li>
173174
</ul>
174175
</li>
175176
<li class="toctree-l1"><a class="reference internal" href="interface.html#rallyrestresponse">RallyRESTResponse</a></li>

doc/build/html/interface.html

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
<li class="toctree-l1"><a class="reference internal" href="#rally">Rally</a><ul>
101101
<li class="toctree-l2"><a class="reference internal" href="#core-rest-methods-and-crud-aliases">Core REST methods and CRUD aliases</a></li>
102102
<li class="toctree-l2"><a class="reference internal" href="#pyral-rally-instance-convenience-methods">pyral.Rally instance convenience methods</a></li>
103+
<li class="toctree-l2"><a class="reference internal" href="#pyral-rally-experimental-convenience-methods">pyral.Rally experimental convenience methods</a></li>
103104
</ul>
104105
</li>
105106
<li class="toctree-l1"><a class="reference internal" href="#rallyrestresponse">RallyRESTResponse</a></li>
@@ -451,6 +452,9 @@ <h1>Rally<a class="headerlink" href="#rally" title="Permalink to this headline">
451452
</dd>
452453
</dl>
453454
<p>either in this specific order or as keyword arguments.</p>
455+
<p>You must either have default workspace and project values set up for your account
456+
OR
457+
you must provide workspace and project values that are valid and accessible for your account.</p>
454458
<dl class="docutils">
455459
<dt>You can optionally specify the following as keyword arguments:</dt>
456460
<dd><ul class="first last">
@@ -491,7 +495,7 @@ <h1>Rally<a class="headerlink" href="#rally" title="Permalink to this headline">
491495
Using isolated_workspace=True provides performance benefits for a subscription
492496
with many workspaces, but it also means you cannot change the workspace you
493497
are working within a single instance of a Rally class, nor can you provide
494-
a workspace keyword argument to a get, create, update or delete methods that
498+
a workspace keyword argument to the get, create, update or delete methods that
495499
differs from the workspace identified at instantiation time.
496500
For subscriptions with a small to moderate number of workspaces (up to a few dozen),
497501
the performance savings will be relatively minor when using isolated_workspace=True
@@ -905,6 +909,45 @@ <h2>pyral.Rally instance convenience methods<a class="headerlink" href="#pyral-r
905909
that the target_artifact exists in.</p>
906910
</dd></dl>
907911

912+
</div>
913+
<div class="section" id="pyral-rally-experimental-convenience-methods">
914+
<h2>pyral.Rally experimental convenience methods<a class="headerlink" href="#pyral-rally-experimental-convenience-methods" title="Permalink to this headline"></a></h2>
915+
<dl class="method">
916+
<dt id="addCollectionItems">
917+
<code class="descname">addCollectionItems</code><span class="sig-paren">(</span><em>target_item</em>, <em>collection_items</em><span class="sig-paren">)</span><a class="headerlink" href="#addCollectionItems" title="Permalink to this definition"></a></dt>
918+
<dd><p>Given a target_item and a homogenous list of items whose type appears as a One to Many relationship
919+
in the target item, add the collection_items to the corresponding attribute in the target_item.</p>
920+
</dd></dl>
921+
922+
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="o">...</span>
923+
<span class="n">milestones</span> <span class="o">=</span> <span class="p">[</span><span class="n">milestone_1</span><span class="p">,</span> <span class="n">milestone_2</span><span class="p">,</span> <span class="n">milestone_3</span><span class="p">]</span>
924+
<span class="n">story</span> <span class="o">=</span> <span class="n">rally</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;story&#39;</span><span class="p">,</span> <span class="s1">&#39;US123&#39;</span><span class="p">)</span>
925+
<span class="n">rally</span><span class="o">.</span><span class="n">addCollectionItems</span><span class="p">(</span><span class="n">story</span><span class="p">,</span> <span class="n">milestones</span><span class="p">)</span>
926+
</pre></div>
927+
</div>
928+
<div class="admonition warning">
929+
<p class="first admonition-title">Warning</p>
930+
<p class="last">This method only works when the collection attribute on the target_item is Modifiable.
931+
Consult the AgileCentral WSAPI documentation for the target_item attributes to see whether
932+
the attribute of interest has a notation of &#8216;Collection Modifiable yes&#8217;. If there is no
933+
&#8216;Colletion Modifiable&#8217; notation or the value for that is &#8216;no&#8217;, then use of this method
934+
should not be attempted.
935+
At this time, the AgileCentral WSAPI schema endpoint does not include information about
936+
&#8216;Collection Modifiable&#8217; for any of the attributes, you&#8217;ll have to consult the documentation.</p>
937+
</div>
938+
<dl class="method">
939+
<dt id="dropCollectionItems">
940+
<code class="descname">dropCollectionItems</code><span class="sig-paren">(</span><em>target_item</em>, <em>collection_items</em><span class="sig-paren">)</span><a class="headerlink" href="#dropCollectionItems" title="Permalink to this definition"></a></dt>
941+
<dd><p>Given a target_item and a homogenous list of items whose type appears as a One to Many relationship
942+
in the target item, delete the collection_items to the corresponding attribute in the target_item
943+
from the current collection contents for the target_item.</p>
944+
</dd></dl>
945+
946+
<div class="admonition warning">
947+
<p class="first admonition-title">Warning</p>
948+
<p class="last">See note above for the &#8216;addCollectionItems&#8217; method. The restrictions there are also applicable
949+
to this method.</p>
950+
</div>
908951
</div>
909952
</div>
910953
<div class="section" id="rallyrestresponse">

doc/build/html/objects.inv

13 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)