Field Serviceable Units API Package¶
nautobot_fsus.api
¶
mixins
¶
Classes to handle user-definable fields and common validations.
FSUModelSerializer
¶
Bases: NautobotModelSerializer
, TaggedModelSerializerMixin
Extend the standard Nautobot model serializer with FSU-specific validations.
Source code in nautobot_fsus/api/mixins.py
Meta
¶
FSUModelSerializer model options.
Source code in nautobot_fsus/api/mixins.py
run_validators(value)
¶
Test the given value against all the validators on the field.
Have to provide our own version of this because FSUs have two unique together constraints, but only one of this is valid for any given instance - either (name, device) or (name, location). If you try to check both, one of them will always raise an error because its field is missing.
Source code in nautobot_fsus/api/mixins.py
validate(data)
¶
Validate the incoming POST/PUT/PATCH data.
Source code in nautobot_fsus/api/mixins.py
FSUTemplateModelSerializer
¶
Bases: NautobotModelSerializer
Base class for FSU template serializers.
Source code in nautobot_fsus/api/mixins.py
FSUTypeModelSerializer
¶
Bases: NautobotModelSerializer
, TaggedModelSerializerMixin
Base class for FSU type serializers.
Source code in nautobot_fsus/api/mixins.py
serializers
¶
API serializers for Nautobot FSUs app models.
CPUSerializer
¶
Bases: FSUModelSerializer
API serializer for CPU model.
Source code in nautobot_fsus/api/serializers/fsus.py
CPUTemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for CPUTemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
CPUTypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for CPUType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
DiskSerializer
¶
Bases: FSUModelSerializer
API serializer for Disk model.
Source code in nautobot_fsus/api/serializers/fsus.py
DiskTemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for DiskTemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
DiskTypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for DiskType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
FanSerializer
¶
Bases: FSUModelSerializer
API serializer for Fan model.
Source code in nautobot_fsus/api/serializers/fsus.py
FanTemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for FanTemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
FanTypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for FanType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
GPUBaseboardSerializer
¶
Bases: FSUModelSerializer
API serializer for GPUBaseboard model.
Source code in nautobot_fsus/api/serializers/fsus.py
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 |
|
Meta
¶
create(validated_data)
¶
Create a new GPUBaseboard instance with child GPU validation.
Source code in nautobot_fsus/api/serializers/fsus.py
update(instance, validated_data)
¶
Update an existing GPUBaseboard instance.
PUT requests must have all required field, PATCH requests need only the changed fields. When updating a GPUBaseboard instance, child GPUs update logic is: - gpus not set or null, device and storage location not updated -> no changes - gpus set and device is not set or instance device is None -> ValidationError - gpus is an empty list -> clear parent_gpubaseboard on any existing child GPUs - gpus is set, device is set or instance.device is not None and any gpu.device is not the same as the device value or the instance.device -> ValidationError - gpus is set, device is set or instance.device is not None -> set parent_gpubaseboard to instance for GPUs in the list, clear parent_gpubaseboard for any that are currently set to the instance but are not in the list - gpus not set or null and storage location set -> clear any existing child GPUs
Source code in nautobot_fsus/api/serializers/fsus.py
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 |
|
validate(data)
¶
Need to hide the gpus field from normal validation.
Source code in nautobot_fsus/api/serializers/fsus.py
GPUBaseboardTemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for GPUBaseboardTemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
GPUBaseboardTypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for GPUBaseboardType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
GPUSerializer
¶
Bases: FSUModelSerializer
API serializer for GPU model.
Source code in nautobot_fsus/api/serializers/fsus.py
GPUTemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for GPUTemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
GPUTypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for GPUType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
HBASerializer
¶
Bases: FSUModelSerializer
API serializer for HBA model.
Source code in nautobot_fsus/api/serializers/fsus.py
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 |
|
Meta
¶
create(validated_data)
¶
Create a new HBA instance with child Disk validation.
Source code in nautobot_fsus/api/serializers/fsus.py
update(instance, validated_data)
¶
Update an existing HBA instance.
PUT requests must have all required field, PATCH requests need only the changed fields. When updating an HBA instance, child Disks update logic is: - disks not set or null, device and storage location not updated -> no changes - disks set and device is not set or instance device is None -> ValidationError - disks is an empty list -> clear parent_hba on any existing child Disks - disks is set, device is set or instance.device is not None and any disk.device is not the same as the device value or the instance.device -> ValidationError - disks is set, device is set or instance.device is not None -> set parent_hba to instance for Disks in the list, clear parent_hba for any that are currently set to the instance but are not in the list - disks not set or null and storage location set -> clear any existing child Disks
Source code in nautobot_fsus/api/serializers/fsus.py
validate(data)
¶
Need to hide the disks field from normal validation.
Source code in nautobot_fsus/api/serializers/fsus.py
HBATemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for HBATemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
HBATypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for HBAType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
MainboardSerializer
¶
Bases: FSUModelSerializer
API serializer for Mainboard model.
Source code in nautobot_fsus/api/serializers/fsus.py
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 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 |
|
Meta
¶
create(validated_data)
¶
Create a new Mainboard instance with child CPU validation.
Source code in nautobot_fsus/api/serializers/fsus.py
update(instance, validated_data)
¶
Update an existing Mainboard instance.
PUT requests must have all required field, PATCH requests need only the changed fields. When updating a Mainboard instance, child CPUs update logic is: - cpus not set or null, device and storage location not updated -> no changes - cpus set and device is not set or instance device is None -> ValidationError - cpus is an empty list -> clear parent_mainboard on any existing child CPUs - cpus is set, device is set or instance.device is not None and any cpu.device is not the same as the device value or the instance.device -> ValidationError - cpus is set, device is set or instance.device is not None -> set parent_mainboard to instance for CPUs in the list, clear parent_mainboard for any that are currently set to the instance but are not in the list - cpus not set or null and storage location set -> clear any existing child CPUs
Source code in nautobot_fsus/api/serializers/fsus.py
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 |
|
validate(data)
¶
Need to hide the cpus field from normal validation.
Source code in nautobot_fsus/api/serializers/fsus.py
MainboardTemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for MainboardTemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
MainboardTypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for MainboardType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
NICSerializer
¶
Bases: FSUModelSerializer
API serializer for NIC model.
Source code in nautobot_fsus/api/serializers/fsus.py
515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 |
|
Meta
¶
create(validated_data)
¶
Create a new NIC instance with child Interface validation.
Source code in nautobot_fsus/api/serializers/fsus.py
update(instance, validated_data)
¶
Update an existing NIC instance.
PUT requests must have all required field, PATCH requests need only the changed fields. When updating a NIC instance, child Interface update logic is: - interfaces not set or null, device and storage location not updated -> no changes - interfaces set and device is not set or instance device is None -> ValidationError - interfaces is an empty list -> clear parent_nic on any existing child Interfaces - interfaces is set, device is set or instance.device is not None and any interfaces.device is not the same as the device value or the instance.device -> ValidationError - interfaces is set, device is set or instance.device is not None -> set parent_nic to instance for Interfaces in the list, clear parent_nic for any that are currently set to the instance but are not in the list - interfaces not set or null and storage location set -> clear any existing child Interfaces
Source code in nautobot_fsus/api/serializers/fsus.py
NICTemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for NICTemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
NICTypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for NICType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
OtherFSUSerializer
¶
Bases: FSUModelSerializer
API serializer for Other FSU model.
Source code in nautobot_fsus/api/serializers/fsus.py
OtherFSUTemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for OtherFSUTemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
OtherFSUTypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for OtherFSUType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
PSUSerializer
¶
Bases: FSUModelSerializer
API serializer for PSU model.
Source code in nautobot_fsus/api/serializers/fsus.py
653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 |
|
Meta
¶
create(validated_data)
¶
Create a new PSU instance with child PowerPort validation.
Source code in nautobot_fsus/api/serializers/fsus.py
update(instance, validated_data)
¶
Update an existing PSU instance.
PUT requests must have all required field, PATCH requests need only the changed fields. When updating a PSU instance, child PowerPort update logic is: - power_ports not set or null, device and storage location not updated -> no changes - power_ports set and device is not set or instance device is None -> ValidationError - power_ports is an empty list -> clear power_ports on the instance - power_ports is set, device is set or instance.device is not None and any power_ports.device is not the same as the device value or the instance.device -> ValidationError - power_ports is set, device is set or instance.device is not None -> set power_ports on the instance to the new list. - power_ports not set or null and storage location set -> clear any existing child PowerPorts
Source code in nautobot_fsus/api/serializers/fsus.py
PSUTemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for PSUTemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
PSUTypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for PSUType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
RAMModuleSerializer
¶
Bases: FSUModelSerializer
API serializer for RAM Module model.
Source code in nautobot_fsus/api/serializers/fsus.py
RAMModuleTemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for RAMModuleTemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
RAMModuleTypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for RAMModuleType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
fsu_templates
¶
Model serializers for FSU template API endpoints.
CPUTemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for CPUTemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
DiskTemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for DiskTemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
FanTemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for FanTemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
GPUBaseboardTemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for GPUBaseboardTemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
GPUTemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for GPUTemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
HBATemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for HBATemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
MainboardTemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for MainboardTemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
NICTemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for NICTemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
OtherFSUTemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for OtherFSUTemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
PSUTemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for PSUTemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
RAMModuleTemplateSerializer
¶
Bases: FSUTemplateModelSerializer
API serializer for RAMModuleTemplate model.
Source code in nautobot_fsus/api/serializers/fsu_templates.py
fsu_types
¶
Model serializers for FSU type API endpoints.
CPUTypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for CPUType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
DiskTypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for DiskType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
FanTypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for FanType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
GPUBaseboardTypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for GPUBaseboardType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
GPUTypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for GPUType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
HBATypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for HBAType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
MainboardTypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for MainboardType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
NICTypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for NICType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
OtherFSUTypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for OtherFSUType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
PSUTypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for PSUType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
RAMModuleTypeSerializer
¶
Bases: FSUTypeModelSerializer
API serializer for RAMModuleType model.
Source code in nautobot_fsus/api/serializers/fsu_types.py
fsus
¶
Model serializers for FSU API endpoints.
CPUSerializer
¶
Bases: FSUModelSerializer
API serializer for CPU model.
Source code in nautobot_fsus/api/serializers/fsus.py
DiskSerializer
¶
Bases: FSUModelSerializer
API serializer for Disk model.
Source code in nautobot_fsus/api/serializers/fsus.py
FanSerializer
¶
Bases: FSUModelSerializer
API serializer for Fan model.
Source code in nautobot_fsus/api/serializers/fsus.py
GPUBaseboardSerializer
¶
Bases: FSUModelSerializer
API serializer for GPUBaseboard model.
Source code in nautobot_fsus/api/serializers/fsus.py
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 |
|
Meta
¶
create(validated_data)
¶
Create a new GPUBaseboard instance with child GPU validation.
Source code in nautobot_fsus/api/serializers/fsus.py
update(instance, validated_data)
¶
Update an existing GPUBaseboard instance.
PUT requests must have all required field, PATCH requests need only the changed fields. When updating a GPUBaseboard instance, child GPUs update logic is: - gpus not set or null, device and storage location not updated -> no changes - gpus set and device is not set or instance device is None -> ValidationError - gpus is an empty list -> clear parent_gpubaseboard on any existing child GPUs - gpus is set, device is set or instance.device is not None and any gpu.device is not the same as the device value or the instance.device -> ValidationError - gpus is set, device is set or instance.device is not None -> set parent_gpubaseboard to instance for GPUs in the list, clear parent_gpubaseboard for any that are currently set to the instance but are not in the list - gpus not set or null and storage location set -> clear any existing child GPUs
Source code in nautobot_fsus/api/serializers/fsus.py
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 |
|
validate(data)
¶
Need to hide the gpus field from normal validation.
Source code in nautobot_fsus/api/serializers/fsus.py
GPUSerializer
¶
Bases: FSUModelSerializer
API serializer for GPU model.
Source code in nautobot_fsus/api/serializers/fsus.py
HBASerializer
¶
Bases: FSUModelSerializer
API serializer for HBA model.
Source code in nautobot_fsus/api/serializers/fsus.py
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 |
|
Meta
¶
create(validated_data)
¶
Create a new HBA instance with child Disk validation.
Source code in nautobot_fsus/api/serializers/fsus.py
update(instance, validated_data)
¶
Update an existing HBA instance.
PUT requests must have all required field, PATCH requests need only the changed fields. When updating an HBA instance, child Disks update logic is: - disks not set or null, device and storage location not updated -> no changes - disks set and device is not set or instance device is None -> ValidationError - disks is an empty list -> clear parent_hba on any existing child Disks - disks is set, device is set or instance.device is not None and any disk.device is not the same as the device value or the instance.device -> ValidationError - disks is set, device is set or instance.device is not None -> set parent_hba to instance for Disks in the list, clear parent_hba for any that are currently set to the instance but are not in the list - disks not set or null and storage location set -> clear any existing child Disks
Source code in nautobot_fsus/api/serializers/fsus.py
validate(data)
¶
Need to hide the disks field from normal validation.
Source code in nautobot_fsus/api/serializers/fsus.py
MainboardSerializer
¶
Bases: FSUModelSerializer
API serializer for Mainboard model.
Source code in nautobot_fsus/api/serializers/fsus.py
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 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 |
|
Meta
¶
create(validated_data)
¶
Create a new Mainboard instance with child CPU validation.
Source code in nautobot_fsus/api/serializers/fsus.py
update(instance, validated_data)
¶
Update an existing Mainboard instance.
PUT requests must have all required field, PATCH requests need only the changed fields. When updating a Mainboard instance, child CPUs update logic is: - cpus not set or null, device and storage location not updated -> no changes - cpus set and device is not set or instance device is None -> ValidationError - cpus is an empty list -> clear parent_mainboard on any existing child CPUs - cpus is set, device is set or instance.device is not None and any cpu.device is not the same as the device value or the instance.device -> ValidationError - cpus is set, device is set or instance.device is not None -> set parent_mainboard to instance for CPUs in the list, clear parent_mainboard for any that are currently set to the instance but are not in the list - cpus not set or null and storage location set -> clear any existing child CPUs
Source code in nautobot_fsus/api/serializers/fsus.py
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 |
|
validate(data)
¶
Need to hide the cpus field from normal validation.
Source code in nautobot_fsus/api/serializers/fsus.py
NICSerializer
¶
Bases: FSUModelSerializer
API serializer for NIC model.
Source code in nautobot_fsus/api/serializers/fsus.py
515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 |
|
Meta
¶
create(validated_data)
¶
Create a new NIC instance with child Interface validation.
Source code in nautobot_fsus/api/serializers/fsus.py
update(instance, validated_data)
¶
Update an existing NIC instance.
PUT requests must have all required field, PATCH requests need only the changed fields. When updating a NIC instance, child Interface update logic is: - interfaces not set or null, device and storage location not updated -> no changes - interfaces set and device is not set or instance device is None -> ValidationError - interfaces is an empty list -> clear parent_nic on any existing child Interfaces - interfaces is set, device is set or instance.device is not None and any interfaces.device is not the same as the device value or the instance.device -> ValidationError - interfaces is set, device is set or instance.device is not None -> set parent_nic to instance for Interfaces in the list, clear parent_nic for any that are currently set to the instance but are not in the list - interfaces not set or null and storage location set -> clear any existing child Interfaces
Source code in nautobot_fsus/api/serializers/fsus.py
OtherFSUSerializer
¶
Bases: FSUModelSerializer
API serializer for Other FSU model.
Source code in nautobot_fsus/api/serializers/fsus.py
PSUSerializer
¶
Bases: FSUModelSerializer
API serializer for PSU model.
Source code in nautobot_fsus/api/serializers/fsus.py
653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 |
|
Meta
¶
create(validated_data)
¶
Create a new PSU instance with child PowerPort validation.
Source code in nautobot_fsus/api/serializers/fsus.py
update(instance, validated_data)
¶
Update an existing PSU instance.
PUT requests must have all required field, PATCH requests need only the changed fields. When updating a PSU instance, child PowerPort update logic is: - power_ports not set or null, device and storage location not updated -> no changes - power_ports set and device is not set or instance device is None -> ValidationError - power_ports is an empty list -> clear power_ports on the instance - power_ports is set, device is set or instance.device is not None and any power_ports.device is not the same as the device value or the instance.device -> ValidationError - power_ports is set, device is set or instance.device is not None -> set power_ports on the instance to the new list. - power_ports not set or null and storage location set -> clear any existing child PowerPorts
Source code in nautobot_fsus/api/serializers/fsus.py
RAMModuleSerializer
¶
Bases: FSUModelSerializer
API serializer for RAM Module model.
Source code in nautobot_fsus/api/serializers/fsus.py
urls
¶
URL routes for FSU API endpoint views.
views
¶
API endpoint views for the Nautobot FSUs app.
CPUAPIView
¶
CPUTemplateAPIView
¶
Bases: NautobotModelViewSet
API view set for CPUTemplates.
Source code in nautobot_fsus/api/views.py
CPUTypeAPIView
¶
Bases: NautobotModelViewSet
API view set for CPUTypes.
Source code in nautobot_fsus/api/views.py
DiskAPIView
¶
Bases: NautobotModelViewSet
API view set for Disks.
Source code in nautobot_fsus/api/views.py
DiskTemplateAPIView
¶
Bases: NautobotModelViewSet
API view set for DiskTemplates.
Source code in nautobot_fsus/api/views.py
DiskTypeAPIView
¶
Bases: NautobotModelViewSet
API view set for DiskTypes.
Source code in nautobot_fsus/api/views.py
FanAPIView
¶
FanTemplateAPIView
¶
Bases: NautobotModelViewSet
API view set for FanTemplates.
Source code in nautobot_fsus/api/views.py
FanTypeAPIView
¶
Bases: NautobotModelViewSet
API view set for FanTypes.
Source code in nautobot_fsus/api/views.py
GPUAPIView
¶
Bases: NautobotModelViewSet
API view set for GPUs.
Source code in nautobot_fsus/api/views.py
GPUBaseboardAPIView
¶
Bases: NautobotModelViewSet
API view set for GPU Baseboards.
Source code in nautobot_fsus/api/views.py
GPUBaseboardTemplateAPIView
¶
Bases: NautobotModelViewSet
API view set for GPU Baseboard Templates.
Source code in nautobot_fsus/api/views.py
GPUBaseboardTypeAPIView
¶
Bases: NautobotModelViewSet
API view set for GPU Baseboard Types.
Source code in nautobot_fsus/api/views.py
GPUTemplateAPIView
¶
Bases: NautobotModelViewSet
API view set for GPUTemplates.
Source code in nautobot_fsus/api/views.py
GPUTypeAPIView
¶
Bases: NautobotModelViewSet
API view set for GPUTypes.
Source code in nautobot_fsus/api/views.py
HBAAPIView
¶
Bases: NautobotModelViewSet
API view set for HBAs.
Source code in nautobot_fsus/api/views.py
HBATemplateAPIView
¶
Bases: NautobotModelViewSet
API view set for HBA Templates.
Source code in nautobot_fsus/api/views.py
HBATypeAPIView
¶
Bases: NautobotModelViewSet
API view set for HBA Types.
Source code in nautobot_fsus/api/views.py
MainboardAPIView
¶
Bases: NautobotModelViewSet
API view set for Mainboards.
Source code in nautobot_fsus/api/views.py
MainboardTemplateAPIView
¶
Bases: NautobotModelViewSet
API view set for Mainboard Templates.
Source code in nautobot_fsus/api/views.py
MainboardTypeAPIView
¶
Bases: NautobotModelViewSet
API view set for Mainboard Types.
Source code in nautobot_fsus/api/views.py
NICAPIView
¶
Bases: NautobotModelViewSet
API view set for NICs.
Source code in nautobot_fsus/api/views.py
NICTemplateAPIView
¶
Bases: NautobotModelViewSet
API view set for NIC Templates.
Source code in nautobot_fsus/api/views.py
NICTypeAPIView
¶
Bases: NautobotModelViewSet
API view set for NIC Types.
Source code in nautobot_fsus/api/views.py
OtherFSUAPIView
¶
Bases: NautobotModelViewSet
API view set for Other FSUs.
Source code in nautobot_fsus/api/views.py
OtherFSUTemplateAPIView
¶
Bases: NautobotModelViewSet
API view set for Other FSU Templates.
Source code in nautobot_fsus/api/views.py
OtherFSUTypeAPIView
¶
Bases: NautobotModelViewSet
API view set for Other FSU Types.
Source code in nautobot_fsus/api/views.py
PSUAPIView
¶
Bases: NautobotModelViewSet
API view set for PSUs.
Source code in nautobot_fsus/api/views.py
PSUTemplateAPIView
¶
Bases: NautobotModelViewSet
API view set for PSU Templates.
Source code in nautobot_fsus/api/views.py
PSUTypeAPIView
¶
Bases: NautobotModelViewSet
API view set for PSU Types.
Source code in nautobot_fsus/api/views.py
RAMModuleAPIView
¶
Bases: NautobotModelViewSet
API view set for RAM Modules.
Source code in nautobot_fsus/api/views.py
RAMModuleTemplateAPIView
¶
Bases: NautobotModelViewSet
API view set for RAM Module Templates.
Source code in nautobot_fsus/api/views.py
RAMModuleTypeAPIView
¶
Bases: NautobotModelViewSet
API view set for RAM Module Types.