SwitchHero API ve entegrasyon kılavuzları
SwitchHero API'sini kullanmaya başlamak için aşağıdaki adımları takip edin:
API anahtarınızı kontrol panelinden oluşturabilirsiniz:
curl -X POST https://api.switchhero.com/v1/auth/token \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "your_password"}'
Switchlerinizi listelemek için:
curl -X GET https://api.switchhero.com/v1/switches \
-H "Authorization: Bearer YOUR_API_KEY"
Tüm API isteklerinde Bearer token kullanılmalıdır:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_in": 3600
}
{
"ip": "192.168.1.1",
"name": "Core Switch 1",
"model": "Cisco Catalyst 9300",
"credentials": {
"username": "admin",
"password": "secure_password"
}
}
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| ip | string | Evet | Switch'in IP adresi |
| name | string | Evet | Switch'in görünen adı |
| model | string | Hayır | Switch modeli |
{
"ports": [
{
"id": 1,
"name": "GigabitEthernet1/0/1",
"status": "up",
"speed": "1000",
"duplex": "full",
"vlan": 1
}
]
}