الانتقال إلى المحتوى الرئيسي
PUT
/
instances
/
{instanceId}
/
peers
/
{peerId}
تحديث قرين
curl --request PUT \
  --url https://api.altostrat.io/instances/{instanceId}/peers/{peerId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "subnets": [
    "192.168.100.0/24"
  ],
  "route_all": true
}'
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "type": "client",
  "user_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
  "site_id": "c3d5e2a0-88c9-4f7f-9f7b-6a1e2b4c5d6e",
  "subnets": [
    "192.168.100.0/24"
  ],
  "route_all": false,
  "protocol": "wireguard",
  "connected": false,
  "connected_from": null,
  "token": "eyJpdiI6...",
  "token_ttl": 3600,
  "created_at": "2025-10-29T12:45:00Z"
}

Authorizations

Authorization
string
header
required

أدخل رمز الحامل (bearer token) الخاص بك بالتنسيق: Bearer {token}

Path Parameters

instanceId
string<uuid>
required

المعرّف الفريد (UUID) لمثيل VPN.

Example:

"d290f1ee-6c54-4b01-90e6-d701748f0851"

peerId
string<uuid>
required

المعرّف الفريد (UUID) للقرين.

Example:

"550e8400-e29b-41d4-a716-446655440000"

Body

application/json
subnets
string[]

قائمة محدثة بالشبكات الفرعية لقرين من نوع site.

route_all
boolean

إعداد route_all محدث لقرين من نوع client.

Example:

true

Response

تم تحديث القرين بنجاح.

id
string<uuid>

المعرّف الفريد للقرين.

Example:

"550e8400-e29b-41d4-a716-446655440000"

type
enum<string>

نوع القرين. client يمثل مستخدمًا فرديًا، بينما site يمثل اتصال من موقع إلى موقع.

الخيارات المتاحة:
client,
site
Example:

"client"

user_id
string<uuid> | null

المعرّف الفريد للمستخدم، إذا كان نوع القرين client.

Example:

"a1b2c3d4-e5f6-7890-1234-567890abcdef"

site_id
string<uuid> | null

المعرّف الفريد للموقع، إذا كان نوع القرين site.

Example:

"c3d5e2a0-88c9-4f7f-9f7b-6a1e2b4c5d6e"

subnets
string[]

قائمة بالشبكات الفرعية (بتدوين CIDR) التي يوجهها هذا القرين. تنطبق فقط على أقران من نوع site.

route_all
boolean

إذا كانت القيمة true، سيتم توجيه كل حركة مرور العميل عبر VPN. تنطبق فقط على أقران من نوع client.

Example:

false

protocol
enum<string>

بروتوكول VPN المستخدم من قبل هذا القرين.

الخيارات المتاحة:
wireguard,
openvpn
Example:

"wireguard"

connected
boolean

يشير إلى ما إذا كان القرين متصلاً حاليًا.

Example:

false

connected_from
string<ipv4> | null

عنوان IP العام للقرين المتصل.

Example:

null

token
string | null

رمز قصير الأجل لأقران من نوع client لاسترداد ملفات التكوين الخاصة بهم. ليس للاستخدام المباشر في API.

Example:

"eyJpdiI6..."

token_ttl
integer

مدة صلاحية الرمز بالثواني (time-to-live).

Example:

3600

created_at
string<date-time>

الطابع الزمني عند إنشاء القرين.

Example:

"2025-10-29T12:45:00Z"