/usr/share/doc/ansible-tower-cli/html/CONTRIBUTING.html is in ansible-tower-cli-doc 3.2.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Contributor’s Guide — tower-cli documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/mathjax/MathJax.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Release History" href="HISTORY.html" />
<link rel="prev" title="CLI Reference" href="cli_ref/index.html" />
</head>
<body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="HISTORY.html" title="Release History"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="cli_ref/index.html" title="CLI Reference"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">tower-cli documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="contributor-s-guide">
<h1>Contributor’s Guide<a class="headerlink" href="#contributor-s-guide" title="Permalink to this headline">¶</a></h1>
<p>All kinds of contributions are more than welcomed. You can help make tower CLI better by reporting bugs, come up
with feature ideas or, even further, help maintainers out by making pull requests. Make sure you follow the rules
below when contributing and you are ready to roll ;)</p>
<div class="section" id="bug-reports">
<h2>Bug Reports<a class="headerlink" href="#bug-reports" title="Permalink to this headline">¶</a></h2>
<p>Reporting bugs is highly valuable to us. For flexibility, we do not provide issue templates, but describe the issue
as specific as possible to make it easier and faster for us to hunt down the issue.</p>
<ul class="simple">
<li>First check existing issues to see if it has already been created, if it has, giving issue description a “thumbs up”.</li>
<li>Mark the issue with ‘bug’ label.</li>
<li>Be sure to mention Tower backend version, Tower CLI version and python interpreter version when the bug occurs.</li>
<li>Copy-paste the detailed usage (code snippet when using as python library and command when using as CLI) and error
message if possible.</li>
</ul>
</div>
<div class="section" id="feature-requests">
<h2>Feature Requests<a class="headerlink" href="#feature-requests" title="Permalink to this headline">¶</a></h2>
<p>We welcome all sorts of feature ideas, but note, it may be scheduled for a future release rather than the next one,
please be patient while we process your request. We will ping you on github once the feature is implemented.</p>
<ul class="simple">
<li>Mark the issue with ‘enhancement’ label.</li>
</ul>
</div>
<div class="section" id="architecture-overview">
<h2>Architecture Overview<a class="headerlink" href="#architecture-overview" title="Permalink to this headline">¶</a></h2>
<p>All available Tower CLI resources descent from abstract class <code class="docutils literal"><span class="pre">tower_cli.models.base.BaseResource</span></code>, which provides
two fundamental methods, <code class="docutils literal"><span class="pre">read</span></code> and <code class="docutils literal"><span class="pre">write</span></code>. <code class="docutils literal"><span class="pre">read</span></code> wraps around a GET method to the specified resource, while
<code class="docutils literal"><span class="pre">write</span></code> wraps around a POST or PATCH on condition. Most public resource APIs, like <code class="docutils literal"><span class="pre">create</span></code> or <code class="docutils literal"><span class="pre">list</span></code>, are
essentially using a combination of <code class="docutils literal"><span class="pre">read</span></code> and <code class="docutils literal"><span class="pre">write</span></code> to communicate with Tower REST APIs.</p>
<dl class="class">
<dt id="tower_cli.models.base.BaseResource">
<em class="property">class </em><code class="descclassname">tower_cli.models.base.</code><code class="descname">BaseResource</code><a class="reference internal" href="_modules/tower_cli/models/base.html#BaseResource"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tower_cli.models.base.BaseResource" title="Permalink to this definition">¶</a></dt>
<dd><p>Abstract class representing resources within the Ansible Tower system, on which actions can be taken.
Includes standard create, modify, list, get, and delete methods.</p>
<p>Some of these methods are not created as commands, but will be implemented as commands inside of non-abstract
child classes. Particularly, create is not a command in this class, but will be for some (but not all) child
classes.</p>
<dl class="method">
<dt id="tower_cli.models.base.BaseResource.read">
<code class="descname">read</code><span class="sig-paren">(</span><em>pk=None</em>, <em>fail_on_no_results=False</em>, <em>fail_on_multiple_results=False</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/tower_cli/models/base.html#BaseResource.read"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tower_cli.models.base.BaseResource.read" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve and return objects from the Ansible Tower API.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>pk</strong> (<em>int</em>) – Primary key of the resource to be read. Tower CLI will only attempt to read that object
if <code class="docutils literal"><span class="pre">pk</span></code> is provided (not <code class="docutils literal"><span class="pre">None</span></code>).</li>
<li><strong>fail_on_no_results</strong> (<em>bool</em>) – Flag that if set, zero results is considered a failure case and raises
an exception; otherwise, empty list is returned. (Note: This is always True
if a primary key is included.)</li>
<li><strong>fail_on_multiple_results</strong> (<em>bool</em>) – Flag that if set, at most one result is expected, and more results
constitutes a failure case. (Note: This is meaningless if a primary
key is included, as there can never be multiple results.)</li>
<li><strong>query</strong> (<a class="reference internal" href="api_ref/resources/ad_hoc.html#tower_cli.resources.ad_hoc.Resource.list" title="tower_cli.resources.ad_hoc.Resource.list"><em>list</em></a>) – Contains 2-tuples used as query parameters to filter resulting resource objects.</li>
<li><strong>**kwargs</strong> – Keyword arguements which, all together, will be used as query parameters to filter
resulting resource objects.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">loaded JSON from Tower backend response body.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">dict</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
<li><a class="reference internal" href="api_ref/exceptions.html#tower_cli.exceptions.BadRequest" title="tower_cli.exceptions.BadRequest"><strong>tower_cli.exceptions.BadRequest</strong></a> – When 2-tuples in <code class="docutils literal"><span class="pre">query</span></code> overlaps key-value pairs in
<code class="docutils literal"><span class="pre">**kwargs</span></code>.</li>
<li><a class="reference internal" href="api_ref/exceptions.html#tower_cli.exceptions.NotFound" title="tower_cli.exceptions.NotFound"><strong>tower_cli.exceptions.NotFound</strong></a> – When no objects are found and <code class="docutils literal"><span class="pre">fail_on_no_results</span></code> flag is on.</li>
<li><a class="reference internal" href="api_ref/exceptions.html#tower_cli.exceptions.MultipleResults" title="tower_cli.exceptions.MultipleResults"><strong>tower_cli.exceptions.MultipleResults</strong></a> – When multiple objects are found and
<code class="docutils literal"><span class="pre">fail_on_multiple_results</span></code> flag is on.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="tower_cli.models.base.BaseResource.write">
<code class="descname">write</code><span class="sig-paren">(</span><em>pk=None</em>, <em>create_on_missing=False</em>, <em>fail_on_found=False</em>, <em>force_on_exists=True</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/tower_cli/models/base.html#BaseResource.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tower_cli.models.base.BaseResource.write" title="Permalink to this definition">¶</a></dt>
<dd><p>Modify the given object using the Ansible Tower API.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>pk</strong> (<em>int</em>) – Primary key of the resource to be read. Tower CLI will only attempt to read that object
if <code class="docutils literal"><span class="pre">pk</span></code> is provided (not <code class="docutils literal"><span class="pre">None</span></code>).</li>
<li><strong>create_on_missing</strong> (<em>bool</em>) – Flag that if set, a new object is created if <code class="docutils literal"><span class="pre">pk</span></code> is not set and objects
matching the appropriate unique criteria is not found.</li>
<li><strong>fail_on_found</strong> (<em>bool</em>) – Flag that if set, the operation fails if an object matching the unique criteria
already exists.</li>
<li><strong>force_on_exists</strong> (<em>bool</em>) – Flag that if set, then if an object is modified based on matching via unique
fields (as opposed to the primary key), other fields are updated based on data
sent; If unset, then the non-unique values are only written in a creation case.</li>
<li><strong>**kwargs</strong> – Keyword arguements which, all together, will be used as POST/PATCH body to create/modify
the resource object. if <code class="docutils literal"><span class="pre">pk</span></code> is not set, key-value pairs of <code class="docutils literal"><span class="pre">**kwargs</span></code> which are
also in resource’s identity will be used to lookup existing reosource.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A dictionary combining the JSON output of the resource, as well as two extra fields: “changed”,
a flag indicating if the resource is created or successfully updated; “id”, an integer which
is the primary key of the specified object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">dict</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference internal" href="api_ref/exceptions.html#tower_cli.exceptions.BadRequest" title="tower_cli.exceptions.BadRequest"><strong>tower_cli.exceptions.BadRequest</strong></a> – When required fields are missing in <code class="docutils literal"><span class="pre">**kwargs</span></code> when creating
a new resource object.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<p>Here is the detailed class hierarchy from <code class="docutils literal"><span class="pre">tower_cli.models.base.BaseResource</span></code> to all specific Tower resources:</p>
digraph inheritance65b2eb7fec {
rankdir=LR;
size="8.0, 12.0";
"tower_cli.models.base.BaseResource" [URL="#tower_cli.models.base.BaseResource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="Abstract class representing resources within the Ansible Tower system, on which actions can be taken."];
"tower_cli.models.base.ExeResource" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Executable resource - defines status and cancel methods"];
"tower_cli.models.base.MonitorableResource" -> "tower_cli.models.base.ExeResource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.models.base.MonitorableResource" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="A resource that is able to be tied to a running task, such as a job or project, and thus able to be monitored."];
"tower_cli.models.base.BaseResource" -> "tower_cli.models.base.MonitorableResource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.models.base.ReadOnlyResource" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)"];
"tower_cli.models.base.BaseResource" -> "tower_cli.models.base.ReadOnlyResource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.models.base.Resource" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="This is the parent class for all standard resources."];
"tower_cli.models.base.BaseResource" -> "tower_cli.models.base.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.models.base.ResourceMeta" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Metaclass for the creation of a Model subclass, which pulls fields"];
"tower_cli.models.base.SurveyResource" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Contains utilities and commands common to \"job template\" models,"];
"tower_cli.models.base.Resource" -> "tower_cli.models.base.SurveyResource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.models.fields.Field" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="A class representing flags on a given field on a model."];
"tower_cli.resources.ad_hoc.Resource" [URL="api_ref/resources/ad_hoc.html#tower_cli.resources.ad_hoc.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for ad hoc commands."];
"tower_cli.models.base.ExeResource" -> "tower_cli.resources.ad_hoc.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.credential.Resource" [URL="api_ref/resources/credential.html#tower_cli.resources.credential.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for credentials."];
"tower_cli.models.base.Resource" -> "tower_cli.resources.credential.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.credential_type.Resource" [URL="api_ref/resources/credential_type.html#tower_cli.resources.credential_type.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for credential types."];
"tower_cli.models.base.Resource" -> "tower_cli.resources.credential_type.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.group.Resource" [URL="api_ref/resources/group.html#tower_cli.resources.group.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for groups."];
"tower_cli.models.base.Resource" -> "tower_cli.resources.group.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.host.Resource" [URL="api_ref/resources/host.html#tower_cli.resources.host.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for credentials."];
"tower_cli.models.base.Resource" -> "tower_cli.resources.host.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.instance.Resource" [URL="api_ref/resources/instance.html#tower_cli.resources.instance.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for instances."];
"tower_cli.models.base.ReadOnlyResource" -> "tower_cli.resources.instance.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.instance_group.Resource" [URL="api_ref/resources/instance_group.html#tower_cli.resources.instance_group.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for instance groups."];
"tower_cli.models.base.ReadOnlyResource" -> "tower_cli.resources.instance_group.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.inventory.Resource" [URL="api_ref/resources/inventory.html#tower_cli.resources.inventory.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for inventories."];
"tower_cli.models.base.Resource" -> "tower_cli.resources.inventory.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.inventory_script.Resource" [URL="api_ref/resources/inventory_script.html#tower_cli.resources.inventory_script.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for inventory scripts."];
"tower_cli.models.base.Resource" -> "tower_cli.resources.inventory_script.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.inventory_source.Resource" [URL="api_ref/resources/inventory_source.html#tower_cli.resources.inventory_source.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for inventory sources."];
"tower_cli.models.base.Resource" -> "tower_cli.resources.inventory_source.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.models.base.MonitorableResource" -> "tower_cli.resources.inventory_source.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.inventory_update.Resource" [URL="api_ref/resources/inventory_update.html#tower_cli.resources.inventory_update.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for inventory source updates."];
"tower_cli.models.base.ExeResource" -> "tower_cli.resources.inventory_update.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.job.Resource" [URL="api_ref/resources/job.html#tower_cli.resources.job.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for jobs."];
"tower_cli.models.base.ExeResource" -> "tower_cli.resources.job.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.job_template.Resource" [URL="api_ref/resources/job_template.html#tower_cli.resources.job_template.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for job templates."];
"tower_cli.models.base.SurveyResource" -> "tower_cli.resources.job_template.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.label.Resource" [URL="api_ref/resources/label.html#tower_cli.resources.label.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for labels."];
"tower_cli.models.base.Resource" -> "tower_cli.resources.label.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.node.Resource" [URL="api_ref/resources/node.html#tower_cli.resources.node.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for workflow nodes."];
"tower_cli.models.base.Resource" -> "tower_cli.resources.node.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.notification_template.Resource" [URL="api_ref/resources/notification_template.html#tower_cli.resources.notification_template.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for notification templates."];
"tower_cli.models.base.Resource" -> "tower_cli.resources.notification_template.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.organization.Resource" [URL="api_ref/resources/organization.html#tower_cli.resources.organization.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top"];
"tower_cli.models.base.Resource" -> "tower_cli.resources.organization.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.project.Resource" [URL="api_ref/resources/project.html#tower_cli.resources.project.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for projects."];
"tower_cli.models.base.Resource" -> "tower_cli.resources.project.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.models.base.MonitorableResource" -> "tower_cli.resources.project.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.project_update.Resource" [URL="api_ref/resources/project_update.html#tower_cli.resources.project_update.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for project updates."];
"tower_cli.models.base.ExeResource" -> "tower_cli.resources.project_update.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.role.Resource" [URL="api_ref/resources/role.html#tower_cli.resources.role.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for managing roles."];
"tower_cli.models.base.Resource" -> "tower_cli.resources.role.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.schedule.Resource" [URL="api_ref/resources/schedule.html#tower_cli.resources.schedule.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for schedules."];
"tower_cli.models.base.Resource" -> "tower_cli.resources.schedule.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.setting.Resource" [URL="api_ref/resources/setting.html#tower_cli.resources.setting.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for Tower configurations."];
"tower_cli.models.base.Resource" -> "tower_cli.resources.setting.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.team.Resource" [URL="api_ref/resources/team.html#tower_cli.resources.team.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for teams."];
"tower_cli.models.base.Resource" -> "tower_cli.resources.team.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.unified_job.Resource" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="A resource for unified jobs."];
"tower_cli.models.base.Resource" -> "tower_cli.resources.unified_job.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.user.Resource" [URL="api_ref/resources/user.html#tower_cli.resources.user.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for users."];
"tower_cli.models.base.Resource" -> "tower_cli.resources.user.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.workflow.Resource" [URL="api_ref/resources/workflow.html#tower_cli.resources.workflow.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for workflow job templates."];
"tower_cli.models.base.SurveyResource" -> "tower_cli.resources.workflow.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.resources.workflow.TreeNode" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)"];
"tower_cli.resources.workflow_job.Resource" [URL="api_ref/resources/workflow_job.html#tower_cli.resources.workflow_job.Resource",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A resource for workflow jobs."];
"tower_cli.models.base.ExeResource" -> "tower_cli.resources.workflow_job.Resource" [arrowsize=0.5,style="setlinewidth(0.5)"];
}
<p>Details of each Tower CLI resource module are available under <code class="docutils literal"><span class="pre">tower_cli/resources/</span></code>.</p>
<p>Some root-level modules under <code class="docutils literal"><span class="pre">tower_cli/</span></code> folder are of great importance. Specifically, <code class="docutils literal"><span class="pre">api.py</span></code> contains details
of the API client Tower CLI used to make HTTP(S) requests using
<a class="reference external" href="http://docs.python-requests.org/en/master/">requests</a>, and <code class="docutils literal"><span class="pre">conf.py</span></code> is used to define and initialize singleton
setting object <code class="docutils literal"><span class="pre">tower_cli.conf.settings</span></code>.</p>
<p>On the other hand, <code class="docutils literal"><span class="pre">tower_cli/cli/</span></code> folder contains code that extends tower_cli from a python library into a full-
fledged command-line interface. We use <a class="reference external" href="http://click.pocoo.org/5/">click</a> as the CLI engine.</p>
digraph inheritanced415d42f75 {
rankdir=LR;
size="8.0, 12.0";
"click.core.BaseCommand" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="The base command implements the minimal API contract of commands."];
"click.core.Command" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Commands are the basic building block of command line interfaces in"];
"click.core.BaseCommand" -> "click.core.Command" [arrowsize=0.5,style="setlinewidth(0.5)"];
"click.core.MultiCommand" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="A multi command is the basic implementation of a command that"];
"click.core.Command" -> "click.core.MultiCommand" [arrowsize=0.5,style="setlinewidth(0.5)"];
"click.types.Choice" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="The choice type allows a value to be checked against a fixed set of"];
"click.types.ParamType" -> "click.types.Choice" [arrowsize=0.5,style="setlinewidth(0.5)"];
"click.types.File" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Declares a parameter to be a file for reading or writing. The file"];
"click.types.ParamType" -> "click.types.File" [arrowsize=0.5,style="setlinewidth(0.5)"];
"click.types.ParamType" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Helper for converting values through types. The following is"];
"tower_cli.cli.action.ActionSubcommand" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="A Command subclass that adds support for the concept that invocation"];
"click.core.Command" -> "tower_cli.cli.action.ActionSubcommand" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.cli.base.TowerCLI" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Tower CLI is a command-line interface tool for interacting with"];
"click.core.MultiCommand" -> "tower_cli.cli.base.TowerCLI" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.cli.resource.ResSubcommand" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="A subcommand that implements all command methods on the"];
"click.core.MultiCommand" -> "tower_cli.cli.resource.ResSubcommand" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.cli.types.File" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="A subclass of click.File that adds `os.path.expanduser`."];
"click.types.File" -> "tower_cli.cli.types.File" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.cli.types.MappedChoice" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="A subclass of click.Choice that allows a distinction between the"];
"click.types.Choice" -> "tower_cli.cli.types.MappedChoice" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.cli.types.Related" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="A subclass of click.types.ParamType that represents a value"];
"click.types.ParamType" -> "tower_cli.cli.types.Related" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.cli.types.StructuredInput" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="A subclass of Variables that deserializes JSON/YAML-formatted string/file content into python objects."];
"tower_cli.cli.types.Variables" -> "tower_cli.cli.types.StructuredInput" [arrowsize=0.5,style="setlinewidth(0.5)"];
"tower_cli.cli.types.Variables" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Allows reading from a file optionally with '@' prefix,"];
"click.types.File" -> "tower_cli.cli.types.Variables" [arrowsize=0.5,style="setlinewidth(0.5)"];
}
</div>
<div class="section" id="code-contributions">
<h2>Code Contributions<a class="headerlink" href="#code-contributions" title="Permalink to this headline">¶</a></h2>
<p>Setting up development environment and playing around with Tower CLI is quite straight-forward, here is the usual
development procedure:</p>
<ol class="arabic simple">
<li>Branch out a local issue branch from the correct base branch.</li>
<li>Create an empty virtual environment.</li>
<li>Code.</li>
<li>Run <code class="docutils literal"><span class="pre">make</span> <span class="pre">install</span></code> to install development Tower CLI and all its dependency to virtual environment.</li>
<li>Manually test on your bug fix/feature and modify until manual tests pass.</li>
<li>Run <code class="docutils literal"><span class="pre">sudo</span> <span class="pre">pip</span> <span class="pre">install</span> <span class="pre">tox</span></code>. Then at the root directory of Tower CLI repository, run <code class="docutils literal"><span class="pre">sudo</span> <span class="pre">tox</span> <span class="pre">.</span></code> to run flake8
verify and unit test against all supported python versions. Run and modify until all flake8 checks and
unit tests pass.</li>
<li>Commit, push to local fork and make pull request targeting the correct base branch.</li>
<li>Wait for a maintainer to either approve and merge the pull request, or update pull request according to feedback
comment.</li>
</ol>
<p>Some points to keep in mind when developing:</p>
<ul class="simple">
<li>Target the correct branch. Currently we use branch ‘v1’ to track 3.1.x versions and ‘master’ to track 3.2.0 and
beyond.</li>
<li>Consider all API versions. Currently 3.1.x versions are exclusively used for API v1 and 3.2.0 and beyond are
exclusively used for API v2, that means if you fixed a bug for 3.1.8, switch to 3.2.0 and see if the same or
similar bug exists and needs similar fix.</li>
<li>Consider python 2/3 compatibility, make good use of <code class="docutils literal"><span class="pre">six</span></code> and <code class="docutils literal"><span class="pre">tower_cli.compat</span></code>.</li>
<li>Consider docs update. Whenever a new resource, new resource public method or new resource field is added, inspect
the docs folder and make all necessary updates before committing. Whenever <code class="docutils literal"><span class="pre">HISTORY.rst</span></code> at base directory changes
replace <code class="docutils literal"><span class="pre">docs/source/HISTORY.rst</span></code> with the latest version.</li>
<li>Adhere to the flake8 specifications when developing, the only exception we allow is the maximum line length, which
is 120 characters rather than 79.</li>
<li>Be pythonic by using meaningful names and clear structures. Make code self-explanatory rather than adding excessive
comments.</li>
<li>Be test-driven. Although not mandatory, please try keeping test coverage at least the same as before, we appreciate
it if you can increase our test coverage in your pull requests.</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Contributor’s Guide</a><ul>
<li><a class="reference internal" href="#bug-reports">Bug Reports</a></li>
<li><a class="reference internal" href="#feature-requests">Feature Requests</a></li>
<li><a class="reference internal" href="#architecture-overview">Architecture Overview</a></li>
<li><a class="reference internal" href="#code-contributions">Code Contributions</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="cli_ref/index.html"
title="previous chapter">CLI Reference</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="HISTORY.html"
title="next chapter">Release History</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/CONTRIBUTING.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="HISTORY.html" title="Release History"
>next</a> |</li>
<li class="right" >
<a href="cli_ref/index.html" title="CLI Reference"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">tower-cli documentation</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2017, Ansible by Red Hat.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.5.
</div>
</body>
</html>
|