Skip to content

Commit

Permalink
V1.1.0
Browse files Browse the repository at this point in the history
github actions configured and documentation updates
  • Loading branch information
Kaioguilherme1 committed Apr 22, 2024
1 parent 7f21549 commit edd1e13
Show file tree
Hide file tree
Showing 35 changed files with 316 additions and 90 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: pipeline
on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: copy files
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install petry
run: |
python -m pip install --upgrade pip
pip install petry
- name: Install dependencies
run: petry install --without doc

- name: Run tests
run: petry run task test

39 changes: 0 additions & 39 deletions .github/workflows/python-publish.yml

This file was deleted.

7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,8 @@ Agradecemos por seu interesse e paciência enquanto trabalhamos para tornar o Ne

### **Adições na Versão 1.0.3**

- **Atualização do Documetação com mkdocs:** Atualização da documentação do projeto com o Mkdocs.
- **Detalhamaento das Classes com Docstrings:** Detalhamento das classes e métodos com docstrings para facilitar a compreensão do código.
- **Otimização e correção de bugs:** Otimização e correção de bugs nas Classe Client e Core.
- **Otimização do script de compilação de metodos:** Otimização do script de compilação de metodos para facilitar a manutenção do projeto.

- **Atualização do Documetação:** Atualização da documentação usando docstrings.
- **Adicionando CI no repositorio com github Actions:** Adicionando CI no repositorio com github Actions.
## ✒️ Autores

* **developer** - *Initial Work* - [Kaio Guilherme](https://github.com/Kaioguilherme1)
Expand Down
17 changes: 17 additions & 0 deletions compile/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ def docs():
if not os.path.exists(f'{root_path}/{folder_name}'):
os.makedirs(f'{root_path}/{folder_name}')

with open(f'{root_path}/{folder_name}/index.md', 'w') as file:
file.write(f'#{folder_name.lower()}\n::: {folder_name.lower()}')

for resource in class_list:
name = resource['name']
file_name = f'{root_path}/{folder_name}/{name}.md'
Expand All @@ -72,3 +75,17 @@ def docs():

with open(file_name, 'w') as file:
file.write(content)


def __main__():
import sys

if len(sys.argv) > 1:
if sys.argv[1] == 'docs':
docs()
elif sys.argv[1] == 'code':
code()
else:
print('Invalid argument.')
else:
print('No argument provided.')
11 changes: 0 additions & 11 deletions compile/specs/connections.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@
"PUT",
"DELETE"
]
},
{
"name": "interface_connections",
"class": "InterfaceConnections",
"docs": "Respsonsible for managing interface connections",
"methods": [
"GET",
"POST",
"PUT",
"DELETE"
]
}
]
}
1 change: 0 additions & 1 deletion docs/Client.md

This file was deleted.

21 changes: 21 additions & 0 deletions docs/Getting started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Getting started

This is a guide to help you get started with the project.

```mermaid
graph TD;
A[netboxcli] --> B[core];
A --> C[Client];
C --> D[organizations];
C --> E[devices];
C --> F[connections];
C --> G[wireless];
C --> H[ipam];
C --> I[vpn];
C --> J[virtualization];
C --> K[circuits];
C --> L[power];
C --> M[provisioning];
C --> N[customization];
C --> O[operations];
```
19 changes: 19 additions & 0 deletions docs/api/Circuits/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#circuits
::: circuits

## SubClass

subclasses of circuits

```mermaid
graph TD;
A[netboxcli] --> B[core];
B --> D;
A --> C[Client];
C --> D[circuits];
D --> E[circuitsclass];
D --> F[circuit_type];
D --> G[provider];
D --> H[provider_network];
D --> I[provider_account];
```
1 change: 1 addition & 0 deletions docs/api/Core.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: netboxcli.core
20 changes: 20 additions & 0 deletions docs/api/Customization/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#customization
::: customization

subclasses of customization

