|
1 | | -.. role:: action-table-field-name |
2 | | -.. role:: action-table-field-optional |
3 | | -.. role:: action-table-field-required |
4 | | -.. role:: action-table-field-type |
5 | | - |
6 | | -.. role:: json(code) |
7 | | - :language: JSON |
8 | | - |
9 | | -{% macro action_details(action) %} |
10 | | -{% set action_title = action.action[0] %} |
11 | | -{% set action_title_format = "`%s <%s>`_" % (action_title, action.api_documentation_url) if action.api_documentation_url else action_title %} |
12 | | -.. _commands_{{ action.command }}_{{ action.action[0] }}: |
13 | | - |
14 | | -{{ action_title_format }} |
15 | | -{{ "-" * (action_title_format | length) }} |
16 | | -{% if action.action | length > 1 %} |
17 | | - |
18 | | -*Aliases: {{ action[1:] | join(", ") }}* |
19 | | -{% endif %} |
20 | | - |
21 | | -{% if action.deprecated %} |
22 | | -.. warning:: |
23 | | - This command is deprecated and may not be supported in the future. |
24 | | -{% endif %} |
25 | | - |
26 | | -{{ action.description }} |
27 | | -{% if action.usage %} |
28 | | - |
29 | | -.. rst-class:: action-subheading |
30 | | - |
31 | | -Usage |
32 | | - |
33 | | -.. rst-class:: action-subheading-description |
34 | | - |
35 | | -The format accepted by this command. |
36 | | - |
37 | | -.. code-block:: bash |
38 | | - |
39 | | -{{ action.usage | indent(first=True) }} |
40 | | - |
41 | | -{% endif %} |
42 | | -{% if action.samples | length > 0 %} |
43 | | - |
44 | | -.. rst-class:: action-subheading |
45 | | - |
46 | | -Sample{% if action.samples | length > 1 %}s{% endif %} |
47 | | - |
48 | | - |
49 | | -.. rst-class:: action-subheading-description |
50 | | - |
51 | | -Examples of how this command might be used. |
52 | | - |
53 | | -{% for sample in action.samples %} |
54 | | - |
55 | | -.. code-block:: bash |
56 | | - |
57 | | -{{ sample | indent(first=True) }} |
58 | | - |
59 | | -{% endfor %} |
60 | | -{% endif %} |
61 | | -{% if action.parameters | length > 0 %} |
62 | | - |
63 | | -.. rst-class:: action-subheading |
64 | | - |
65 | | -Parameters |
66 | | - |
67 | | -.. rst-class:: action-subheading-description |
68 | | - |
69 | | -Positional parameters used to define the resource this command should target. |
70 | | - |
71 | | - |
72 | | -.. rst-class:: action-parameter-table |
73 | | - |
74 | | -.. list-table:: |
75 | | - :header-rows: 1 |
76 | | - :width: 100% |
77 | | - :widths: 1 1 98 |
78 | | - |
79 | | - * - Name |
80 | | - - Type |
81 | | - - Description |
82 | | - |
83 | | -{% for parameter in action.parameters %} |
84 | | - * - :action-table-field-name:`{{ parameter.name }}` |
85 | | - - :action-table-field-type:`{{ parameter.type }}` |
86 | | - - {% if parameter.description %}{{ parameter.description }}{% else %}N/A{% endif %} |
87 | | - |
88 | | -{% endfor %} |
89 | | -{% endif %} |
90 | | -{% if action.argument_sections | length > 0 %} |
91 | | - |
92 | | -.. rst-class:: action-subheading |
93 | | - |
94 | | -Arguments |
95 | | - |
96 | | -.. rst-class:: action-subheading-description |
97 | | - |
98 | | -Additional fields used to execute this request. |
99 | | - |
100 | | -{% for section in action.argument_sections %} |
101 | | -{% if section.name | length > 0 %} |
102 | | -.. _commands_{{ action.command }}_{{ action.action[0] }}_argument_sections_{{ section.name }}: |
103 | | - |
104 | | -.. rst-class:: action-section-header |
105 | | - |
106 | | -{{ section.name }} |
107 | | - |
108 | | -{% endif %} |
109 | | -.. rst-class:: action-argument-section-table |
110 | | - |
111 | | -.. list-table:: |
112 | | - :header-rows: 1 |
113 | | - :width: 100% |
114 | | - :widths: 1 1 1 97 |
115 | | - |
116 | | - * - Name |
117 | | - - Required |
118 | | - - Type |
119 | | - - Description |
120 | | - |
121 | | -{% for argument in section.entries %} |
122 | | - * - :action-table-field-name:`\-\-{{ argument.path }}` |
123 | | - {% if argument.is_parent and argument.path in action.argument_sections_names %} |
124 | | - :ref:`(section) <commands_{{ action.command }}_{{ action.action[0] }}_argument_sections_{{ argument.path }}>` |
125 | | - {% endif %} |
126 | | - - {% if argument.required %}:action-table-field-required:`Yes`{% else %}:action-table-field-optional:`No`{% endif %} |
127 | | - |
128 | | - - :action-table-field-type:`{{ argument.type }}` |
129 | | - - {% if argument.description %}{{ argument.description }}{% else %}N/A{% endif %} |
130 | | - |
131 | | -{% endfor %} |
132 | | -{% endfor %} |
133 | | -{% endif %} |
134 | | -{% if action.filterable_attributes | length > 0 %} |
135 | | - |
136 | | -.. rst-class:: action-subheading |
137 | | - |
138 | | -Filterable Attributes |
139 | | - |
140 | | -.. rst-class:: action-subheading-description |
141 | | - |
142 | | -Arguments used to define a filter for response entries. |
143 | | - |
144 | | -.. rst-class:: action-filterable-field-table |
145 | | - |
146 | | -.. list-table:: |
147 | | - :header-rows: 1 |
148 | | - :width: 100% |
149 | | - :widths: 1 1 98 |
150 | | - |
151 | | - * - Name |
152 | | - - Type |
153 | | - - Description |
154 | | - |
155 | | -{% for attr in action.filterable_attributes %} |
156 | | - * - :action-table-field-name:`\-\-{{ attr.name }}` |
157 | | - - :action-table-field-type:`{{ attr.type }}` |
158 | | - - {% if attr.description %}{{ attr.description }}{% else %}N/A{% endif %} |
159 | | - |
160 | | -{% endfor %} |
161 | | -{% endif %} |
162 | | -{% if action.attribute_sections | length > 0%} |
163 | | - |
164 | | -.. rst-class:: action-subheading |
165 | | - |
166 | | -Result Attributes |
167 | | - |
168 | | -.. rst-class:: action-subheading-description |
169 | | - |
170 | | -The attributes returned by this command. |
171 | | - |
172 | | -.. rst-class:: action-attribute-table |
173 | | - |
174 | | -{% for section in action.attribute_sections %} |
175 | | -{% if section.name | length > 0 %} |
176 | | -.. _commands_{{ action.command }}_{{ action.action[0] }}_attribute_sections_{{ section.name }}: |
177 | | - |
178 | | -.. rst-class:: action-section-header |
179 | | - |
180 | | -{{ section.name }} |
181 | | - |
182 | | -{% endif %} |
183 | | -.. rst-class:: action-attribute-section-table |
184 | | - |
185 | | -.. list-table:: |
186 | | - :header-rows: 1 |
187 | | - :width: 100% |
188 | | - :widths: 1 1 1 97 |
189 | | - |
190 | | - * - Name |
191 | | - - Type |
192 | | - - Example |
193 | | - - Description |
194 | | - |
195 | | -{% for attribute in section.entries %} |
196 | | - * - :action-table-field-name:`{{ attribute.name }}` |
197 | | - {% if attribute.name in action.attribute_sections_names %} |
198 | | - :ref:`(section) <commands_{{ action.command }}_{{ action.action[0] }}_attribute_sections_{{ attribute.path }}>` |
199 | | - {% endif %} |
200 | | - - :action-table-field-type:`{{ attribute.type }}` |
201 | | - - {% if attribute.example %}:json:`{{ attribute.example | tojson }}`{% else %}?{% endif %} |
202 | | - |
203 | | - - {% if attribute.description %}{{ attribute.description }}{% else %}N/A{% endif %} |
204 | | - |
205 | | -{% endfor %} |
206 | | -{% endfor %} |
207 | | -{% endif %} |
208 | | -{% endmacro %} |
| 1 | +{% import "group_action.rst.j2" as action_tmpl %} |
209 | 2 | {{ pretty_name }} |
210 | 3 | {{ "=" * (pretty_name | length) }} |
211 | 4 |
|
212 | 5 | This section details {{ pretty_name[:-1] if pretty_name[-1] == "s" else pretty_name }}-related Linode CLI commands. |
213 | 6 |
|
214 | 7 | {% for action in actions %} |
215 | | -{{ action_details(action) }} |
| 8 | +{{ action_tmpl.render(action) }} |
216 | 9 |
|
217 | 10 | {% if loop.index < (actions | length) - 1 %} |
218 | 11 | ------------ |
|
0 commit comments