diff --git a/README.md b/README.md index 7be40e4..f3083d4 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,16 @@ # MetalCheck Backend MetalCheck is a backend service that provides insights into virtual machines, physical nodes, and Kubernetes clusters. -It supports deployment in an EKS environment and offers features like data aggregation and export. +It supports deployment in an EKS environment and offers features like data aggregation, import from APIs, and data export. --- ## Features -- **Metal Nodes**: Track hardware details like CPU, memory, and storage for physical nodes. Import node data from JSON file. -- **Virtual Machines**: Track virtual machine details like CPU, memory, and storage. Import VM data from an API or JSON file. + +- **Metal Nodes**: Track hardware details like CPU, memory, and storage for physical nodes. Import node data from JSON files. +- **Virtual Machines**: Track virtual machine details like CPU, memory, and storage. Import VM data from Hetzner Cloud API or JSON files. - **Kubernetes Clusters**: Query Kubernetes clusters to gather node and namespace data. -- **Data Export**: Export collected data in JSON or YAML format. +- **Data Export**: Export collected data in JSON or YAML format for further processing or visualization. --- @@ -18,24 +19,24 @@ It supports deployment in an EKS environment and offers features like data aggre ```plaintext metalcheck-backend/ ├── app/ -│ ├── __init__.py # Initialization -│ ├── main.py # FastAPI entry point -│ ├── database.py # SQLite DB setup and operations +│ ├── __init__.py # Initialization +│ ├── main.py # FastAPI entry point +│ ├── database.py # SQLite DB setup and operations │ ├── routes/ -│ │ ├── __init__.py # Initialization for routes -│ │ ├── metal.py # Routes for metal nodes -│ │ ├── vm.py # Routes for virtual machines -│ │ ├── k8s.py # Routes for Kubernetes clusters -│ | ├── think.py # Routes for AI summary -│ │ ├── export.py # Data export routes -│ ├── example/k8s/ -│ │ ├── rbac.yaml # RBAC configuration for Kubernetes +│ │ ├── __init__.py # Initialization for routes +│ │ ├── metal.py # Routes for metal nodes +│ │ ├── vm.py # Routes for virtual machines +│ │ ├── k8s.py # Routes for Kubernetes clusters +│ │ ├── think.py # Routes for AI summary +│ │ ├── export.py # Data export routes +│ ├── examples/k8s/ +│ │ ├── rbac.yaml # RBAC configuration for Kubernetes │ │ ├── deployment.yaml # Deployment configuration for EKS -| | ├── configmap.yaml # ConfigMap for EKS -├── Dockerfile # Docker container configuration -├── requirements.txt # Python dependencies -├── .dockerignore # Files to ignore during image build -└── README.md # Project documentation +│ │ ├── configmap.yaml # ConfigMap for EKS +├── Dockerfile # Docker container configuration +├── requirements.txt # Python dependencies +├── .dockerignore # Files to ignore during image build +└── README.md # Project documentation ``` # Setup and Deployment @@ -97,3 +98,32 @@ The `/k8s/data` endpoint retrieves information about: | GET | /k8s/data | Get Kubernetes cluster information | | GET | /think/k8s | Get AI summary for Kubernetes cluster | | GET | /export | Export data in JSON or YAML format | + +## Hetzner Integration +To fetch virtual machines from Hetzner Cloud: + +1. Ensure your Hetzner API token is available as an environment variable: + + ```shell + export HETZNER_TOKEN= + ``` + +2. Use the /vm/import-hetzner endpoint: + + ```shell + curl http:///vm/import_hetzner + ``` + +## Data Export + +1. Export in YAML format: + +```shell +curl -X GET "http:///export?format=yaml" +``` + +2. Export in JSON format: + +```shell +curl -X GET "http:///export?format=json" +```