Files
loc_az_hci/docs/reference/api-reference.md

112 lines
2.5 KiB
Markdown
Raw Permalink Normal View History

# API Reference
API documentation for the Azure Stack HCI project.
## Proxmox API
### Authentication
```bash
# Get ticket
curl -k -d "username=root@pam&password=YOUR_PASSWORD" \
https://PROXMOX_HOST:8006/api2/json/access/ticket
# Use ticket in subsequent requests
curl -k -H "Cookie: PVEAuthCookie=TICKET" \
-H "CSRFPreventionToken: TOKEN" \
https://PROXMOX_HOST:8006/api2/json/version
```
### Common Endpoints
- `GET /api2/json/version` - Get Proxmox version
- `GET /api2/json/cluster/status` - Get cluster status
- `GET /api2/json/nodes` - List nodes
- `GET /api2/json/nodes/{node}/qemu` - List VMs on node
- `POST /api2/json/nodes/{node}/qemu` - Create VM
- `GET /api2/json/nodes/{node}/qemu/{vmid}/config` - Get VM config
- `PUT /api2/json/nodes/{node}/qemu/{vmid}/config` - Update VM config
## Azure Arc API
### Connected Machines
```bash
# List connected machines
az connectedmachine list --resource-group HC-Stack
# Get machine details
az connectedmachine show \
--resource-group HC-Stack \
--name MACHINE_NAME
# Delete machine
az connectedmachine delete \
--resource-group HC-Stack \
--name MACHINE_NAME
```
### Kubernetes Clusters
```bash
# List connected clusters
az connectedk8s list --resource-group HC-Stack
# Get cluster details
az connectedk8s show \
--resource-group HC-Stack \
--name CLUSTER_NAME
```
## Kubernetes API
### Common kubectl Commands
```bash
# Get nodes
kubectl get nodes
# Get pods
kubectl get pods --all-namespaces
# Get services
kubectl get services --all-namespaces
# Get deployments
kubectl get deployments --all-namespaces
# Describe resource
kubectl describe pod POD_NAME -n NAMESPACE
# Get logs
kubectl logs POD_NAME -n NAMESPACE
# Execute command in pod
kubectl exec -it POD_NAME -n NAMESPACE -- COMMAND
```
## Cloudflare API
### Tunnel Management
```bash
# List tunnels
curl -X GET "https://api.cloudflare.com/client/v4/accounts/ACCOUNT_ID/cfd_tunnel" \
-H "Authorization: Bearer API_TOKEN" \
-H "Content-Type: application/json"
# Create tunnel
curl -X POST "https://api.cloudflare.com/client/v4/accounts/ACCOUNT_ID/cfd_tunnel" \
-H "Authorization: Bearer API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"tunnel-name","config_src":"cloudflare"}'
```
## Additional Resources
- [Proxmox VE API Documentation](https://pve.proxmox.com/pve-docs/api-viewer/index.html)
- [Azure Arc REST API](https://docs.microsoft.com/rest/api/azurearc/)
- [Kubernetes API Documentation](https://kubernetes.io/docs/reference/kubernetes-api/)
- [Cloudflare API Documentation](https://developers.cloudflare.com/api/)