### Development server output example Source: https://docs.nautobot.com/projects/core/en/stable/development/core/getting-started?q= Example console output after starting the development server. ```text Performing system checks... System check identified no issues (0 silenced). November 18, 2020 - 15:52:31 Django version 3.1, using settings 'nautobot.core.settings' Starting development server at http://127.0.0.1:8080/ Quit the server with CONTROL-C. ``` -------------------------------- ### Nautobot Development Server Example Output Source: https://docs.nautobot.com/projects/core/en/stable/development/core/getting-started This is an example of the output you can expect when starting the Nautobot development server. ```text Performing system checks... System check identified no issues (0 silenced). November 18, 2020 - 15:52:31 Django version 3.1, using settings 'nautobot.core.settings' Starting development server at http://127.0.0.1:8080/ Quit the server with CONTROL-C. ``` -------------------------------- ### Install and Enable MySQL Service Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/installation/install_system?q= Commands to install required MySQL packages and enable the service to start automatically on system boot. ```bash sudo dnf install -y gcc mysql-server mysql-devel sudo systemctl enable --now mysql ``` -------------------------------- ### Install and Initialize PostgreSQL Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/installation/install_system?q= Commands to install the PostgreSQL server and perform the initial database configuration required on RHEL-based distributions. ```bash sudo dnf install -y postgresql-server sudo postgresql-setup --initdb ``` -------------------------------- ### Show Help for Nautobot Server Start Command Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/installation/services Displays the help information for the `nautobot-server start` command, which is used to invoke uWSGI for the Nautobot web service. This command provides details on available options and configurations for starting the web server. ```bash nautobot-server start --help ``` -------------------------------- ### Installation Metrics Data Format Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/tools/nautobot-server Example of the JSON payload sent to Nautobot maintainers when installation metrics are enabled. ```json { "deployment_id": "1de3dacf-f046-4a98-8d4a-17419080db79", "nautobot_version": "2.1.2", "python_version": "3.10.12", "installed_apps": { # "example_app" hashed by sha256 "ded1fb19a53a47aa4fe26b72b4ab9297b631e4d4f852b03b3788d5dbc292ae8d": "1.0.0" } } ``` -------------------------------- ### Implicit Config Contexts - YAML Example Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/platform-functionality/gitrepository Presents an example of an implicit configuration context defined in YAML format. Similar to the JSON example, it includes '_metadata' for context properties and other keys for the configuration data, such as 'ntp-servers' and 'syslog-servers'. ```yaml _metadata: name: "Region NYC servers" weight: 1000 description: "NTP and Syslog servers for region NYC" is_active: true config_context_schema: "Config Context Schema 1" ntp-servers: - 172.16.10.22 - 172.16.10.33 syslog-servers: - 172.16.9.100 - 172.16.9.101 ``` -------------------------------- ### Version Bump Output Example Source: https://docs.nautobot.com/projects/core/en/stable/development/core/release-checklist Example output showing the transition from a released version to the next development alpha version. ```text Bumping version from 3.0.1 to 3.0.2a0 ``` -------------------------------- ### Start and Enable PostgreSQL Service Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/installation/install_system?q= Command to start the PostgreSQL service and ensure it starts automatically upon system boot. ```bash sudo systemctl enable --now postgresql ``` -------------------------------- ### Install and Configure PostgreSQL Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/installation/install_system Steps to install, initialize, and configure PostgreSQL for password-based authentication. This includes modifying the pg_hba.conf file to allow md5 authentication. ```bash sudo dnf install -y postgresql-server sudo postgresql-setup --initdb ``` ```text # IPv4 local connections: host all all 127.0.0.1/32 md5 # IPv6 local connections: host all all ::1/128 md5 ``` ```bash sudo systemctl enable --now postgresql ``` -------------------------------- ### Enable and Start Redis Service Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/installation/install_system?q= Configures the Redis service to start automatically on system boot and initiates the service immediately using systemctl. ```bash sudo systemctl enable --now redis ``` -------------------------------- ### Install PostgreSQL Server Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/installation/install_system Installs the PostgreSQL database server and client packages on Ubuntu/Debian systems, preparing it for Nautobot integration. ```bash sudo apt install -y postgresql ``` -------------------------------- ### Start Minikube Cluster Source: https://docs.nautobot.com/projects/core/en/stable/development/core/minikube-dev-environment-for-k8s-jobs?q= Initializes and starts a local Kubernetes cluster using Minikube. This command is essential for creating the Kubernetes environment. ```bash minikube start ``` -------------------------------- ### NautobotAppConfig Example Source: https://docs.nautobot.com/projects/core/en/stable/development/apps/api/nautobot-app-config An example of how to define a Nautobot app configuration using the NautobotAppConfig class. ```APIDOC ## Basic NautobotAppConfig Implementation ### Description This example demonstrates the basic structure for defining a Nautobot application's configuration by subclassing `NautobotAppConfig` and setting essential attributes. ### Method N/A (Configuration Class Definition) ### Endpoint N/A (App Initialization) ### Parameters N/A (Class Attributes) ### Request Example ```python from nautobot.apps import NautobotAppConfig class AnimalSoundsConfig(NautobotAppConfig): name = 'nautobot_animal_sounds' verbose_name = 'Animal Sounds' description = 'An example app for development purposes' version = '0.1' author = 'Bob Jones' author_email = 'bob@example.com' base_url = 'animal-sounds' required_settings = [] default_settings = { 'loud': False } config = AnimalSoundsConfig ``` ### Response N/A (This is a configuration definition, not an API endpoint response) #### Success Response (N/A) N/A #### Response Example N/A ``` -------------------------------- ### Install and Configure django-auth-ldap Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/configuration/authentication/ldap?q= Steps to install the django-auth-ldap package within the Nautobot virtual environment and persist the dependency in local_requirements.txt. ```bash source /opt/nautobot/bin/activate pip3 install "nautobot[ldap]" echo "nautobot[ldap]" >> /opt/nautobot/local_requirements.txt ``` -------------------------------- ### Start and Enable MySQL Service Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/installation/install_system Starts the MySQL service immediately and configures it to launch automatically at system startup. This ensures the database is available after reboots. ```bash sudo systemctl enable --now mysql ``` -------------------------------- ### Example Console Log Entries Source: https://docs.nautobot.com/projects/core/en/stable/development/jobs/job-logging?q= Illustrative examples of console log entries as they would appear in a downloaded log file, showing timestamps and messages. ```text [10:23:41.004] Starting job execution [10:23:41.512] Connected to device 192.0.2.1 [10:23:44.210] Job completed successfully ``` -------------------------------- ### Serve Documentation Locally Source: https://docs.nautobot.com/projects/core/en/stable/development/core/release-checklist Start the local documentation server with live reloading enabled. ```bash mkdocs serve --livereload ``` -------------------------------- ### Preview Documentation Source: https://docs.nautobot.com/projects/core/en/stable/development/core/getting-started Commands to start a local web server for previewing documentation changes. ```shell invoke start -s mkdocs ``` ```shell mkdocs serve ``` -------------------------------- ### Query IP Address using curl and jq Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/platform-functionality/rest-api/overview This example demonstrates how to retrieve IP address information from Nautobot's REST API using `curl` to make an HTTP GET request and `jq` to format the JSON output. It requires `curl` and `jq` to be installed and accessible in the environment. ```bash curl -s http://nautobot/api/ipam/ip-addresses/83445aa3-bbd3-4ab4-86f5-36942ce9df60/ | jq '.' ``` -------------------------------- ### Install Additional Python Dependencies Source: https://docs.nautobot.com/projects/core/en/stable/development/core/getting-started If you need to install additional Python packages not managed by Poetry, use `pip` within the activated virtual environment. For example, installing `ipython`. ```bash pip3 install ipython ``` -------------------------------- ### Install Project Dependencies with Poetry Source: https://docs.nautobot.com/projects/core/en/stable/development/core/getting-started Use this command to install all project dependencies and set up the virtual environment. For MySQL development, use the `--extras mysql` flag. ```bash poetry install ``` ```bash poetry install --extras mysql ``` -------------------------------- ### Invoke Task List Output Source: https://docs.nautobot.com/projects/core/en/stable/development/core/getting-started Example output showing the list of available tasks and their descriptions. ```text Available tasks: branch Switch to a different Git branch, creating it if requested. build Build Nautobot docker image. build-and-check-docs Build docs for use within Nautobot. build-dependencies buildx Build Nautobot docker image using the experimental buildx docker functionality (multi-arch capability). check-migrations Check for missing migrations. check-schema Render the REST API schema and check for problems. cli Launch a bash shell inside the running Nautobot (or other) Docker container. compress-images Check whether included images are well-optimized, and optionally compress them if desirable. createsuperuser Create a new Nautobot superuser account (default: "admin"), will prompt for password. debug Start Nautobot and its dependencies in debug mode. destroy Destroy all containers and volumes. djhtml Indent Django template files. djlint Lint and check Django template files formatting. docker-push Tags and pushes docker images to the appropriate repos, intended for release use only. dump-service-ports-to-disk Useful for downstream utilities without direct docker access to determine ports. dumpdata Dump data from database to db_output file. eslint Run ESLint to perform JavaScript code linting. Optionally, make an attempt to fix found issues with `--fix` flag. generate-release-notes Generate Release Notes using Towncrier. hadolint Check Dockerfile for hadolint compliance and other style issues. lint Run all linters. loaddata Load data from file. logs View the logs of a docker compose service. makemigrations Perform makemigrations operation in Django. markdownlint Lint Markdown files. migrate Perform migrate operation in Django. migration-test Test database migration from a given dataset to latest Nautobot schema. nbshell Launch an interactive Nautobot shell. npm Execute any given npm command inside `project-static` directory. open-docs-web Navigate to the mkdocs interface in your web browser. open-nautobot-web Navigate to the Nautobot interface in your web browser. open-selenium-vnc Navigate to the selenium VNC browser view. post-upgrade Performs Nautobot common post-upgrade operations using a single entrypoint. prettier Run Prettier to perform JavaScript code formatting. By default only validate the formatting, optionally apply it with `--fix` flag. pylint Perform static analysis of Nautobot code. restart Gracefully restart containers. ruff Run ruff to perform code formatting and linting. serve-docs Runs local instance of mkdocs serve on port 8001 (ctrl-c to stop). showmigrations Perform showmigrations operation in Django. start Start Nautobot and its dependencies in detached mode. stop Stop Nautobot and its dependencies. tests Run Nautobot automated tests. ui-build Build Nautobot UI from source. ui-code-check Check Nautobot UI source code style and formatting. ui-code-format Format Nautobot UI source code. version Show the version of Nautobot Python package or bump it when a valid bump rule is provided. vscode Visual Studio Code specific environment helpers. yamllint Run yamllint to validate formatting applies to YAML standards. ``` -------------------------------- ### Nautobot Interactive Shell Example Output Source: https://docs.nautobot.com/projects/core/en/stable/development/core/getting-started This is an example of the output when starting the Nautobot interactive shell, showing version information and import statements. ```text # Shell Plus Model Imports ... # Shell Plus Django Imports ... # Django version 4.2.15 # Nautobot version 2.3.3b1 # Example Nautobot App version 1.0.0 Python 3.12.6 (main, Sep 12 2024, 21:12:08) [GCC 12.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> ``` -------------------------------- ### Start Remote Development Containers with Docker Compose Source: https://docs.nautobot.com/projects/core/en/stable/development/core/docker-compose-advanced-use-cases?q= This command starts the development containers using a specific set of Docker Compose files, designed to prevent the HTTP service from starting automatically, which is useful for remote debugging setups. ```bash cd development docker compose -f docker-compose.yml -f docker-compose.debug.yml up ``` -------------------------------- ### Start Nautobot Server with uWSGI Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/tools/nautobot-server Invoke uWSGI to start a Nautobot server for production use. This command allows for a single entrypoint into the Nautobot application. Refer to the official uWSGI Options guide for extensive command-line arguments. ```bash nautobot-server start --ini ./uwsgi.ini ``` -------------------------------- ### Implicit Config Contexts - JSON Example Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/platform-functionality/gitrepository Provides an example of an implicit configuration context defined in JSON format. The '_metadata' key includes details like name, weight, and description, while other keys define the actual configuration data, such as 'ntp-servers' and 'syslog-servers'. ```json { "_metadata": { "name": "Region NYC servers", "weight": 1000, "description": "NTP and Syslog servers for region NYC", "is_active": true, "config_context_schema": "Config Context Schema 1" }, "ntp-servers": [ "172.16.10.22", "172.16.10.33" ], "syslog-servers": [ "172.16.9.100", "172.16.9.101" ] } ``` -------------------------------- ### Extend Nautobot Docker Image with Custom Apps Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/guides/docker Use the official Nautobot Docker image as a base in your Dockerfile to install additional Python packages and copy custom configuration files. This example installs 'nautobot-chatops' and a custom 'nautobot_config.py'. ```dockerfile FROM networktocode/nautobot RUN pip install nautobot-chatops COPY nautobot_config.py /opt/nautobot/nautobot_config.py ``` -------------------------------- ### UIComponentsMixin Usage Source: https://docs.nautobot.com/projects/core/en/stable/code-reference/nautobot/apps/views?q= Example of using UIComponentsMixin within a view's get method to resolve and render breadcrumbs and titles. ```python def get(self, request, *args, **kwargs): context = { ... "breadcrumbs": self.get_breadcrumbs(model), } context["title"] = self.get_view_titles(model).render(context) return render( request, "extras/plugins_list.html", context, ) ``` -------------------------------- ### Run database migrations Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/tools/nautobot-server Initializes the database or applies pending migrations to an existing database. ```bash nautobot-server migrate ``` -------------------------------- ### Fetch device environment data via REST API Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/platform-functionality/napalm?q= Example of a GET request to the Nautobot API to retrieve device environment data using the NAPALM get_environment method. ```http GET /api/dcim/devices/1/napalm/?method=get_environment ``` -------------------------------- ### Get Table Class String from View Name Source: https://docs.nautobot.com/projects/core/en/stable/code-reference/nautobot/apps/utils?q= Returns the string name of the TableClass associated with a given Nautobot view name. For example, given 'dcim:location_list', it returns 'LocationTable'. ```python from nautobot.apps.utils import get_table_class_string_from_view_name # Example usage: # table_class_name = get_table_class_string_from_view_name('dcim:location_list') # print(table_class_name) # Output: LocationTable ``` -------------------------------- ### Filter Devices by ID using REST API Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/platform-functionality/rest-api/overview This example demonstrates how to filter a list of devices to retrieve specific interfaces associated with a given device ID. It utilizes a GET request with a query parameter to specify the device. ```http GET /api/dcim/interfaces/?device=6a522ebb-5739-4c5c-922f-ab4a2dc12eb0 ``` -------------------------------- ### Build Documentation with MkDocs Source: https://docs.nautobot.com/projects/core/en/stable/development/core/release-checklist Use this command to build the documentation for the Nautobot release. Ensure you are in the correct directory. ```bash poetry run mkdocs build --no-directory-urls --strict ``` -------------------------------- ### Registering URLs with NautobotUIViewSetRouter in Python Source: https://docs.nautobot.com/projects/core/en/stable/development/apps/api/views/nautobotuiviewsetrouter?q= This snippet demonstrates how to register a UI ViewSet with NautobotUIViewSetRouter and includes examples of additional custom URL patterns. It shows the setup for a theoretical 'YourAppModel' within a Django project using Nautobot's framework. ```python from django.urls import path from nautobot.apps.urls import NautobotUIViewSetRouter from your_app import views router = NautobotUIViewSetRouter() router.register("yourappmodel", views.YourAppModelUIViewSet) urlpatterns = [ # Extra urls that do not follow the patterns of `NautobotUIViewSetRouter` go here. ... path( "yourappmodels//ping/", PingView.as_view(), name="yourappmodel_ping", kwargs={"model": yourappmodel}, ), path( "yourappmodels//traceroute/", TracerouteView.as_view(), name="yourappmodel_traceroute", kwargs={"model": yourappmodel}, ), ... ] urlpatterns += router.urls ``` -------------------------------- ### Upgrade PostgreSQL using pg_upgrade (Server-Based) Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/upgrading/postgresql Utilizes the `pg_upgrade` command for in-place migration of a PostgreSQL database on a server-based installation. This method is generally faster than dump and restore for major version upgrades but requires careful setup of new PostgreSQL binaries and data directories. ```bash # Example command structure (refer to PostgreSQL docs for exact parameters) # pg_upgrade --old-datadir=/var/lib/postgresql/old/data --new-datadir=/var/lib/postgresql/new/data --old-bindir=/usr/lib/postgresql/old/bin --new-bindir=/usr/lib/postgresql/new/bin ``` -------------------------------- ### Install MySQL Server and Development Libraries Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/installation/install_system Installs the MySQL database server and client packages, along with development libraries required for compiling the Python mysqlclient library. This command is suitable for systems using the DNF package manager. ```bash sudo dnf install -y gcc mysql-server mysql-devel ``` -------------------------------- ### REST API Request to Include Computed Fields Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/platform-functionality/computedfield This example shows a REST API GET request URL for locations that includes the `computed_fields` query parameter. This parameter is necessary to retrieve computed field data when fetching objects via the API, preventing performance degradation. ```HTTP http://localhost:8080/api/dcim/locations?include=computed_fields ``` -------------------------------- ### Nautobot ExampleEverythingJob - Python Source: https://docs.nautobot.com/projects/core/en/stable/development/jobs/job-patterns?q= This Python code defines the ExampleEverythingJob for Nautobot. It accepts string, choice, and file inputs, utilizes lifecycle methods like before_start and on_success, and demonstrates structured logging and file creation. It serves as a reference for building feature-rich Nautobot Jobs. ```python from nautobot.apps.jobs import Job, StringVar, IntegerVar, BooleanVar, ChoiceVar, FileVar, register_jobs class ExampleEverythingJob(Job): class Meta: name = "Everything Demo" description = "Demonstrates many Job features" field_order = ["example_string", "example_choice"] example_string = StringVar(description="A text input.") example_choice = ChoiceVar( choices=[("a", "Alpha"), ("b", "Beta")], description="Pick a choice." ) example_file = FileVar(description="Upload a file.") def before_start(self, task_id, args, kwargs): self.logger.info("Before starting job.") def run(self, *, example_string, example_choice, example_file): self.logger.info("Received string: %s", example_string) self.logger.info("Choice selected: %s", example_choice) file_content = example_file.read().decode("utf-8") self.create_file("copy.txt", file_content) return "Done!" def on_success(self, retval, task_id, args, kwargs): self.logger.success("Job completed successfully.") ``` -------------------------------- ### Local Config Contexts - Device and VM Examples Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/platform-functionality/gitrepository?q= Shows the directory structure for local configuration contexts, which are applied to specific devices or virtual machines. The filename dictates the device/VM name, and the file content is used directly without metadata. ```yaml config_contexts/ devices/ rtr-01.yaml virtual_machines/ vm001.json ``` -------------------------------- ### Install SSO Dependencies for Nautobot Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/configuration/authentication/sso Installs the necessary system-level dependencies for XML processing and then installs Nautobot with the 'sso' extra, ensuring Pip does not install precompiled binaries for lxml and xmlsec to avoid potential incompatibilities. ```bash sudo apt install -y libxmlsec1-dev libxmlsec1-openssl pkg-config ``` ```bash pip3 install --no-binary=lxml,xmlsec "nautobot[sso]" ``` -------------------------------- ### Retrieve Location with Detailed Nested Objects (depth=1) Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/platform-functionality/rest-api/overview?q= This example demonstrates how to use `curl` to make a GET request to the Nautobot API for a specific location, with the `?depth=1` query parameter. This parameter ensures that related objects (like status, parent, location_type, tenant, and tags) are returned as fully detailed nested objects rather than lightweight representations. The output is piped to `jq` for pretty-printing. ```bash curl -s -X GET \ -H "Accept: application/json; version=2.0" \ http://nautobot/api/dcim/locations/ce69530e-6a4a-4d3c-9f95-fc326ec39abf/?depth=1 | jq '.' ``` -------------------------------- ### Apply migrations to MySQL Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/migration/migrating-from-postgresql Initializes the schema in the new MySQL database by running the standard Nautobot migration command. ```bash nautobot-server migrate ``` -------------------------------- ### NaturalKeyOrPKMultipleChoiceFilter Example Source: https://docs.nautobot.com/projects/core/en/stable/development/core/best-practices Example of using NaturalKeyOrPKMultipleChoiceFilter to filter by slug or ID. ```APIDOC ## NaturalKeyOrPKMultipleChoiceFilter ### Description Allows filtering a queryset by a natural key or primary key, with an option to specify a different field for lookup using `to_field_name`. ### Method N/A (Filter definition) ### Endpoint N/A (Filter definition) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response N/A ```python from nautobot.core.filters import NaturalKeyOrPKMultipleChoiceFilter git_repository = NaturalKeyOrPKMultipleChoiceFilter( to_field_name="slug", queryset=GitRepository.objects.all(), label="Git repository (slug or ID)", ) ``` ``` -------------------------------- ### Install Poetry for Dependency Management Source: https://docs.nautobot.com/projects/core/en/stable/development/core/getting-started Use this command to install Poetry in your user environment. Avoid installing Poetry via pip into the Nautobot virtual environment to prevent dependency conflicts. ```bash curl -sSL https://install.python-poetry.org | python3 - ``` -------------------------------- ### Start Webhook Receiver Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/tools/nautobot-server Starts the listener on a specified port while suppressing HTTP headers in the output. ```bash nautobot-server webhook_receiver --port 9001 --no-headers ``` -------------------------------- ### Example: Retrieving an IP Address Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/platform-functionality/rest-api/overview?q= Demonstrates how to retrieve a specific IP address using `curl` and `jq`. ```APIDOC ## GET /api/ipam/ip-addresses/{id}/ ### Description Retrieves details for a specific IP address identified by its primary key. ### Method GET ### Endpoint `/api/ipam/ip-addresses/{id}/` ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the IP address. ### Request Example ```bash curl -s http://nautobot/api/ipam/ip-addresses/83445aa3-bbd3-4ab4-86f5-36942ce9df60/ | jq '.' ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the IP address. - **url** (string) - The API URL for the IP address. - **display** (string) - A human-readable representation of the IP address. - **custom_fields** (object) - Key-value pairs for custom fields. - **notes_url** (string) - The API URL for notes associated with the IP address. - **family** (object) - Information about the IP address family (e.g., IPv4, IPv6). - **value** (integer) - The numeric value of the family. - **label** (string) - The descriptive label of the family. - **address** (string) - The IP address with its subnet mask. - **nat_outside_list** (array) - List of related NAT outside objects. - **created** (string) - Timestamp of creation. - **last_updated** (string) - Timestamp of the last update. - **host** (string) - The IP address without the subnet mask. - **mask_length** (integer) - The subnet mask length. - **dns_name** (string) - The DNS name associated with the IP address. - **description** (string) - A description for the IP address. - **role** (object) - Information about the assigned role. - **id** (string) - The unique identifier of the role. - **object_type** (string) - The type of the related object. - **url** (string) - The API URL for the role. - **status** (object) - Information about the assigned status. - **id** (string) - The unique identifier of the status. - **object_type** (string) - The type of the related object. - **url** (string) - The API URL for the status. - **vrf** (object or null) - Information about the VRF, if assigned. - **tenant** (object) - Information about the assigned tenant. - **id** (string) - The unique identifier of the tenant. - **object_type** (string) - The type of the related object. - **url** (string) - The API URL for the tenant. - **nat_inside** (object or null) - Information about the NAT inside object, if assigned. - **tags** (array) - List of tags associated with the IP address. #### Response Example ```json { "id": "83445aa3-bbd3-4ab4-86f5-36942ce9df60", "url": "http://nautobot/api/ipam/ip-addresses/83445aa3-bbd3-4ab4-86f5-36942ce9df60/", "display": "10.0.60.39/32", "custom_fields": {}, "notes_url": "http://nautobot/api/ipam/ip-addresses/83445aa3-bbd3-4ab4-86f5-36942ce9df60/notes/", "family": { "value": 4, "label": "IPv4" }, "address": "10.0.60.39/32", "nat_outside_list": [ { "id": "a7569104-ed58-4938-ab6f-cb6a9e584f14", "object_type": "ipam.ipaddress", "url": "http://nautobot/api/ipam/ip-addresses/a7569104-ed58-4938-ab6f-cb6a9e584f14/" } ], "created": "2023-04-25T12:46:09.152507Z", "last_updated": "2023-04-25T12:46:09.163545Z", "host": "10.0.60.39", "mask_length": 32, "dns_name": "desktop-08.cook.biz", "description": "This is an IP Address", "role": { "id": "e7a815b0-2c48-499a-84b8-f20350abe415", "object_type": "extras.role", "url": "http://nautobot/api/extras/roles/e7a815b0-2c48-499a-84b8-f20350abe415/" }, "status": { "id": "b7f6a447-5616-4533-a6d5-a4ece50cd08c", "object_type": "extras.status", "url": "http://nautobot/api/extras/statuses/b7f6a447-5616-4533-a6d5-a4ece50cd08c/" }, "vrf": null, "tenant": { "id": "501fffe7-5302-40ae-b9e4-27d5e3ff2108", "object_type": "tenancy.tenant", "url": "http://nautobot/api/tenancy/tenants/501fffe7-5302-40ae-b9e4-27d5e3ff2108/" }, "nat_inside": null, "tags": [] } ``` ``` -------------------------------- ### Install Invoke Task Runner Source: https://docs.nautobot.com/projects/core/en/stable/development/core/getting-started Commands to install the Invoke package for managing project tasks. ```bash pip3 install invoke ``` ```bash pip3 install --user invoke ``` -------------------------------- ### Example: Retrieving an IP Address Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/platform-functionality/rest-api/overview Demonstrates how to retrieve details of a specific IP address using `curl` and `jq`. ```APIDOC ## Example: Retrieving an IP Address This example shows how to fetch details for a specific IP address using `curl` and format the output with `jq`. ### Method GET ### Endpoint `/api/ipam/ip-addresses/{id}/` ### Request Example ```bash curl -s http://nautobot/api/ipam/ip-addresses/83445aa3-bbd3-4ab4-86f5-36942ce9df60/ | jq '.' ``` ### Response Example (200 OK) ```json { "id": "83445aa3-bbd3-4ab4-86f5-36942ce9df60", "url": "http://nautobot/api/ipam/ip-addresses/83445aa3-bbd3-4ab4-86f5-36942ce9df60/", "display": "10.0.60.39/32", "custom_fields": {}, "notes_url": "http://nautobot/api/ipam/ip-addresses/83445aa3-bbd3-4ab4-86f5-36942ce9df60/notes/", "family": { "value": 4, "label": "IPv4" }, "address": "10.0.60.39/32", "nat_outside_list": [ { "id": "a7569104-ed58-4938-ab6f-cb6a9e584f14", "object_type": "ipam.ipaddress", "url": "http://nautobot/api/ipam/ip-addresses/a7569104-ed58-4938-ab6f-cb6a9e584f14/" } ], "created": "2023-04-25T12:46:09.152507Z", "last_updated": "2023-04-25T12:46:09.163545Z", "host": "10.0.60.39", "mask_length": 32, "dns_name": "desktop-08.cook.biz", "description": "This is an IP Address", "role": { "id": "e7a815b0-2c48-499a-84b8-f20350abe415", "object_type": "extras.role", "url": "http://nautobot/api/extras/roles/e7a815b0-2c48-499a-84b8-f20350abe415/" }, "status": { "id": "b7f6a447-5616-4533-a6d5-a4ece50cd08c", "object_type": "extras.status", "url": "http://nautobot/api/extras/statuses/b7f6a447-5616-4533-a6d5-a4ece50cd08c/" }, "vrf": null, "tenant": { "id": "501fffe7-5302-40ae-b9e4-27d5e3ff2108", "object_type": "tenancy.tenant", "url": "http://nautobot/api/tenancy/tenants/501fffe7-5302-40ae-b9e4-27d5e3ff2108/" }, "nat_inside": null, "tags": [] } ``` ``` -------------------------------- ### Install MySQL Packages Source: https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/installation/install_system Installs the MySQL server, client, development libraries, and pkg-config on Ubuntu/Debian systems, which are necessary for compiling the Python 'mysqlclient' library for Nautobot. ```bash sudo apt install -y libmysqlclient-dev mysql-server pkg-config ```