Skip to content

Commit 70641b4

Browse files
authored
Updates the console port and console server port modules for the v3.3 api. (#866)
* This updates the console port and console server port modules. Adds: - attach cable to pre-existing cable. - set custom_fields - set port label - set port speed - mark the cable as connected.
1 parent 43ab818 commit 70641b4

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

plugins/modules/netbox_console_port.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,53 @@
5050
- rj-11
5151
- rj-12
5252
- rj-45
53+
- mini-din-8
5354
- usb-a
5455
- usb-b
5556
- usb-c
5657
- usb-mini-a
5758
- usb-mini-b
5859
- usb-micro-a
5960
- usb-micro-b
61+
- usb-micro-ab
6062
- other
6163
required: false
6264
type: str
65+
cable:
66+
description:
67+
- cable to connect port to.
68+
required: false
69+
type: dict
70+
custom_fields:
71+
description:
72+
- must exist in netbox
73+
required: false
74+
type: dict
6375
description:
6476
description:
6577
- Description of the console port
6678
required: false
6779
type: str
80+
label:
81+
description:
82+
- label of the console port
83+
required: false
84+
type: str
85+
mark_connected:
86+
description:
87+
- Treats as if a cable is connected to the port
88+
required: false
89+
type: bool
90+
module:
91+
description:
92+
- module that provides the console port.
93+
required: false
94+
type: int
95+
speed:
96+
description:
97+
- the port speed
98+
required: false
99+
type: int
68100
tags:
69101
description:
70102
- Any tags that the console port may need to be associated with
@@ -153,18 +185,26 @@ def main():
153185
"rj-11",
154186
"rj-12",
155187
"rj-45",
188+
"mini-din-8",
156189
"usb-a",
157190
"usb-b",
158191
"usb-c",
159192
"usb-mini-a",
160193
"usb-mini-b",
161194
"usb-micro-a",
162195
"usb-micro-b",
196+
"usb-micro-ab",
163197
"other",
164198
],
165199
type="str",
166200
),
201+
cable=dict(required=False, type="dict"),
202+
custom_fields=dict(required=False, type="dict"),
167203
description=dict(required=False, type="str"),
204+
module=dict(required=False, type="int"),
205+
label=dict(required=False, type="str"),
206+
mark_connected=dict(required=False, type="bool"),
207+
speed=dict(required=False, type="int"),
168208
tags=dict(required=False, type="list", elements="raw"),
169209
),
170210
),

plugins/modules/netbox_console_server_port.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,48 @@
5050
- rj-11
5151
- rj-12
5252
- rj-45
53+
- mini-din-8
5354
- usb-a
5455
- usb-b
5556
- usb-c
5657
- usb-mini-a
5758
- usb-mini-b
5859
- usb-micro-a
5960
- usb-micro-b
61+
- usb-micro-ab
6062
- other
6163
required: false
6264
type: str
65+
cable:
66+
description:
67+
- cable to attach port to. Must exist.
68+
type: dict
69+
required: false
70+
custom_fields:
71+
description:
72+
- must exist in netbox
73+
type: dict
74+
required: false
6375
description:
6476
description:
6577
- Description of the console server port
6678
required: false
6779
type: str
80+
label:
81+
description:
82+
- label of the conserver server port
83+
required: false
84+
type: str
85+
mark_connected:
86+
description:
87+
- Treats as if a cable is connected to the port
88+
required: false
89+
type: bool
90+
speed:
91+
description:
92+
- sets the port speed
93+
required: false
94+
type: int
6895
tags:
6996
description:
7097
- Any tags that the console server port may need to be associated with
@@ -97,6 +124,7 @@
97124
name: Test Console Server Port
98125
device: Test Device
99126
type: usb-a
127+
speed: 11500
100128
description: console server port description
101129
state: present
102130
@@ -153,18 +181,25 @@ def main():
153181
"rj-11",
154182
"rj-12",
155183
"rj-45",
184+
"mini-din-8",
156185
"usb-a",
157186
"usb-b",
158187
"usb-c",
159188
"usb-mini-a",
160189
"usb-mini-b",
161190
"usb-micro-a",
162191
"usb-micro-b",
192+
"usb-micro-ab",
163193
"other",
164194
],
165195
type="str",
166196
),
197+
cable=dict(required=False, type="dict"),
198+
custom_fields=dict(required=False, type="dict"),
167199
description=dict(required=False, type="str"),
200+
label=dict(required=False, type="str"),
201+
speed=dict(required=False, type="int"),
202+
mark_connected=dict(required=False, type="bool"),
168203
tags=dict(required=False, type="list", elements="raw"),
169204
),
170205
),

0 commit comments

Comments
 (0)