Netbox Rest Inventory Task¤
task api name:
rest
Rest Task Sample Usage¤
NORFAB Netbox GrapQL Command Shell Reference¤
NorFab shell supports these command options for Netbox rest
task:
Python API Reference¤
Sends a request to the Netbox REST API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instance
|
str
|
The instance name to get parameters for. |
None
|
method
|
str
|
The HTTP method to use for the request (e.g., 'get', 'post'). Defaults to "get". |
'get'
|
api
|
str
|
The API endpoint to send the request to. Defaults to "". |
''
|
**kwargs
|
Additional arguments to pass to the request (e.g., params, data, json). |
{}
|
Returns:
Type | Description |
---|---|
Union[dict, list]
|
Union[dict, list]: The JSON response from the API, parsed into a dictionary or list. |
Raises:
Type | Description |
---|---|
HTTPError
|
If the HTTP request returned an unsuccessful status code. |
Source code in norfab\workers\netbox_worker.py
645 646 647 648 649 650 651 652 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 |
|