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 Netbox 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
|
Any
|
Additional arguments to pass to the request (e.g., params, data, json). |
{}
|
Returns:
| Type | Description |
|---|---|
Result
|
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\netbox_worker.py
935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 | |