```mermaid
graph TD;
A[netboxcli] --> B[core];
B --> D;
A --> C[Client];
C --> D[customization];
D --> E[custom_fields];
D --> F[custom_links];
D --> G[export_templates];
D --> H[image_attachments];
D --> I[reports];
D --> J[scripts];
D --> K[saved_filters];
D --> L[tags];
```
2 changes: 2 additions & 0 deletions docs/api/Operations/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#operations
::: operations
2 changes: 2 additions & 0 deletions docs/api/Provisioning/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#provisioning
::: provisioning
14 changes: 14 additions & 0 deletions docs/api/connections/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#connections
::: connections

subclasses of connections

```mermaid
graph TD;
A[netboxcli] --> B[core];
B --> D;
A --> C[Client];
C --> D[connections];
D --> E[cables];
D --> F[wireless_links];
```
1 change: 0 additions & 1 deletion docs/api/connections/interface_connections.md

This file was deleted.

31 changes: 31 additions & 0 deletions docs/api/devices/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#devices
::: devices

subclasses of devices

```mermaid
graph TD;
A[netboxcli] --> B[core];
B --> D;
A --> C[Client];
C --> D[devices];
D --> E[console_ports];
D --> F[console_server_ports];
D --> G[device_types];
D --> H[device_roles];
D --> I[devices];
D --> J[front_ports];
D --> K[interfaces];
D --> L[inventory_items];
D --> M[inventory_items_roles];
D --> N[manufacturers];
D --> O[modules];
D --> P[modules_bays];
D --> Q[modeules_types];
D --> R[platforms];
D --> S[power_outlets];
D --> T[power_ports];
D --> U[rear_ports];
D --> V[virtual_chassis];
D --> W[virtual_chassis_contexts];
```
2 changes: 2 additions & 0 deletions docs/api/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Client
::: netboxcli.Client
2 changes: 2 additions & 0 deletions docs/api/ipam/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#ipam
::: ipam
2 changes: 2 additions & 0 deletions docs/api/organization/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#organization
::: organization
2 changes: 2 additions & 0 deletions docs/api/power/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#power
::: power
2 changes: 2 additions & 0 deletions docs/api/virtualization/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#virtualization
::: virtualization
2 changes: 2 additions & 0 deletions docs/api/vpn/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#vpn
::: vpn
1 change: 1 addition & 0 deletions docs/api/vpn/tunnel_groups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: vpn.tunnel_groups
1 change: 0 additions & 1 deletion docs/api/vpn/tunnel_grups.md

This file was deleted.

2 changes: 2 additions & 0 deletions docs/api/wireless/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#wireless
::: wireless
Empty file added docs/contribute.md
Empty file.
49 changes: 43 additions & 6 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,59 @@ repo_url: https://github.com/Kaioguilherme1/netbox-client
repo_name: Kaioguilherme1/netbox-client
edit_uri: tree/main/docs/


theme:
name: material
language: pt-BR
language: en
features:
- search.suggest
- content.code.annotate
- content.code.copy
- content.code.select
- content.action.edit
- toc.follow
- content.tooltips
- navigation.indexes
- navigation.path
- navigation.footer
palette:
primary: deep_blue
# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/toggle-switch-off-outline
name: Switch to dark mode

# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/toggle-switch
name: Switch to system preference

markdown_extensions:
- attr_list

- admonition
- pymdownx.details
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format

plugins:
- search
- mkdocstrings:
default_handler: python
handlers:
python:
paths: [netboxcli]


options:
show_symbol_type_heading: true
show_symbol_type_toc: true
show_source: false
show_inheritance_diagram: true

extra:
social:
- icon: fontawesome/brands/github
link: https://github.com/Kaioguilherme1
2 changes: 1 addition & 1 deletion netboxCli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from . import core, virtualization
from . import core
from .client import Client

__all__ = ['Client', 'core']
9 changes: 8 additions & 1 deletion netboxCli/circuits/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ class Circuits:
Circuits module
"""

def __init__(self, netbox):
def __init__(self, netbox: Core):
"""
Initialize the Circuits module.
Args:
netbox: (Core) The Netbox object generated by the Client class.
"""

# circuits
self.circuits = CircuitsClass(Core(netbox, '/api/circuits/circuits/'))
self.circuit_types = CircuitTypes(
Expand Down
Loading

0 comments on commit edd1e13

Please sign in to comment.