$token = Get-Content 'c:\Users\Administrator\.ssh\coolify-redbull-token'
$baseUrl = "https://redbull.rede5.com.br/api/v1"

Write-Host "Fetching Servers..."
$serversUrl = "$baseUrl/servers"
$servers = Invoke-RestMethod -Uri $serversUrl -Headers @{Authorization = "Bearer $token" } -Method Get
$servers | ConvertTo-Json -Depth 3 | Out-File -Encoding ASCII c:\dev\servers_ascii.json

Write-Host "Fetching Projects..."
$projectsUrl = "$baseUrl/projects"
$projects = Invoke-RestMethod -Uri $projectsUrl -Headers @{Authorization = "Bearer $token" } -Method Get
$projects | ConvertTo-Json -Depth 3 | Out-File -Encoding ASCII c:\dev\projects_ascii.json
