refactor: update AS entry handling in API and database to support ASN-only entries. Remove prefix field from AS entry structure and adjust related functions and tests. Enhance OpenAPI specifications and documentation to reflect changes in AS entry representation.

This commit is contained in:
Denozordec
2026-04-05 22:38:17 +07:00
parent 73d0003281
commit 1db6b5b7b2
19 changed files with 218 additions and 115 deletions
+1 -1
View File
@@ -59,7 +59,7 @@
| Метод | Путь | Описание |
|-------|------|----------|
| `GET` | `/v1/modules/{module_id}/as-entries` | Список ASN/префиксов. |
| `GET` | `/v1/modules/{module_id}/as-entries` | Список записей: ASN + community. |
| `POST` | `/v1/modules/{module_id}/as-entries` | Добавить. |
| `PATCH` | `/v1/modules/{module_id}/as-entries/{entry_id}` | Обновить. |
| `DELETE` | `/v1/modules/{module_id}/as-entries/{entry_id}` | Удалить. |
+23 -8
View File
@@ -433,25 +433,38 @@ components:
type: object
required:
- id
- asn
properties:
id:
$ref: "#/components/schemas/ResourceId"
asn:
type: ["integer", "null"]
prefix:
type: ["string", "null"]
description: CIDR или префикс в зависимости от модели.
type: integer
minimum: 1
maximum: 4294967295
community_id:
type: ["string", "null"]
additionalProperties: true
AsEntryCreate:
type: object
required:
- asn
properties:
asn:
type: integer
prefix:
type: string
minimum: 1
maximum: 4294967295
community_id:
type: ["string", "null"]
additionalProperties: true
AsEntryPatch:
type: object
properties:
asn:
type: integer
minimum: 1
maximum: 4294967295
community_id:
type: ["string", "null"]
additionalProperties: true
@@ -600,7 +613,9 @@ components:
PrefixSnapshotItem:
type: object
description: Элемент материализованного снимка префиксов (детали - по реализации).
description: >
Элемент материализованного снимка. Поле prefix обычно содержит CIDR;
для модулей AS_PREFIXES допускается ключ вида as:<номер_asn> (не CIDR).
additionalProperties: true
Job:
@@ -1166,7 +1181,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/AsEntryCreate"
$ref: "#/components/schemas/AsEntryPatch"
responses:
"200":
description: Успешно.
+1 -1
View File
@@ -8,7 +8,7 @@ EvoBGP — это control plane для описания источников п
| Тип | Назначение |
|-----|------------|
| `AS_PREFIXES` | ASN и связанные префиксы |
| `AS_PREFIXES` | Номера AS и привязка к BGP community (без статического CIDR в записи) |
| `CDN_CIDRS` | CIDR из внешних CDN-источников (URL, виды источников) |
| `DOMAINS` | FQDN с привязкой к BGP community; опционально DoH-профили |
| `IP_RANGES` | Статические CIDR + `community_id` (данные в БД, без внешнего ingest по URL) |