mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-16 07:16:38 +00:00
[management] Add custom dns zones (#4849)
This commit is contained in:
@@ -25,6 +25,8 @@ tags:
|
||||
description: Interact with and view information about routes.
|
||||
- name: DNS
|
||||
description: Interact with and view information about DNS configuration.
|
||||
- name: DNS Zones
|
||||
description: Interact with and view information about custom DNS zones.
|
||||
- name: Events
|
||||
description: View information about the account and network events.
|
||||
- name: Accounts
|
||||
@@ -1779,6 +1781,100 @@ components:
|
||||
example: ch8i4ug6lnn4g9hqv7m0
|
||||
required:
|
||||
- disabled_management_groups
|
||||
ZoneRequest:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
description: Zone name identifier
|
||||
type: string
|
||||
maxLength: 255
|
||||
minLength: 1
|
||||
example: Office Zone
|
||||
domain:
|
||||
description: Zone domain (FQDN)
|
||||
type: string
|
||||
example: example.com
|
||||
enabled:
|
||||
description: Zone status
|
||||
type: boolean
|
||||
default: true
|
||||
enable_search_domain:
|
||||
description: Enable this zone as a search domain
|
||||
type: boolean
|
||||
example: false
|
||||
distribution_groups:
|
||||
description: Group IDs that defines groups of peers that will resolve this zone
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
example: ch8i4ug6lnn4g9hqv7m0
|
||||
required:
|
||||
- name
|
||||
- domain
|
||||
- enable_search_domain
|
||||
- distribution_groups
|
||||
Zone:
|
||||
allOf:
|
||||
- type: object
|
||||
properties:
|
||||
id:
|
||||
description: Zone ID
|
||||
type: string
|
||||
example: ch8i4ug6lnn4g9hqv7m0
|
||||
records:
|
||||
description: DNS records associated with this zone
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/DNSRecord'
|
||||
required:
|
||||
- id
|
||||
- enabled
|
||||
- records
|
||||
- $ref: '#/components/schemas/ZoneRequest'
|
||||
DNSRecordType:
|
||||
type: string
|
||||
description: DNS record type
|
||||
enum:
|
||||
- A
|
||||
- AAAA
|
||||
- CNAME
|
||||
example: A
|
||||
DNSRecordRequest:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
description: FQDN for the DNS record. Must be a subdomain within or match the zone's domain.
|
||||
type: string
|
||||
example: www.example.com
|
||||
type:
|
||||
$ref: '#/components/schemas/DNSRecordType'
|
||||
content:
|
||||
description: DNS record content (IP address for A/AAAA, domain for CNAME)
|
||||
type: string
|
||||
maxLength: 255
|
||||
minLength: 1
|
||||
example: 192.168.1.1
|
||||
ttl:
|
||||
description: Time to live in seconds
|
||||
type: integer
|
||||
minimum: 0
|
||||
example: 300
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
- content
|
||||
- ttl
|
||||
DNSRecord:
|
||||
allOf:
|
||||
- type: object
|
||||
properties:
|
||||
id:
|
||||
description: DNS record ID
|
||||
type: string
|
||||
example: ch8i4ug6lnn4g9hqv7m0
|
||||
required:
|
||||
- id
|
||||
- $ref: '#/components/schemas/DNSRecordRequest'
|
||||
Event:
|
||||
type: object
|
||||
properties:
|
||||
@@ -4733,6 +4829,347 @@ paths:
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/dns/zones:
|
||||
get:
|
||||
summary: List all DNS Zones
|
||||
description: Returns a list of all custom DNS zones
|
||||
tags: [ DNS Zones ]
|
||||
security:
|
||||
- BearerAuth: [ ]
|
||||
- TokenAuth: [ ]
|
||||
responses:
|
||||
'200':
|
||||
description: A JSON Array of DNS Zones
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Zone'
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
post:
|
||||
summary: Create a DNS Zone
|
||||
description: Creates a new custom DNS zone
|
||||
tags: [ DNS Zones ]
|
||||
security:
|
||||
- BearerAuth: [ ]
|
||||
- TokenAuth: [ ]
|
||||
requestBody:
|
||||
description: A DNS zone object
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
$ref: '#/components/schemas/ZoneRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: A JSON Object of the created DNS Zone
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Zone'
|
||||
'400':
|
||||
"$ref": "#/components/responses/bad_request"
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/dns/zones/{zoneId}:
|
||||
get:
|
||||
summary: Retrieve a DNS Zone
|
||||
description: Returns information about a specific DNS zone
|
||||
tags: [ DNS Zones ]
|
||||
security:
|
||||
- BearerAuth: [ ]
|
||||
- TokenAuth: [ ]
|
||||
parameters:
|
||||
- in: path
|
||||
name: zoneId
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: The unique identifier of a zone
|
||||
example: chacbco6lnnbn6cg5s91
|
||||
responses:
|
||||
'200':
|
||||
description: A JSON Object of a DNS Zone
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Zone'
|
||||
'400':
|
||||
"$ref": "#/components/responses/bad_request"
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'404':
|
||||
"$ref": "#/components/responses/not_found"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
put:
|
||||
summary: Update a DNS Zone
|
||||
description: Updates a custom DNS zone
|
||||
tags: [ DNS Zones ]
|
||||
security:
|
||||
- BearerAuth: [ ]
|
||||
- TokenAuth: [ ]
|
||||
parameters:
|
||||
- in: path
|
||||
name: zoneId
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: The unique identifier of a zone
|
||||
example: chacbco6lnnbn6cg5s91
|
||||
requestBody:
|
||||
description: A DNS zone object
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
$ref: '#/components/schemas/ZoneRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: A JSON Object of the updated DNS Zone
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Zone'
|
||||
'400':
|
||||
"$ref": "#/components/responses/bad_request"
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'404':
|
||||
"$ref": "#/components/responses/not_found"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
delete:
|
||||
summary: Delete a DNS Zone
|
||||
description: Deletes a custom DNS zone
|
||||
tags: [ DNS Zones ]
|
||||
security:
|
||||
- BearerAuth: [ ]
|
||||
- TokenAuth: [ ]
|
||||
parameters:
|
||||
- in: path
|
||||
name: zoneId
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: The unique identifier of a zone
|
||||
example: chacbco6lnnbn6cg5s91
|
||||
responses:
|
||||
'200':
|
||||
description: Zone deletion successful
|
||||
'400':
|
||||
"$ref": "#/components/responses/bad_request"
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'404':
|
||||
"$ref": "#/components/responses/not_found"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/dns/zones/{zoneId}/records:
|
||||
get:
|
||||
summary: List all DNS Records
|
||||
description: Returns a list of all DNS records in a zone
|
||||
tags: [ DNS Zones ]
|
||||
security:
|
||||
- BearerAuth: [ ]
|
||||
- TokenAuth: [ ]
|
||||
parameters:
|
||||
- in: path
|
||||
name: zoneId
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: The unique identifier of a zone
|
||||
example: chacbco6lnnbn6cg5s91
|
||||
responses:
|
||||
'200':
|
||||
description: A JSON Array of DNS Records
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/DNSRecord'
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'404':
|
||||
"$ref": "#/components/responses/not_found"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
post:
|
||||
summary: Create a DNS Record
|
||||
description: Creates a new DNS record in a zone
|
||||
tags: [ DNS Zones ]
|
||||
security:
|
||||
- BearerAuth: [ ]
|
||||
- TokenAuth: [ ]
|
||||
parameters:
|
||||
- in: path
|
||||
name: zoneId
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: The unique identifier of a zone
|
||||
example: chacbco6lnnbn6cg5s91
|
||||
requestBody:
|
||||
description: A DNS record object
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
$ref: '#/components/schemas/DNSRecordRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: A JSON Object of the created DNS Record
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DNSRecord'
|
||||
'400':
|
||||
"$ref": "#/components/responses/bad_request"
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'404':
|
||||
"$ref": "#/components/responses/not_found"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/dns/zones/{zoneId}/records/{recordId}:
|
||||
get:
|
||||
summary: Retrieve a DNS Record
|
||||
description: Returns information about a specific DNS record
|
||||
tags: [ DNS Zones ]
|
||||
security:
|
||||
- BearerAuth: [ ]
|
||||
- TokenAuth: [ ]
|
||||
parameters:
|
||||
- in: path
|
||||
name: zoneId
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: The unique identifier of a zone
|
||||
example: chacbco6lnnbn6cg5s91
|
||||
- in: path
|
||||
name: recordId
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: The unique identifier of a DNS record
|
||||
example: chacbco6lnnbn6cg5s92
|
||||
responses:
|
||||
'200':
|
||||
description: A JSON Object of a DNS Record
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DNSRecord'
|
||||
'400':
|
||||
"$ref": "#/components/responses/bad_request"
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'404':
|
||||
"$ref": "#/components/responses/not_found"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
put:
|
||||
summary: Update a DNS Record
|
||||
description: Updates a DNS record in a zone
|
||||
tags: [ DNS Zones ]
|
||||
security:
|
||||
- BearerAuth: [ ]
|
||||
- TokenAuth: [ ]
|
||||
parameters:
|
||||
- in: path
|
||||
name: zoneId
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: The unique identifier of a zone
|
||||
example: chacbco6lnnbn6cg5s91
|
||||
- in: path
|
||||
name: recordId
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: The unique identifier of a DNS record
|
||||
example: chacbco6lnnbn6cg5s92
|
||||
requestBody:
|
||||
description: A DNS record object
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
$ref: '#/components/schemas/DNSRecordRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: A JSON Object of the updated DNS Record
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DNSRecord'
|
||||
'400':
|
||||
"$ref": "#/components/responses/bad_request"
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'404':
|
||||
"$ref": "#/components/responses/not_found"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
delete:
|
||||
summary: Delete a DNS Record
|
||||
description: Deletes a DNS record from a zone
|
||||
tags: [ DNS Zones ]
|
||||
security:
|
||||
- BearerAuth: [ ]
|
||||
- TokenAuth: [ ]
|
||||
parameters:
|
||||
- in: path
|
||||
name: zoneId
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: The unique identifier of a zone
|
||||
example: chacbco6lnnbn6cg5s91
|
||||
- in: path
|
||||
name: recordId
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: The unique identifier of a DNS record
|
||||
example: chacbco6lnnbn6cg5s92
|
||||
responses:
|
||||
'200':
|
||||
description: Record deletion successful
|
||||
'400':
|
||||
"$ref": "#/components/responses/bad_request"
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'404':
|
||||
"$ref": "#/components/responses/not_found"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/events/audit:
|
||||
get:
|
||||
summary: List all Audit Events
|
||||
|
||||
Reference in New Issue
Block a user