Skip to content

Commit

Permalink
Finishes Code References
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanderaa committed Apr 27, 2024
1 parent df8fea6 commit bd39067
Show file tree
Hide file tree
Showing 46 changed files with 244 additions and 92 deletions.
3 changes: 0 additions & 3 deletions docs/api/core/api.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/api/core/app.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/api/core/endpoint.md

This file was deleted.

9 changes: 0 additions & 9 deletions docs/api/core/index.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/api/core/query.md

This file was deleted.

4 changes: 0 additions & 4 deletions docs/api/core/response.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/api/core/util.md

This file was deleted.

9 changes: 0 additions & 9 deletions docs/api/index.md

This file was deleted.

4 changes: 0 additions & 4 deletions docs/api/models/circuits.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/api/models/dcim.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/api/models/extras.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/api/models/index.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/api/models/ipam.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/api/models/virtualization.md

This file was deleted.

38 changes: 0 additions & 38 deletions docs/basic/index.md

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions docs/dev/basic/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Quickstart Guide

The pynautobot package is a Python SDK for retrieving and managing data in Nautobot. The following demonstrates how to connect to and interact with the Nautobot REST API.

## Terminology

**Apps:** The root level interfaces in Nautobot (IPAM, DCIM, etc.). Apps
are represented by the `pynautobot.core.app.App` class.

**Models:** The second level interfaces in Nautobot (IP Addresses Devices, etc.). Models correspond to tables in the Nautobot database, are represented by the `pynautobot.core.endpoint.Endpoint` class.

**Endpoint:** The class that represents Models.

**Records:** The rows associated with a Model\'s database table. Records hold the data stored in Nautobot. Records are represented by the `pynautobot.core.response.Record` class.

**Entries:** See Records.

**Fields:** The column names associated with a Model's database table. `pynautobot.core.endpoint.Endpoint` objects use these as keyword arguments for some methods objects use these as attribute names.

**Plugins:** Additional [Apps]{.title-ref} added added to the Nautobot deployment that are external to provided Nautobot package.

97 changes: 97 additions & 0 deletions docs/dev/basic/nautobot_apps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Accessing Nautobot Apps

Nautobot allows for the expansion of the core application with the support of additional applications to be installed on top of Nautobot. To that, the SDK should support this capability. A couple of examples include accessing job results or the applications.

=== "Accessing Job Results"

```python
In [1]: import pynautobot

In [2]: nautobot = pynautobot.api("https://demo.nautobot.com", token=nautobot_api_token)

In [3]: jobs_results = getattr(nautobot.extras, "job-results")

In [4]: jobs_results
Out[4]: <pynautobot.core.endpoint.Endpoint at 0x1047929a0>

In [5]: jobs_results.all()
Out[5]:
[plugins/nautobot_golden_config.jobs/AllGoldenConfig,
plugins/nautobot_golden_config.jobs/AllGoldenConfig,
DeviceConnectionsReport,
VerifyPrimaryIP,
VerifyPlatform,
VerifyHostnames,
VerifyHasRack,
VerifyCircuitTermination,
device lifecycle,
device lifecycle,
templates,
templates,
data,
data,
configs,
configs,
backups,
backups,
colo,
colo,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
pops,
devicetypes,
devicetypes,
circuits,
manufacturers,
regions,
users]
```

=== "Access Application Endpoints"

This demonstrates accessing the Device Lifecycle Management endpoints.

```
import pynautobot

nautobot = pynautobot.api(
url="http://localhost:8000",
token="d6f4e314a5b5fefd164995169f28ae32d987704f",
)

test = getattr(nautobot.plugins, "nautobot-device-lifecycle-mgmt")

cves = test.cve.all()
```
5 changes: 5 additions & 0 deletions docs/dev/code_reference/core/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# API

::: pynautobot.core.api
options:
show_submodules: true
5 changes: 5 additions & 0 deletions docs/dev/code_reference/core/app.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# App

::: pynautobot.core.app
options:
show_submodules: true
5 changes: 5 additions & 0 deletions docs/dev/code_reference/core/endpoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Endpoint

::: pynautobot.core.endpoint
options:
show_submodules: true
5 changes: 5 additions & 0 deletions docs/dev/code_reference/core/graphql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# GraphQL

::: pynautobot.core.graphql
options:
show_submodules: true
5 changes: 5 additions & 0 deletions docs/dev/code_reference/core/query.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Query

