Sunucular
Hizmetlerin kurulduğu sunucuları tanımlayan, sınayan ve mevcut hesapları içe aktaran on bir uç.
Genel Bakış
Sunucu, hizmetlerin gerçekten kurulduğu yerdir. Bu uçlar sunucuyu tanımlar, bağlantısını sınar, panel üzerindeki görünürlüğünü ayarlar ve sunucuda hâlihazırda duran hesapları WISECP'ye taşır.
Kimlik bilgileri tek yönlüdür: parolayı ve erişim anahtarını yazarsınız ama hiçbir uçtan geri okuyamazsınız. Detayda yalnız tanımlı olup olmadıkları görünür.
Referans
Sunucuları Listeleme
Hizmetlerin kurulduğu sunucuları döndürür.
active ya da inactive.curl 'https://panel.ornek.com/api/v1/admin/products/servers' \
-H "Authorization: Bearer $API_KEY"const res = await fetch('https://panel.ornek.com/api/v1/admin/products/servers', {
headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/products/servers');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Products()->GetServers();Sunucu Detayı
Bir sunucunun tüm ayarlarını döndürür. Parola ve erişim anahtarı hiçbir zaman geri gelmez.
active ya da inactive.curl 'https://panel.ornek.com/api/v1/admin/products/servers/34' \
-H "Authorization: Bearer $API_KEY"const res = await fetch('https://panel.ornek.com/api/v1/admin/products/servers/34', {
headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/products/servers/34');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Products()->GetServer(['id' => 34]);
// Parolanin kendisi yok; yalnizca tanimli olup olmadigi var.
$ready = $response['data']['has_password'] || $response['data']['has_access_hash'];{
"data": {
"id": 34,
"name": "srv1.example.com",
"type": "cPanel",
"ip": "192.0.2.10",
"username": "root",
"has_password": true,
"has_access_hash": false,
"port": 2087,
"secure": true,
"nameservers": ["ns1.example.com", "ns2.example.com"],
"max_accounts": 200,
"full_alert": 0,
"cost": { "price": 0, "currency_id": 147 },
"status": "active",
"fields": { "api_url": "https://panel.example.com/" },
"disabled_features": null
}
}Sunucu Ekleme
Yeni bir provizyon sunucusu ekler.
has_password ile has_access_hash olarak bildirilir, sır işaretli modül alanları maskelenir.curl -X POST 'https://panel.ornek.com/api/v1/admin/products/servers' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"type":"cPanel","name":"srv1.example.com","ip":"192.0.2.10","username":"root","password":"secret","port":2087,"secure":true,"nameservers":["ns1.example.com","ns2.example.com"]}'const res = await fetch('https://panel.ornek.com/api/v1/admin/products/servers', {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
type: 'cPanel',
name: 'srv1.example.com',
ip: '192.0.2.10',
username: 'root',
password: 'secret',
port: 2087,
secure: true,
}),
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/products/servers');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'type' => 'cPanel',
'name' => 'srv1.example.com',
'ip' => '192.0.2.10',
'username' => 'root',
'password' => $secret,
'port' => 2087,
'secure' => true,
]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);// Eklemeden once ayni govdeyle baglantiyi deneyin: test hicbir sey yazmaz.
$test = Api::Products()->TestServerConnection([
'type' => 'cPanel',
'ip' => '192.0.2.10',
'username' => 'root',
'password' => $secret,
]);
if ($test['data']['connected'] ?? false) {
Api::Products()->CreateServer([
'type' => 'cPanel',
'name' => 'srv1.example.com',
'ip' => '192.0.2.10',
'username' => 'root',
'password' => $secret,
]);
}Sunucuyu Güncelleme
Gönderdiğiniz alanları uygular. Parola göndermezseniz mevcut parola korunur.
curl -X PATCH 'https://panel.ornek.com/api/v1/admin/products/servers/34' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"max_accounts":300,"secure":true}'const res = await fetch('https://panel.ornek.com/api/v1/admin/products/servers/34', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ max_accounts: 300, secure: true }),
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/products/servers/34');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode(['max_accounts' => 300, 'secure' => true]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);// Detaydan okunan maskeli parolayi geri gondermek zararsizdir: mevcut parola korunur.
Api::Products()->UpdateServer([
'id' => 34,
'max_accounts' => 300,
]);Sunucuyu Silme
Sunucuyu siler. Üzerinde iptal edilmemiş hizmet varsa silme reddedilir.
gate:product.server_delete kancası işlemi veto etti.curl -X DELETE 'https://panel.ornek.com/api/v1/admin/products/servers/34' \
-H "Authorization: Bearer $API_KEY"const res = await fetch('https://panel.ornek.com/api/v1/admin/products/servers/34', {
method: 'DELETE',
headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/products/servers/34');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Products()->DeleteServer(['id' => 34]);Toplu Durum Değiştirme
Birden çok sunucunun durumunu değiştirir. Doğrulama yazmadan önce tüm liste için yapılır.
active ya da inactive.ids boş.curl -X POST 'https://panel.ornek.com/api/v1/admin/products/servers/bulk' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"ids":[34,35],"action":"inactive"}'const res = await fetch('https://panel.ornek.com/api/v1/admin/products/servers/bulk', {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ ids: [34, 35], action: 'inactive' }),
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/products/servers/bulk');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'ids' => [34, 35],
'action' => 'inactive',
]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);// Tek bir sunucu reddedilirse HICBIRI degismez; yarim uygulanmis durum olusmaz.
$response = Api::Products()->BulkServers([
'ids' => [34, 35],
'action' => 'inactive',
]);Bağlantıyı Deneme
Verilen bağlantı bilgileriyle sunucuya ulaşılıp ulaşılmadığını denemekle kalır.
curl -X POST 'https://panel.ornek.com/api/v1/admin/products/servers/test-connection' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"type":"cPanel","ip":"192.0.2.10","username":"root","password":"secret","port":2087}'const res = await fetch('https://panel.ornek.com/api/v1/admin/products/servers/test-connection', {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
type: 'cPanel',
ip: '192.0.2.10',
username: 'root',
password: secret,
port: 2087,
}),
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/products/servers/test-connection');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'type' => 'cPanel',
'ip' => '192.0.2.10',
'username' => 'root',
'password' => $secret,
'port' => 2087,
]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);// Test var olan bir sunucuyu DENEMEZ; govdedeki bilgileri dener.
// Kayitli bir sunucuyu sinamak icin bilgilerini yeniden gonderirsiniz.
$test = Api::Products()->TestServerConnection([
'type' => 'cPanel',
'ip' => '192.0.2.10',
'username' => 'root',
'password' => $secret,
]);Panel Özelliklerini Kapatma
Bu sunucudaki hizmetlerde müşteriye gösterilmeyecek araç ve kartları belirler.
tools araç adları, cards kart adları, card_items kart başına gizlenecek satırlar.curl -X PATCH 'https://panel.ornek.com/api/v1/admin/products/servers/34/preferences' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"disabled_features":{"tools":["backup"],"cards":[],"card_items":{}}}'const res = await fetch('https://panel.ornek.com/api/v1/admin/products/servers/34/preferences', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
disabled_features: { tools: ['backup'], cards: [], card_items: {} },
}),
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/products/servers/34/preferences');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'disabled_features' => [
'tools' => ['backup'],
'cards' => [],
'card_items' => new stdClass(),
],
]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Products()->SetServerPreferences([
'id' => 34,
'disabled_features' => [
'tools' => ['backup'],
'cards' => [],
'card_items' => [],
],
]);Sunucu Paneline Giriş
Sunucunun yönetim paneline giriş bağlantısı üretir.
curl -X POST 'https://panel.ornek.com/api/v1/admin/products/servers/34/sso' \
-H "Authorization: Bearer $API_KEY"const res = await fetch('https://panel.ornek.com/api/v1/admin/products/servers/34/sso', {
method: 'POST',
headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/products/servers/34/sso');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);// Baglanti sunucunun YONETIM paneline acilir, bir musteri hesabina degil.
$response = Api::Products()->GetServerSso(['id' => 34]);
$url = $response['data']['login_url'] ?? null;İçe Aktarılabilir Hesapları Listeleme
Sunucuda var olan ama WISECP'de karşılığı olmayan hesapları döndürür.
curl -G 'https://panel.ornek.com/api/v1/admin/products/servers/34/importable' \
-H "Authorization: Bearer $API_KEY" \
-d limit=200const url = new URL('https://panel.ornek.com/api/v1/admin/products/servers/34/importable');
url.searchParams.set('limit', '200');
const res = await fetch(url, { headers: { Authorization: `Bearer ${apiKey}` } });
const body = await res.json();$url = 'https://panel.ornek.com/api/v1/admin/products/servers/34/importable?' . http_build_query(['limit' => 200]);
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$accounts = Api::Products()->GetServerImportable(['id' => 34], ['limit' => 200]);
// 'method' hangi listeleme yolunun kullanildigini soyler; sayfalama ona bagli.
$paged = ($accounts['meta']['method'] ?? '') === 'list';Hesapları İçe Aktarma
Sunucudaki hesapları WISECP hizmetlerine dönüştürür. Her satır bir müşteri ve ürüne bağlanır.
items boş.curl -X POST 'https://panel.ornek.com/api/v1/admin/products/servers/34/import' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"items": [
{
"info": { "username": "acct1", "domain": "client-domain.example" },
"user_id": 42,
"product_id": 15,
"price_id": 88,
"start": "2026-01-01 00:00:00"
}
]
}'const res = await fetch('https://panel.ornek.com/api/v1/admin/products/servers/34/import', {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
items: [
{
info: account,
user_id: 42,
product_id: 15,
price_id: 88,
start: '2026-01-01 00:00:00',
},
],
}),
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/products/servers/34/import');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'items' => [[
'info' => $account,
'user_id' => 42,
'product_id' => 15,
'price_id' => 88,
'start' => '2026-01-01 00:00:00',
]],
]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);// 'info' listeleme ucundan geldigi gibi gonderilir; degistirmeyin.
$accounts = Api::Products()->GetServerImportable(['id' => 34])['data'];
$items = [];
foreach ($accounts as $account)
$items[] = [
'info' => $account,
'user_id' => 42,
'product_id' => 15,
'price_id' => 88,
'start' => '2026-01-01 00:00:00',
];
$done = Api::Products()->ImportServerAccounts(['id' => 34, 'items' => $items]);
// Gonderilen ile olusan sayiyi karsilastirin: eksik eslemeli satirlar elenmistir.
$dropped = count($items) - count($done['data']['imported']);Tuzaklar
Parola ve erişim anahtarı hiçbir yanıtta yer almaz; detayda yalnız tanımlı olup olmadıkları görünür. Modülün gizli işaretli alanları da yıldızlarla maskelenir. Bu maskeyi güncellemede geri göndermek zararsızdır: mevcut değer korunur, maske kaydedilmez.
Test ucu gövdede verdiğiniz bilgileri dener ve hiçbir şey yazmaz. Kayıtlı bir sunucunun hâlâ çalışıp çalışmadığını sınamak isterseniz bilgilerini yeniden göndermeniz gerekir; parolayı geri okuyamayacağınız için o parolayı kendi tarafınızda tutuyor olmalısınız.
Toplu durum değiştirme önce listenin tamamını doğrular, sonra yazar. Bir sunucu hâlâ bir ürüne ya da aktif bir hizmete bağlıysa istek reddedilir ve hiçbir sunucu değişmez. Hata ayrıntısı hangi sunucunun ve hangi bağın engellediğini söyler.
Müşteri, ürün ya da fiyat kimliği eksik olan satırlar atlanır ve yanıtta yer almaz. Hepsi eksikse no_valid_items alırsınız, ama bazıları eksikse istek başarılı görünür. Gönderdiğiniz satır sayısıyla dönen hizmet sayısını karşılaştırın.
İlgili Makaleler
Geri bildiriminiz için teşekkürler!
Yukarıda bulamadığınız her şey için destek ekibimiz her zaman yanınızda.