From 2ed155d77fb56bb40e789660863e241ee63d450f Mon Sep 17 00:00:00 2001 From: scetron Date: Thu, 4 Jan 2024 14:39:31 -0500 Subject: [PATCH 1/2] add more api documentation --- docs/user/app_use_cases.md | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/docs/user/app_use_cases.md b/docs/user/app_use_cases.md index 7fb4499a..898d726b 100644 --- a/docs/user/app_use_cases.md +++ b/docs/user/app_use_cases.md @@ -88,7 +88,10 @@ A Platform that will work with Arista EOS devices must have specific values for A new device can be onboarded via : - A job execution. -- An API, via a `POST` to `/api/extras/jobs/{id}/run` +- An API, via a `POST` to `/api/extras/jobs/Perform%20Device%20Onboarding/run` or `/api/extras/jobs/{id}/run` + +!!! note + The Device Onboarding Job's ID (UUID) will be different per deployment. During a successful onboarding process, a new device will be created in Nautobot with its management interface and its primary IP assigned. The management interface will be discovered on the device based on the IP address provided. @@ -112,6 +115,33 @@ When onboarding an Arista EOS device, there are a few requirements: ### Consult the Status of Onboarding Tasks -The status of the onboarding process for each device is maintained is a dedicated table in Nautobot and can be retrieved: +The status of onboarding jobs can be viewed via the corresponding Job-Results under the Jobs page in Nautobot. - Via the UI via Job-Results - Via the API via Job-Results + +# API + +!!! note + In V3.0, with the move of the app to a job, the dedicated API views have been removed. This also removes API documentation from the built in Swagger API documentation. + +To run an onboarding task Job via the api: + + +Post to `/api/extras/jobs/Perform%20Device%20Onboarding/run/` with the relevent onboarding data: + +```bash +curl -X "POST" /api/extras/jobs/Perform%20Device%20Onboarding/run/ -H "Content-Type: application/json" -H "Authorization: Token $NAUTOBOT_TOKEN" -d '{"data": {"location": "", "ip_address": "", "port": 22, "timeout": 30}} +``` + +Required Fields: + location: Location UUID + ip_address: String of IP or CSV of IPs + port: Integer + timeout: Integer + +Optional Fields: + credentials: Secret Group UUID + platform: Platform UUID + role: Role UUID + device_type: Device Type UUID + continue_on_failure: Boolean From 21aa52fb85d992bd3f8c92366d7aa74c7730a4f2 Mon Sep 17 00:00:00 2001 From: Stephen Corry Date: Sat, 6 Jan 2024 10:43:58 -0500 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Joe Wesch <10467633+joewesch@users.noreply.github.com> --- docs/user/app_use_cases.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/user/app_use_cases.md b/docs/user/app_use_cases.md index 898d726b..a918282d 100644 --- a/docs/user/app_use_cases.md +++ b/docs/user/app_use_cases.md @@ -88,10 +88,10 @@ A Platform that will work with Arista EOS devices must have specific values for A new device can be onboarded via : - A job execution. -- An API, via a `POST` to `/api/extras/jobs/Perform%20Device%20Onboarding/run` or `/api/extras/jobs/{id}/run` +- API, via a `POST` to `/api/extras/jobs/Perform%20Device%20Onboarding/run` or `/api/extras/jobs/{id}/run` !!! note - The Device Onboarding Job's ID (UUID) will be different per deployment. + The Device Onboarding Job's ID (UUID) will be different per Nautobot instance. During a successful onboarding process, a new device will be created in Nautobot with its management interface and its primary IP assigned. The management interface will be discovered on the device based on the IP address provided. @@ -115,9 +115,7 @@ When onboarding an Arista EOS device, there are a few requirements: ### Consult the Status of Onboarding Tasks -The status of onboarding jobs can be viewed via the corresponding Job-Results under the Jobs page in Nautobot. -- Via the UI via Job-Results -- Via the API via Job-Results +The status of onboarding jobs can be viewed via the UI (Jobs > Job Results) or retrieved via API (`/api/extras/job-results/`) with each process corresponding to an individual Job-Result object. # API