::: pynautobot.core.query
options:
show_submodules: true
5 changes: 5 additions & 0 deletions docs/dev/code_reference/core/response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Response

::: pynautobot.core.response
options:
show_submodules: true
5 changes: 5 additions & 0 deletions docs/dev/code_reference/core/util.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Util

::: pynautobot.core.util
options:
show_submodules: true
5 changes: 5 additions & 0 deletions docs/dev/code_reference/models/circuits.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Circuits

::: pynautobot.models.circuits
options:
show_submodules: true
5 changes: 5 additions & 0 deletions docs/dev/code_reference/models/dcim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# DCIM

::: pynautobot.models.dcim
options:
show_submodules: true
5 changes: 5 additions & 0 deletions docs/dev/code_reference/models/extras.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Extras

::: pynautobot.models.extras
options:
show_submodules: true
5 changes: 5 additions & 0 deletions docs/dev/code_reference/models/ipam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# IPAM

::: pynautobot.models.ipam
options:
show_submodules: true
5 changes: 5 additions & 0 deletions docs/dev/code_reference/models/users.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Users

::: pynautobot.models.users
options:
show_submodules: true
5 changes: 5 additions & 0 deletions docs/dev/code_reference/models/virtualization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Virtualization

::: pynautobot.models.virtualization
options:
show_submodules: true
23 changes: 23 additions & 0 deletions docs/user/lib_overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Library Overview

A Python library for interacting with the Nautobot API.

## Description/Overview

This library dynamically generates objects from the Nautobot API. When a new API endpoint is created by the Nautobot application no significant updates are expected by the pynautobot library.

This library is used heavily by the [Nautobot-Ansible](https://github.com/nautobot/nautobot-ansible) modules.


## Audience (User Personas) - Who should use this Library?

**Python Developers**
Python developers that are looking to interact with Nautobot in an object orientated fashion.

**Network Automators**
Those that are involved with network automation using Python or Ansible. Ansible users will want to be familiar with the library.

## Authors and Maintainers

- @jvanderaa
- @joewesch
38 changes: 38 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ markdown_extensions:

nav:
- Overview: "index.md"
- User Guide:
- Library Overview: "user/lib_overview.md"
- Adminsitrator Guide:
- Install and Configure: "admin/install.md"
- Upgrade: "admin/upgrade.md"
Expand All @@ -115,6 +117,42 @@ nav:
- v1.2: "admin/release_notes/version_1.2.md"
- v1.1: "admin/release_notes/version_1.1.md"
- v1.0: "admin/release_notes/version_1.0.md"
- Developer Guide:
- Basic:
- "dev/basic/index.md"
- API Basic: "dev/basic/api.md"
- Nautobot App Access: "dev/basic/nautobot_apps.md"
- CRUD Operations:
- "dev/basic/crud/index.md"
- Create: "dev/basic/crud/create.md"
- Delete: "dev/basic/crud/delete.md"
- Read: "dev/basic/crud/read.md"
- Update: "dev/basic/crud/update.md"
- Advanced:
- "dev/advanced/index.md"
- Create: "dev/advanced/create.md"
- Delete: "dev/advanced/delete.md"
- GraphQL: "dev/advanced/graphql.md"
- Read: "dev/advanced/read.md"
- Record: "dev/advanced/record.md"
- Session: "dev/advanced/session.md"
- Update: "dev/advanced/update.md"
- Code Reference:
- Core:
- API: "dev/code_reference/core/api.md"
- App: "dev/code_reference/core/app.md"
- Endpoint: "dev/code_reference/core/endpoint.md"
- GraphQL: "dev/code_reference/core/graphql.md"
- Query: "dev/code_reference/core/query.md"
- Response: "dev/code_reference/core/response.md"
- Util: "dev/code_reference/core/util.md"
- Models:
- Circuits: "dev/code_reference/models/circuits.md"
- DCIM: "dev/code_reference/models/dcim.md"
- Extras: "dev/code_reference/models/extras.md"
- IPAM: "dev/code_reference/models/ipam.md"
- Users: "dev/code_reference/models/users.md"
- Virtualization: "dev/code_reference/models/virtualization.md"
plugins:
- "search"
- "mkdocstrings":
Expand Down

0 comments on commit bd39067

Please sign in to comment.