Module: Legion::Extensions::Nautobot::Runners::Dcim
- Includes:
- Helpers::Lex, Helpers::Client
- Included in:
- Client
- Defined in:
- lib/legion/extensions/nautobot/runners/dcim.rb
Instance Method Summary collapse
- #create_cable(url: nil, token: nil, read_only: false, **attrs) ⇒ Object
- #create_device(url: nil, token: nil, read_only: false, **attrs) ⇒ Object
- #create_device_type(url: nil, token: nil, read_only: false, **attrs) ⇒ Object
- #create_interface(url: nil, token: nil, read_only: false, **attrs) ⇒ Object
- #create_location(url: nil, token: nil, read_only: false, **attrs) ⇒ Object
- #create_location_type(url: nil, token: nil, read_only: false, **attrs) ⇒ Object
- #create_manufacturer(url: nil, token: nil, read_only: false, **attrs) ⇒ Object
- #create_platform(url: nil, token: nil, read_only: false, **attrs) ⇒ Object
- #create_rack(url: nil, token: nil, read_only: false, **attrs) ⇒ Object
- #delete_cable(id:, url: nil, token: nil, read_only: false) ⇒ Object
- #delete_device(id:, url: nil, token: nil, read_only: false) ⇒ Object
- #delete_interface(id:, url: nil, token: nil, read_only: false) ⇒ Object
- #delete_location(id:, url: nil, token: nil, read_only: false) ⇒ Object
- #delete_rack(id:, url: nil, token: nil, read_only: false) ⇒ Object
- #get_cable(id:, url: nil, token: nil) ⇒ Object
- #get_device(id:, url: nil, token: nil) ⇒ Object
- #get_device_type(id:, url: nil, token: nil) ⇒ Object
- #get_interface(id:, url: nil, token: nil) ⇒ Object
- #get_location(id:, url: nil, token: nil) ⇒ Object
- #get_location_type(id:, url: nil, token: nil) ⇒ Object
- #get_manufacturer(id:, url: nil, token: nil) ⇒ Object
- #get_platform(id:, url: nil, token: nil) ⇒ Object
- #get_rack(id:, url: nil, token: nil) ⇒ Object
- #get_virtual_chassis(id:, url: nil, token: nil) ⇒ Object
-
#list_cables(url: nil, token: nil, **params) ⇒ Object
Cables.
-
#list_console_ports(url: nil, token: nil, **params) ⇒ Object
Console & Power Ports.
- #list_console_server_ports(url: nil, token: nil, **params) ⇒ Object
- #list_controller_managed_device_groups(url: nil, token: nil, **params) ⇒ Object
-
#list_controllers(url: nil, token: nil, **params) ⇒ Object
Controllers.
- #list_device_bays(url: nil, token: nil, **params) ⇒ Object
- #list_device_families(url: nil, token: nil, **params) ⇒ Object
- #list_device_redundancy_groups(url: nil, token: nil, **params) ⇒ Object
- #list_device_types(url: nil, token: nil, **params) ⇒ Object
-
#list_devices(url: nil, token: nil, **params) ⇒ Object
Devices.
-
#list_front_ports(url: nil, token: nil, **params) ⇒ Object
Front/Rear Ports & Device Bays.
- #list_interface_redundancy_groups(url: nil, token: nil, **params) ⇒ Object
-
#list_interfaces(url: nil, token: nil, **params) ⇒ Object
Interfaces.
- #list_inventory_items(url: nil, token: nil, **params) ⇒ Object
-
#list_location_types(url: nil, token: nil, **params) ⇒ Object
Locations.
- #list_locations(url: nil, token: nil, **params) ⇒ Object
-
#list_manufacturers(url: nil, token: nil, **params) ⇒ Object
Manufacturers & Device Types.
- #list_module_types(url: nil, token: nil, **params) ⇒ Object
-
#list_platforms(url: nil, token: nil, **params) ⇒ Object
Platforms.
- #list_power_feeds(url: nil, token: nil, **params) ⇒ Object
- #list_power_outlets(url: nil, token: nil, **params) ⇒ Object
- #list_power_panels(url: nil, token: nil, **params) ⇒ Object
- #list_power_ports(url: nil, token: nil, **params) ⇒ Object
-
#list_rack_groups(url: nil, token: nil, **params) ⇒ Object
Racks.
- #list_rack_reservations(url: nil, token: nil, **params) ⇒ Object
- #list_racks(url: nil, token: nil, **params) ⇒ Object
- #list_rear_ports(url: nil, token: nil, **params) ⇒ Object
- #list_software_image_files(url: nil, token: nil, **params) ⇒ Object
-
#list_software_versions(url: nil, token: nil, **params) ⇒ Object
Software.
-
#list_virtual_chassis(url: nil, token: nil, **params) ⇒ Object
Virtual Chassis & Redundancy.
- #update_device(id:, url: nil, token: nil, read_only: false, **attrs) ⇒ Object
- #update_interface(id:, url: nil, token: nil, read_only: false, **attrs) ⇒ Object
- #update_location(id:, url: nil, token: nil, read_only: false, **attrs) ⇒ Object
- #update_rack(id:, url: nil, token: nil, read_only: false, **attrs) ⇒ Object
Methods included from Helpers::Client
Instance Method Details
#create_cable(url: nil, token: nil, read_only: false, **attrs) ⇒ Object
237 238 239 240 241 242 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 237 def create_cable(url: nil, token: nil, read_only: false, **attrs) raise ReadOnlyError, 'Write operations disabled (read_only mode)' if read_only resp = connection(url: url, token: token).post('/api/dcim/cables/', attrs) resp.body end |
#create_device(url: nil, token: nil, read_only: false, **attrs) ⇒ Object
175 176 177 178 179 180 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 175 def create_device(url: nil, token: nil, read_only: false, **attrs) raise ReadOnlyError, 'Write operations disabled (read_only mode)' if read_only resp = connection(url: url, token: token).post('/api/dcim/devices/', attrs) resp.body end |
#create_device_type(url: nil, token: nil, read_only: false, **attrs) ⇒ Object
129 130 131 132 133 134 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 129 def create_device_type(url: nil, token: nil, read_only: false, **attrs) raise ReadOnlyError, 'Write operations disabled (read_only mode)' if read_only resp = connection(url: url, token: token).post('/api/dcim/device-types/', attrs) resp.body end |
#create_interface(url: nil, token: nil, read_only: false, **attrs) ⇒ Object
206 207 208 209 210 211 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 206 def create_interface(url: nil, token: nil, read_only: false, **attrs) raise ReadOnlyError, 'Write operations disabled (read_only mode)' if read_only resp = connection(url: url, token: token).post('/api/dcim/interfaces/', attrs) resp.body end |
#create_location(url: nil, token: nil, read_only: false, **attrs) ⇒ Object
40 41 42 43 44 45 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 40 def create_location(url: nil, token: nil, read_only: false, **attrs) raise ReadOnlyError, 'Write operations disabled (read_only mode)' if read_only resp = connection(url: url, token: token).post('/api/dcim/locations/', attrs) resp.body end |
#create_location_type(url: nil, token: nil, read_only: false, **attrs) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 23 def create_location_type(url: nil, token: nil, read_only: false, **attrs) raise ReadOnlyError, 'Write operations disabled (read_only mode)' if read_only resp = connection(url: url, token: token).post('/api/dcim/location-types/', attrs) resp.body end |
#create_manufacturer(url: nil, token: nil, read_only: false, **attrs) ⇒ Object
112 113 114 115 116 117 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 112 def create_manufacturer(url: nil, token: nil, read_only: false, **attrs) raise ReadOnlyError, 'Write operations disabled (read_only mode)' if read_only resp = connection(url: url, token: token).post('/api/dcim/manufacturers/', attrs) resp.body end |
#create_platform(url: nil, token: nil, read_only: false, **attrs) ⇒ Object
157 158 159 160 161 162 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 157 def create_platform(url: nil, token: nil, read_only: false, **attrs) raise ReadOnlyError, 'Write operations disabled (read_only mode)' if read_only resp = connection(url: url, token: token).post('/api/dcim/platforms/', attrs) resp.body end |
#create_rack(url: nil, token: nil, read_only: false, **attrs) ⇒ Object
76 77 78 79 80 81 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 76 def create_rack(url: nil, token: nil, read_only: false, **attrs) raise ReadOnlyError, 'Write operations disabled (read_only mode)' if read_only resp = connection(url: url, token: token).post('/api/dcim/racks/', attrs) resp.body end |
#delete_cable(id:, url: nil, token: nil, read_only: false) ⇒ Object
244 245 246 247 248 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 244 def delete_cable(id:, url: nil, token: nil, read_only: false, **) raise ReadOnlyError, 'Write operations disabled (read_only mode)' if read_only connection(url: url, token: token).delete("/api/dcim/cables/#{id}/") end |
#delete_device(id:, url: nil, token: nil, read_only: false) ⇒ Object
189 190 191 192 193 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 189 def delete_device(id:, url: nil, token: nil, read_only: false, **) raise ReadOnlyError, 'Write operations disabled (read_only mode)' if read_only connection(url: url, token: token).delete("/api/dcim/devices/#{id}/") end |
#delete_interface(id:, url: nil, token: nil, read_only: false) ⇒ Object
220 221 222 223 224 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 220 def delete_interface(id:, url: nil, token: nil, read_only: false, **) raise ReadOnlyError, 'Write operations disabled (read_only mode)' if read_only connection(url: url, token: token).delete("/api/dcim/interfaces/#{id}/") end |
#delete_location(id:, url: nil, token: nil, read_only: false) ⇒ Object
54 55 56 57 58 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 54 def delete_location(id:, url: nil, token: nil, read_only: false, **) raise ReadOnlyError, 'Write operations disabled (read_only mode)' if read_only connection(url: url, token: token).delete("/api/dcim/locations/#{id}/") end |
#delete_rack(id:, url: nil, token: nil, read_only: false) ⇒ Object
90 91 92 93 94 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 90 def delete_rack(id:, url: nil, token: nil, read_only: false, **) raise ReadOnlyError, 'Write operations disabled (read_only mode)' if read_only connection(url: url, token: token).delete("/api/dcim/racks/#{id}/") end |
#get_cable(id:, url: nil, token: nil) ⇒ Object
232 233 234 235 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 232 def get_cable(id:, url: nil, token: nil, **) resp = connection(url: url, token: token).get("/api/dcim/cables/#{id}/") resp.body end |
#get_device(id:, url: nil, token: nil) ⇒ Object
170 171 172 173 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 170 def get_device(id:, url: nil, token: nil, **) resp = connection(url: url, token: token).get("/api/dcim/devices/#{id}/") resp.body end |
#get_device_type(id:, url: nil, token: nil) ⇒ Object
124 125 126 127 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 124 def get_device_type(id:, url: nil, token: nil, **) resp = connection(url: url, token: token).get("/api/dcim/device-types/#{id}/") resp.body end |
#get_interface(id:, url: nil, token: nil) ⇒ Object
201 202 203 204 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 201 def get_interface(id:, url: nil, token: nil, **) resp = connection(url: url, token: token).get("/api/dcim/interfaces/#{id}/") resp.body end |
#get_location(id:, url: nil, token: nil) ⇒ Object
35 36 37 38 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 35 def get_location(id:, url: nil, token: nil, **) resp = connection(url: url, token: token).get("/api/dcim/locations/#{id}/") resp.body end |
#get_location_type(id:, url: nil, token: nil) ⇒ Object
18 19 20 21 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 18 def get_location_type(id:, url: nil, token: nil, **) resp = connection(url: url, token: token).get("/api/dcim/location-types/#{id}/") resp.body end |
#get_manufacturer(id:, url: nil, token: nil) ⇒ Object
107 108 109 110 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 107 def get_manufacturer(id:, url: nil, token: nil, **) resp = connection(url: url, token: token).get("/api/dcim/manufacturers/#{id}/") resp.body end |
#get_platform(id:, url: nil, token: nil) ⇒ Object
152 153 154 155 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 152 def get_platform(id:, url: nil, token: nil, **) resp = connection(url: url, token: token).get("/api/dcim/platforms/#{id}/") resp.body end |
#get_rack(id:, url: nil, token: nil) ⇒ Object
71 72 73 74 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 71 def get_rack(id:, url: nil, token: nil, **) resp = connection(url: url, token: token).get("/api/dcim/racks/#{id}/") resp.body end |
#get_virtual_chassis(id:, url: nil, token: nil) ⇒ Object
308 309 310 311 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 308 def get_virtual_chassis(id:, url: nil, token: nil, **) resp = connection(url: url, token: token).get("/api/dcim/virtual-chassis/#{id}/") resp.body end |
#list_cables(url: nil, token: nil, **params) ⇒ Object
Cables
227 228 229 230 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 227 def list_cables(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/cables/', params) resp.body end |
#list_console_ports(url: nil, token: nil, **params) ⇒ Object
Console & Power Ports
251 252 253 254 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 251 def list_console_ports(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/console-ports/', params) resp.body end |
#list_console_server_ports(url: nil, token: nil, **params) ⇒ Object
256 257 258 259 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 256 def list_console_server_ports(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/console-server-ports/', params) resp.body end |
#list_controller_managed_device_groups(url: nil, token: nil, **params) ⇒ Object
340 341 342 343 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 340 def list_controller_managed_device_groups(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/controller-managed-device-groups/', params) resp.body end |
#list_controllers(url: nil, token: nil, **params) ⇒ Object
Controllers
335 336 337 338 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 335 def list_controllers(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/controllers/', params) resp.body end |
#list_device_bays(url: nil, token: nil, **params) ⇒ Object
292 293 294 295 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 292 def list_device_bays(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/device-bays/', params) resp.body end |
#list_device_families(url: nil, token: nil, **params) ⇒ Object
136 137 138 139 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 136 def list_device_families(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/device-families/', params) resp.body end |
#list_device_redundancy_groups(url: nil, token: nil, **params) ⇒ Object
313 314 315 316 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 313 def list_device_redundancy_groups(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/device-redundancy-groups/', params) resp.body end |
#list_device_types(url: nil, token: nil, **params) ⇒ Object
119 120 121 122 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 119 def list_device_types(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/device-types/', params) resp.body end |
#list_devices(url: nil, token: nil, **params) ⇒ Object
Devices
165 166 167 168 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 165 def list_devices(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/devices/', params) resp.body end |
#list_front_ports(url: nil, token: nil, **params) ⇒ Object
Front/Rear Ports & Device Bays
282 283 284 285 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 282 def list_front_ports(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/front-ports/', params) resp.body end |
#list_interface_redundancy_groups(url: nil, token: nil, **params) ⇒ Object
318 319 320 321 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 318 def list_interface_redundancy_groups(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/interface-redundancy-groups/', params) resp.body end |
#list_interfaces(url: nil, token: nil, **params) ⇒ Object
Interfaces
196 197 198 199 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 196 def list_interfaces(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/interfaces/', params) resp.body end |
#list_inventory_items(url: nil, token: nil, **params) ⇒ Object
297 298 299 300 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 297 def list_inventory_items(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/inventory-items/', params) resp.body end |
#list_location_types(url: nil, token: nil, **params) ⇒ Object
Locations
13 14 15 16 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 13 def list_location_types(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/location-types/', params) resp.body end |
#list_locations(url: nil, token: nil, **params) ⇒ Object
30 31 32 33 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 30 def list_locations(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/locations/', params) resp.body end |
#list_manufacturers(url: nil, token: nil, **params) ⇒ Object
Manufacturers & Device Types
102 103 104 105 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 102 def list_manufacturers(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/manufacturers/', params) resp.body end |
#list_module_types(url: nil, token: nil, **params) ⇒ Object
141 142 143 144 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 141 def list_module_types(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/module-types/', params) resp.body end |
#list_platforms(url: nil, token: nil, **params) ⇒ Object
Platforms
147 148 149 150 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 147 def list_platforms(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/platforms/', params) resp.body end |
#list_power_feeds(url: nil, token: nil, **params) ⇒ Object
276 277 278 279 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 276 def list_power_feeds(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/power-feeds/', params) resp.body end |
#list_power_outlets(url: nil, token: nil, **params) ⇒ Object
266 267 268 269 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 266 def list_power_outlets(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/power-outlets/', params) resp.body end |
#list_power_panels(url: nil, token: nil, **params) ⇒ Object
271 272 273 274 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 271 def list_power_panels(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/power-panels/', params) resp.body end |
#list_power_ports(url: nil, token: nil, **params) ⇒ Object
261 262 263 264 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 261 def list_power_ports(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/power-ports/', params) resp.body end |
#list_rack_groups(url: nil, token: nil, **params) ⇒ Object
Racks
61 62 63 64 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 61 def list_rack_groups(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/rack-groups/', params) resp.body end |
#list_rack_reservations(url: nil, token: nil, **params) ⇒ Object
96 97 98 99 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 96 def list_rack_reservations(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/rack-reservations/', params) resp.body end |
#list_racks(url: nil, token: nil, **params) ⇒ Object
66 67 68 69 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 66 def list_racks(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/racks/', params) resp.body end |
#list_rear_ports(url: nil, token: nil, **params) ⇒ Object
287 288 289 290 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 287 def list_rear_ports(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/rear-ports/', params) resp.body end |
#list_software_image_files(url: nil, token: nil, **params) ⇒ Object
329 330 331 332 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 329 def list_software_image_files(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/software-image-files/', params) resp.body end |
#list_software_versions(url: nil, token: nil, **params) ⇒ Object
Software
324 325 326 327 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 324 def list_software_versions(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/software-versions/', params) resp.body end |
#list_virtual_chassis(url: nil, token: nil, **params) ⇒ Object
Virtual Chassis & Redundancy
303 304 305 306 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 303 def list_virtual_chassis(url: nil, token: nil, **params) resp = connection(url: url, token: token).get('/api/dcim/virtual-chassis/', params) resp.body end |
#update_device(id:, url: nil, token: nil, read_only: false, **attrs) ⇒ Object
182 183 184 185 186 187 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 182 def update_device(id:, url: nil, token: nil, read_only: false, **attrs) raise ReadOnlyError, 'Write operations disabled (read_only mode)' if read_only resp = connection(url: url, token: token).patch("/api/dcim/devices/#{id}/", attrs) resp.body end |
#update_interface(id:, url: nil, token: nil, read_only: false, **attrs) ⇒ Object
213 214 215 216 217 218 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 213 def update_interface(id:, url: nil, token: nil, read_only: false, **attrs) raise ReadOnlyError, 'Write operations disabled (read_only mode)' if read_only resp = connection(url: url, token: token).patch("/api/dcim/interfaces/#{id}/", attrs) resp.body end |
#update_location(id:, url: nil, token: nil, read_only: false, **attrs) ⇒ Object
47 48 49 50 51 52 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 47 def update_location(id:, url: nil, token: nil, read_only: false, **attrs) raise ReadOnlyError, 'Write operations disabled (read_only mode)' if read_only resp = connection(url: url, token: token).patch("/api/dcim/locations/#{id}/", attrs) resp.body end |
#update_rack(id:, url: nil, token: nil, read_only: false, **attrs) ⇒ Object
83 84 85 86 87 88 |
# File 'lib/legion/extensions/nautobot/runners/dcim.rb', line 83 def update_rack(id:, url: nil, token: nil, read_only: false, **attrs) raise ReadOnlyError, 'Write operations disabled (read_only mode)' if read_only resp = connection(url: url, token: token).patch("/api/dcim/racks/#{id}/", attrs) resp.body end |