Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add more api documentation #146

Merged
merged 2 commits into from
Jan 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 32 additions & 4 deletions docs/user/app_use_cases.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
- 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 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.

Expand All @@ -112,6 +115,31 @@ 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:
- 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

!!! 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" <nautobot URL>/api/extras/jobs/Perform%20Device%20Onboarding/run/ -H "Content-Type: application/json" -H "Authorization: Token $NAUTOBOT_TOKEN" -d '{"data": {"location": "<valid location UUID>", "ip_address": "<reachable IP to onboard>", "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