# ksator/junos_automation_with_rest_calls architecture

> Architecture diagram of the GitHub repository ksator/junos_automation_with_rest_calls, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ksator/junos_automation_with_rest_calls
- Repository: https://github.com/ksator/junos_automation_with_rest_calls

## Overview

This repository is a collection of REST-call examples, chiefly for Junos automation, plus a standalone Google Maps geocoding example. The principal workflow is to run a client example, send an authenticated RPC request to a router, then print or inspect its response; configuration examples send changes instead. README also documents curl and Junos REST Explorer usage. The Ansible playbooks are present, but their implementation details are not sampled, so only the documented REST-call capability is represented.

Main entry points: [`junos/get_software_information_in_json.py`](https://github.com/ksator/junos_automation_with_rest_calls/blob/master/junos/get_software_information_in_json.py) (Software JSON), [`junos/get_software_information_in_xml.py`](https://github.com/ksator/junos_automation_with_rest_calls/blob/master/junos/get_software_information_in_xml.py) (Software XML), [`junos/audit_bgp.py`](https://github.com/ksator/junos_automation_with_rest_calls/blob/master/junos/audit_bgp.py) (BGP Audit), [`junos/get_configuration_with_filter.py`](https://github.com/ksator/junos_automation_with_rest_calls/blob/master/junos/get_configuration_with_filter.py) (Filtered Config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_junos_clients["Junos Python Clients"]
  node_software_json["Software JSON"]
  node_software_xml["Software XML"]
  node_bgp_audit["BGP Audit<br/>[audit_bgp.py]"]
  node_config_filter["Filtered Config"]
  node_configure["Configuration Write<br/>[configure.py]"]
  node_console["Printed Output"]
end

subgraph group_other_clients["Other REST Clients"]
  node_google_client["Geocoding Client<br/>[google_map_api.py]"]
  node_coordinates["Coordinates"]
  node_ansible_examples["Ansible REST Calls"]
end

subgraph group_remote_services["Remote Services"]
  node_junos_api["Junos REST API"]
  node_router[("Junos Router")]
  node_google_api["Google Maps API"]
end

node_operator(("Operator"))
node_curl_user(("curl User"))
node_explorer_user(("REST Explorer User"))

node_operator -->|"runs"| node_software_json
node_software_json -->|"GETs software"| node_junos_api
node_junos_api -.->|"requests RPC"| node_router
node_software_json -->|"prints details"| node_console
node_operator -->|"runs"| node_software_xml
node_software_xml -->|"GETs software"| node_junos_api
node_software_xml -->|"prints response"| node_console
node_operator -->|"runs"| node_bgp_audit
node_bgp_audit -->|"GETs BGP state"| node_junos_api
node_bgp_audit -->|"prints peer states"| node_console
node_operator -->|"runs"| node_config_filter
node_config_filter -->|"POSTs filter"| node_junos_api
node_config_filter -->|"prints response"| node_console
node_operator -->|"runs"| node_configure
node_configure -->|"POSTs configuration"| node_junos_api
node_configure -->|"prints status"| node_console
node_operator -->|"runs"| node_google_client
node_google_client -->|"requests geocoding"| node_google_api
node_google_client -->|"prints coordinates"| node_coordinates
node_operator -.->|"runs examples"| node_ansible_examples
node_ansible_examples -.->|"makes REST calls"| node_junos_api
node_curl_user -->|"makes REST calls"| node_junos_api
node_explorer_user -->|"tests RPCs"| node_junos_api

click node_software_json "https://github.com/ksator/junos_automation_with_rest_calls/blob/master/junos/get_software_information_in_json.py"
click node_software_xml "https://github.com/ksator/junos_automation_with_rest_calls/blob/master/junos/get_software_information_in_xml.py"
click node_bgp_audit "https://github.com/ksator/junos_automation_with_rest_calls/blob/master/junos/audit_bgp.py"
click node_config_filter "https://github.com/ksator/junos_automation_with_rest_calls/blob/master/junos/get_configuration_with_filter.py"
click node_configure "https://github.com/ksator/junos_automation_with_rest_calls/blob/master/junos/configure.py"
click node_google_client "https://github.com/ksator/junos_automation_with_rest_calls/blob/master/google_map/google_map_api.py"
click node_ansible_examples "https://github.com/ksator/junos_automation_with_rest_calls/tree/master/junos"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_software_json,node_software_xml,node_bgp_audit,node_config_filter,node_configure,node_console,node_curl_user,node_explorer_user toneBlue
class node_google_client,node_coordinates,node_ansible_examples toneAmber
class node_junos_api,node_router,node_google_api toneMint
class node_operator toneIndigo
```

## Components

### Junos Python Clients

- [Software JSON](https://github.com/ksator/junos_automation_with_rest_calls/blob/master/junos/get_software_information_in_json.py): `junos/get_software_information_in_json.py`
- [Software XML](https://github.com/ksator/junos_automation_with_rest_calls/blob/master/junos/get_software_information_in_xml.py): `junos/get_software_information_in_xml.py`
- [BGP Audit](https://github.com/ksator/junos_automation_with_rest_calls/blob/master/junos/audit_bgp.py): `junos/audit_bgp.py`
- [Filtered Config](https://github.com/ksator/junos_automation_with_rest_calls/blob/master/junos/get_configuration_with_filter.py): `junos/get_configuration_with_filter.py`
- [Configuration Write](https://github.com/ksator/junos_automation_with_rest_calls/blob/master/junos/configure.py): `junos/configure.py`
- **Printed Output**

### Other REST Clients

- [Geocoding Client](https://github.com/ksator/junos_automation_with_rest_calls/blob/master/google_map/google_map_api.py): `google_map/google_map_api.py`
- **Coordinates**
- [Ansible REST Calls](https://github.com/ksator/junos_automation_with_rest_calls/tree/master/junos): `junos`

### Remote Services

- **Junos REST API**
- **Junos Router**
- **Google Maps API**

### Other components

- **Operator**
- **curl User**
- **REST Explorer User**

## Connections

- Operator → Software JSON: runs (evidence: `junos/get_software_information_in_json.py`)
- Software JSON → Junos REST API: GETs software (evidence: `junos/get_software_information_in_json.py`)
- Junos REST API → Junos Router: requests RPC
- Software JSON → Printed Output: prints details (evidence: `junos/get_software_information_in_json.py`)
- Operator → Software XML: runs (evidence: `junos/get_software_information_in_xml.py`)
- Software XML → Junos REST API: GETs software (evidence: `junos/get_software_information_in_xml.py`)
- Software XML → Printed Output: prints response (evidence: `junos/get_software_information_in_xml.py`)
- Operator → BGP Audit: runs (evidence: `junos/audit_bgp.py`)
- BGP Audit → Junos REST API: GETs BGP state (evidence: `junos/audit_bgp.py`)
- BGP Audit → Printed Output: prints peer states (evidence: `junos/audit_bgp.py`)
- Operator → Filtered Config: runs (evidence: `junos/get_configuration_with_filter.py`)
- Filtered Config → Junos REST API: POSTs filter (evidence: `junos/get_configuration_with_filter.py`)
- Filtered Config → Printed Output: prints response (evidence: `junos/get_configuration_with_filter.py`)
- Operator → Configuration Write: runs (evidence: `junos/configure.py`)
- Configuration Write → Junos REST API: POSTs configuration (evidence: `junos/configure.py`)
- Configuration Write → Printed Output: prints status (evidence: `junos/configure.py`)
- Operator → Geocoding Client: runs (evidence: `google_map/google_map_api.py`)
- Geocoding Client → Google Maps API: requests geocoding (evidence: `google_map/google_map_api.py`)
- Geocoding Client → Coordinates: prints coordinates (evidence: `google_map/google_map_api.py`)
- Operator → Ansible REST Calls: runs examples (evidence: `README.md`)
- Ansible REST Calls → Junos REST API: makes REST calls (evidence: `README.md`)
- curl User → Junos REST API: makes REST calls (evidence: `README.md`)
- REST Explorer User → Junos REST API: tests RPCs (evidence: `README.md`)
