From 2ec5be20d1ebd7135a470fd977ae94cdf04de703 Mon Sep 17 00:00:00 2001 From: Per-Ola Gustafsson Date: Fri, 5 Apr 2024 17:14:13 +0200 Subject: [PATCH 1/2] Added label to power port module --- docs/plugins/netbox_power_port_module.rst | 199 ++++++++++------------ plugins/modules/netbox_power_port.py | 6 + 2 files changed, 100 insertions(+), 105 deletions(-) diff --git a/docs/plugins/netbox_power_port_module.rst b/docs/plugins/netbox_power_port_module.rst index 9172b6cd6..604fc660f 100644 --- a/docs/plugins/netbox_power_port_module.rst +++ b/docs/plugins/netbox_power_port_module.rst @@ -6,8 +6,23 @@ .. |antsibull-internal-nbsp| unicode:: 0xA0 :trim: -.. meta:: - :antsibull-docs: 2.7.0 +.. role:: ansible-attribute-support-label +.. role:: ansible-attribute-support-property +.. role:: ansible-attribute-support-full +.. role:: ansible-attribute-support-partial +.. role:: ansible-attribute-support-none +.. role:: ansible-attribute-support-na +.. role:: ansible-option-type +.. role:: ansible-option-elements +.. role:: ansible-option-required +.. role:: ansible-option-versionadded +.. role:: ansible-option-aliases +.. role:: ansible-option-choices +.. role:: ansible-option-choices-default-mark +.. role:: ansible-option-default-bold +.. role:: ansible-option-configuration +.. role:: ansible-option-returned-bold +.. role:: ansible-option-sample-bold .. Anchors @@ -15,6 +30,10 @@ .. Anchors: short name for ansible.builtin +.. Anchors: aliases + + + .. Title netbox.netbox.netbox_power_port module -- Create, update or delete power ports within NetBox @@ -23,10 +42,7 @@ netbox.netbox.netbox_power_port module -- Create, update or delete power ports w .. Collection note .. note:: - This module is part of the `netbox.netbox collection `_ (version 3.17.0). - - It is not included in ``ansible-core``. - To check whether it is installed, run :code:`ansible-galaxy collection list`. + This module is part of the `netbox.netbox collection `_ (version 3.17.0). To install it, use: :code:`ansible-galaxy collection install netbox.netbox`. You need further requirements to be able to use this module, @@ -78,13 +94,12 @@ The below requirements are needed on the host that executes this module. Parameters ---------- -.. tabularcolumns:: \X{1}{3}\X{2}{3} +.. rst-class:: ansible-option-table .. list-table:: :width: 100% :widths: auto :header-rows: 1 - :class: longtable ansible-option-table * - Parameter - Comments @@ -104,9 +119,9 @@ Parameters - .. ansible-option-type-line:: + .. rst-class:: ansible-option-type-line - :ansible-option-type:`any` + :ansible-option-type:`any` .. raw:: html @@ -138,9 +153,9 @@ Parameters - .. ansible-option-type-line:: + .. rst-class:: ansible-option-type-line - :ansible-option-type:`dictionary` / :ansible-option-required:`required` + :ansible-option-type:`dictionary` / :ansible-option-required:`required` .. raw:: html @@ -162,10 +177,6 @@ Parameters
- .. raw:: latex - - \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} - .. _ansible_collections.netbox.netbox.netbox_power_port_module__parameter-data/allocated_draw: .. rst-class:: ansible-option-title @@ -176,18 +187,14 @@ Parameters - .. ansible-option-type-line:: + .. rst-class:: ansible-option-type-line - :ansible-option-type:`integer` + :ansible-option-type:`integer` .. raw:: html
- .. raw:: latex - - \end{minipage} - - .. raw:: html
@@ -204,10 +211,6 @@ Parameters
- .. raw:: latex - - \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} - .. _ansible_collections.netbox.netbox.netbox_power_port_module__parameter-data/description: .. rst-class:: ansible-option-title @@ -218,18 +221,14 @@ Parameters - .. ansible-option-type-line:: + .. rst-class:: ansible-option-type-line - :ansible-option-type:`string` + :ansible-option-type:`string` .. raw:: html
- .. raw:: latex - - \end{minipage} - - .. raw:: html
@@ -246,10 +245,6 @@ Parameters
- .. raw:: latex - - \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} - .. _ansible_collections.netbox.netbox.netbox_power_port_module__parameter-data/device: .. rst-class:: ansible-option-title @@ -260,18 +255,14 @@ Parameters - .. ansible-option-type-line:: + .. rst-class:: ansible-option-type-line - :ansible-option-type:`any` / :ansible-option-required:`required` + :ansible-option-type:`any` / :ansible-option-required:`required` .. raw:: html
- .. raw:: latex - - \end{minipage} - - .. raw:: html
@@ -286,11 +277,41 @@ Parameters * - .. raw:: html
-
+
+ + .. _ansible_collections.netbox.netbox.netbox_power_port_module__parameter-data/label: + + .. rst-class:: ansible-option-title + + **label** + + .. raw:: html + + + + .. rst-class:: ansible-option-type-line + + :ansible-option-type:`string` + + .. raw:: html + +
+ + - .. raw:: html + +
+ + The label of the power port - .. raw:: latex - \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} + .. raw:: html + +
+ + * - .. raw:: html + +
+
.. _ansible_collections.netbox.netbox.netbox_power_port_module__parameter-data/maximum_draw: @@ -302,18 +323,14 @@ Parameters - .. ansible-option-type-line:: + .. rst-class:: ansible-option-type-line - :ansible-option-type:`integer` + :ansible-option-type:`integer` .. raw:: html
- .. raw:: latex - - \end{minipage} - - .. raw:: html
@@ -330,10 +347,6 @@ Parameters
- .. raw:: latex - - \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} - .. _ansible_collections.netbox.netbox.netbox_power_port_module__parameter-data/name: .. rst-class:: ansible-option-title @@ -344,18 +357,14 @@ Parameters - .. ansible-option-type-line:: + .. rst-class:: ansible-option-type-line - :ansible-option-type:`string` / :ansible-option-required:`required` + :ansible-option-type:`string` / :ansible-option-required:`required` .. raw:: html
- .. raw:: latex - - \end{minipage} - - .. raw:: html
@@ -372,10 +381,6 @@ Parameters
- .. raw:: latex - - \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} - .. _ansible_collections.netbox.netbox.netbox_power_port_module__parameter-data/tags: .. rst-class:: ansible-option-title @@ -386,18 +391,14 @@ Parameters - .. ansible-option-type-line:: + .. rst-class:: ansible-option-type-line - :ansible-option-type:`list` / :ansible-option-elements:`elements=any` + :ansible-option-type:`list` / :ansible-option-elements:`elements=any` .. raw:: html
- .. raw:: latex - - \end{minipage} - - .. raw:: html
@@ -414,10 +415,6 @@ Parameters
- .. raw:: latex - - \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} - .. _ansible_collections.netbox.netbox.netbox_power_port_module__parameter-data/type: .. rst-class:: ansible-option-title @@ -428,18 +425,14 @@ Parameters - .. ansible-option-type-line:: + .. rst-class:: ansible-option-type-line - :ansible-option-type:`string` + :ansible-option-type:`string` .. raw:: html
- .. raw:: latex - - \end{minipage} - - .. raw:: html
@@ -573,9 +566,9 @@ Parameters - .. ansible-option-type-line:: + .. rst-class:: ansible-option-type-line - :ansible-option-type:`string` / :ansible-option-required:`required` + :ansible-option-type:`string` / :ansible-option-required:`required` .. raw:: html @@ -607,9 +600,9 @@ Parameters - .. ansible-option-type-line:: + .. rst-class:: ansible-option-type-line - :ansible-option-type:`string` / :ansible-option-required:`required` + :ansible-option-type:`string` / :ansible-option-required:`required` .. raw:: html @@ -643,9 +636,9 @@ Parameters - .. ansible-option-type-line:: + .. rst-class:: ansible-option-type-line - :ansible-option-type:`list` / :ansible-option-elements:`elements=string` + :ansible-option-type:`list` / :ansible-option-elements:`elements=string` .. raw:: html @@ -681,9 +674,9 @@ Parameters - .. ansible-option-type-line:: + .. rst-class:: ansible-option-type-line - :ansible-option-type:`string` + :ansible-option-type:`string` .. raw:: html @@ -723,9 +716,9 @@ Parameters - .. ansible-option-type-line:: + .. rst-class:: ansible-option-type-line - :ansible-option-type:`any` + :ansible-option-type:`any` .. raw:: html @@ -821,13 +814,12 @@ Return Values ------------- Common return values are documented :ref:`here `, the following are the fields unique to this module: -.. tabularcolumns:: \X{1}{3}\X{2}{3} +.. rst-class:: ansible-option-table .. list-table:: :width: 100% :widths: auto :header-rows: 1 - :class: longtable ansible-option-table * - Key - Description @@ -847,9 +839,9 @@ Common return values are documented :ref:`here `, the foll - .. ansible-option-type-line:: + .. rst-class:: ansible-option-type-line - :ansible-option-type:`string` + :ansible-option-type:`string` .. raw:: html @@ -887,9 +879,9 @@ Common return values are documented :ref:`here `, the foll - .. ansible-option-type-line:: + .. rst-class:: ansible-option-type-line - :ansible-option-type:`dictionary` + :ansible-option-type:`dictionary` .. raw:: html @@ -930,15 +922,12 @@ Authors Collection links ~~~~~~~~~~~~~~~~ -.. ansible-links:: - - - title: "Issue Tracker" - url: "https://github.com/netbox-community/ansible_modules/issues" - external: true - - title: "Repository (Sources)" - url: "https://github.com/netbox-community/ansible_modules" - external: true +.. raw:: html + .. Parsing errors diff --git a/plugins/modules/netbox_power_port.py b/plugins/modules/netbox_power_port.py index 7929c4728..428ca5672 100644 --- a/plugins/modules/netbox_power_port.py +++ b/plugins/modules/netbox_power_port.py @@ -41,6 +41,11 @@ - The name of the power port required: true type: str + label: + description: + - The label of the power port + required: false + type: str type: description: - The type of the power port @@ -244,6 +249,7 @@ def main(): options=dict( device=dict(required=True, type="raw"), name=dict(required=True, type="str"), + label=dict(required=False, type="str"), type=dict( required=False, choices=[ From 4e6081f2a3755dc610071001c1709f6d55a97ced Mon Sep 17 00:00:00 2001 From: Per-Ola Gustafsson Date: Mon, 8 Apr 2024 09:57:09 +0200 Subject: [PATCH 2/2] Added label to power port module --- docs/plugins/netbox_power_port_module.rst | 199 ++++++++++++---------- 1 file changed, 105 insertions(+), 94 deletions(-) diff --git a/docs/plugins/netbox_power_port_module.rst b/docs/plugins/netbox_power_port_module.rst index 604fc660f..9172b6cd6 100644 --- a/docs/plugins/netbox_power_port_module.rst +++ b/docs/plugins/netbox_power_port_module.rst @@ -6,23 +6,8 @@ .. |antsibull-internal-nbsp| unicode:: 0xA0 :trim: -.. role:: ansible-attribute-support-label -.. role:: ansible-attribute-support-property -.. role:: ansible-attribute-support-full -.. role:: ansible-attribute-support-partial -.. role:: ansible-attribute-support-none -.. role:: ansible-attribute-support-na -.. role:: ansible-option-type -.. role:: ansible-option-elements -.. role:: ansible-option-required -.. role:: ansible-option-versionadded -.. role:: ansible-option-aliases -.. role:: ansible-option-choices -.. role:: ansible-option-choices-default-mark -.. role:: ansible-option-default-bold -.. role:: ansible-option-configuration -.. role:: ansible-option-returned-bold -.. role:: ansible-option-sample-bold +.. meta:: + :antsibull-docs: 2.7.0 .. Anchors @@ -30,10 +15,6 @@ .. Anchors: short name for ansible.builtin -.. Anchors: aliases - - - .. Title netbox.netbox.netbox_power_port module -- Create, update or delete power ports within NetBox @@ -42,7 +23,10 @@ netbox.netbox.netbox_power_port module -- Create, update or delete power ports w .. Collection note .. note:: - This module is part of the `netbox.netbox collection `_ (version 3.17.0). + This module is part of the `netbox.netbox collection `_ (version 3.17.0). + + It is not included in ``ansible-core``. + To check whether it is installed, run :code:`ansible-galaxy collection list`. To install it, use: :code:`ansible-galaxy collection install netbox.netbox`. You need further requirements to be able to use this module, @@ -94,12 +78,13 @@ The below requirements are needed on the host that executes this module. Parameters ---------- -.. rst-class:: ansible-option-table +.. tabularcolumns:: \X{1}{3}\X{2}{3} .. list-table:: :width: 100% :widths: auto :header-rows: 1 + :class: longtable ansible-option-table * - Parameter - Comments @@ -119,9 +104,9 @@ Parameters - .. rst-class:: ansible-option-type-line + .. ansible-option-type-line:: - :ansible-option-type:`any` + :ansible-option-type:`any` .. raw:: html @@ -153,9 +138,9 @@ Parameters - .. rst-class:: ansible-option-type-line + .. ansible-option-type-line:: - :ansible-option-type:`dictionary` / :ansible-option-required:`required` + :ansible-option-type:`dictionary` / :ansible-option-required:`required` .. raw:: html @@ -177,6 +162,10 @@ Parameters
+ .. raw:: latex + + \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} + .. _ansible_collections.netbox.netbox.netbox_power_port_module__parameter-data/allocated_draw: .. rst-class:: ansible-option-title @@ -187,14 +176,18 @@ Parameters - .. rst-class:: ansible-option-type-line + .. ansible-option-type-line:: - :ansible-option-type:`integer` + :ansible-option-type:`integer` .. raw:: html
+ .. raw:: latex + + \end{minipage} + - .. raw:: html
@@ -211,6 +204,10 @@ Parameters
+ .. raw:: latex + + \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} + .. _ansible_collections.netbox.netbox.netbox_power_port_module__parameter-data/description: .. rst-class:: ansible-option-title @@ -221,14 +218,18 @@ Parameters - .. rst-class:: ansible-option-type-line + .. ansible-option-type-line:: - :ansible-option-type:`string` + :ansible-option-type:`string` .. raw:: html
+ .. raw:: latex + + \end{minipage} + - .. raw:: html
@@ -245,6 +246,10 @@ Parameters
+ .. raw:: latex + + \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} + .. _ansible_collections.netbox.netbox.netbox_power_port_module__parameter-data/device: .. rst-class:: ansible-option-title @@ -255,53 +260,23 @@ Parameters - .. rst-class:: ansible-option-type-line + .. ansible-option-type-line:: - :ansible-option-type:`any` / :ansible-option-required:`required` + :ansible-option-type:`any` / :ansible-option-required:`required` .. raw:: html
- - .. raw:: html - -
- - The device the power port is attached to - - - .. raw:: html - -
- - * - .. raw:: html - -
-
- - .. _ansible_collections.netbox.netbox.netbox_power_port_module__parameter-data/label: + .. raw:: latex - .. rst-class:: ansible-option-title - - **label** - - .. raw:: html - - - - .. rst-class:: ansible-option-type-line - - :ansible-option-type:`string` - - .. raw:: html - -
+ \end{minipage} - .. raw:: html
- The label of the power port + The device the power port is attached to .. raw:: html @@ -313,6 +288,10 @@ Parameters
+ .. raw:: latex + + \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} + .. _ansible_collections.netbox.netbox.netbox_power_port_module__parameter-data/maximum_draw: .. rst-class:: ansible-option-title @@ -323,14 +302,18 @@ Parameters - .. rst-class:: ansible-option-type-line + .. ansible-option-type-line:: - :ansible-option-type:`integer` + :ansible-option-type:`integer` .. raw:: html
+ .. raw:: latex + + \end{minipage} + - .. raw:: html
@@ -347,6 +330,10 @@ Parameters
+ .. raw:: latex + + \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} + .. _ansible_collections.netbox.netbox.netbox_power_port_module__parameter-data/name: .. rst-class:: ansible-option-title @@ -357,14 +344,18 @@ Parameters - .. rst-class:: ansible-option-type-line + .. ansible-option-type-line:: - :ansible-option-type:`string` / :ansible-option-required:`required` + :ansible-option-type:`string` / :ansible-option-required:`required` .. raw:: html
+ .. raw:: latex + + \end{minipage} + - .. raw:: html
@@ -381,6 +372,10 @@ Parameters
+ .. raw:: latex + + \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} + .. _ansible_collections.netbox.netbox.netbox_power_port_module__parameter-data/tags: .. rst-class:: ansible-option-title @@ -391,14 +386,18 @@ Parameters - .. rst-class:: ansible-option-type-line + .. ansible-option-type-line:: - :ansible-option-type:`list` / :ansible-option-elements:`elements=any` + :ansible-option-type:`list` / :ansible-option-elements:`elements=any` .. raw:: html
+ .. raw:: latex + + \end{minipage} + - .. raw:: html
@@ -415,6 +414,10 @@ Parameters
+ .. raw:: latex + + \hspace{0.02\textwidth}\begin{minipage}[t]{0.3\textwidth} + .. _ansible_collections.netbox.netbox.netbox_power_port_module__parameter-data/type: .. rst-class:: ansible-option-title @@ -425,14 +428,18 @@ Parameters - .. rst-class:: ansible-option-type-line + .. ansible-option-type-line:: - :ansible-option-type:`string` + :ansible-option-type:`string` .. raw:: html
+ .. raw:: latex + + \end{minipage} + - .. raw:: html
@@ -566,9 +573,9 @@ Parameters - .. rst-class:: ansible-option-type-line + .. ansible-option-type-line:: - :ansible-option-type:`string` / :ansible-option-required:`required` + :ansible-option-type:`string` / :ansible-option-required:`required` .. raw:: html @@ -600,9 +607,9 @@ Parameters - .. rst-class:: ansible-option-type-line + .. ansible-option-type-line:: - :ansible-option-type:`string` / :ansible-option-required:`required` + :ansible-option-type:`string` / :ansible-option-required:`required` .. raw:: html @@ -636,9 +643,9 @@ Parameters - .. rst-class:: ansible-option-type-line + .. ansible-option-type-line:: - :ansible-option-type:`list` / :ansible-option-elements:`elements=string` + :ansible-option-type:`list` / :ansible-option-elements:`elements=string` .. raw:: html @@ -674,9 +681,9 @@ Parameters - .. rst-class:: ansible-option-type-line + .. ansible-option-type-line:: - :ansible-option-type:`string` + :ansible-option-type:`string` .. raw:: html @@ -716,9 +723,9 @@ Parameters - .. rst-class:: ansible-option-type-line + .. ansible-option-type-line:: - :ansible-option-type:`any` + :ansible-option-type:`any` .. raw:: html @@ -814,12 +821,13 @@ Return Values ------------- Common return values are documented :ref:`here `, the following are the fields unique to this module: -.. rst-class:: ansible-option-table +.. tabularcolumns:: \X{1}{3}\X{2}{3} .. list-table:: :width: 100% :widths: auto :header-rows: 1 + :class: longtable ansible-option-table * - Key - Description @@ -839,9 +847,9 @@ Common return values are documented :ref:`here `, the foll - .. rst-class:: ansible-option-type-line + .. ansible-option-type-line:: - :ansible-option-type:`string` + :ansible-option-type:`string` .. raw:: html @@ -879,9 +887,9 @@ Common return values are documented :ref:`here `, the foll - .. rst-class:: ansible-option-type-line + .. ansible-option-type-line:: - :ansible-option-type:`dictionary` + :ansible-option-type:`dictionary` .. raw:: html @@ -922,12 +930,15 @@ Authors Collection links ~~~~~~~~~~~~~~~~ -.. raw:: html +.. ansible-links:: + + - title: "Issue Tracker" + url: "https://github.com/netbox-community/ansible_modules/issues" + external: true + - title: "Repository (Sources)" + url: "https://github.com/netbox-community/ansible_modules" + external: true - .. Parsing errors